mupdf
Loading...
Searching...
No Matches
bitmap.h File Reference
Include dependency graph for bitmap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  fz_bitmap

Typedefs

typedef struct fz_halftone fz_halftone

Functions

fz_bitmapfz_keep_bitmap (fz_context *ctx, fz_bitmap *bit)
void fz_drop_bitmap (fz_context *ctx, fz_bitmap *bit)
void fz_invert_bitmap (fz_context *ctx, fz_bitmap *bmp)
fz_bitmapfz_new_bitmap_from_pixmap (fz_context *ctx, fz_pixmap *pix, fz_halftone *ht)
fz_bitmapfz_new_bitmap_from_image (fz_context *ctx, fz_image *img, fz_halftone *ht)
fz_bitmapfz_new_bitmap_from_pixmap_band (fz_context *ctx, fz_pixmap *pix, fz_halftone *ht, int band_start)
fz_bitmapfz_new_bitmap (fz_context *ctx, int w, int h, int n, int xres, int yres)
void fz_bitmap_details (fz_bitmap *bitmap, int *w, int *h, int *n, int *stride)
void fz_clear_bitmap (fz_context *ctx, fz_bitmap *bit)
fz_halftonefz_default_halftone (fz_context *ctx, int num_comps)
fz_halftonefz_keep_halftone (fz_context *ctx, fz_halftone *half)
void fz_drop_halftone (fz_context *ctx, fz_halftone *ht)

Typedef Documentation

◆ fz_halftone

typedef struct fz_halftone fz_halftone

A halftone is a set of threshold tiles, one per component. Each threshold tile is a pixmap, possibly of varying sizes and phases. Currently, we only provide one 'default' halftone tile for operating on 1 component plus alpha pixmaps (where the alpha is ignored). This is signified by a fz_halftone pointer to NULL.

Function Documentation

◆ fz_bitmap_details()

void fz_bitmap_details ( fz_bitmap * bitmap,
int * w,
int * h,
int * n,
int * stride )

Retrieve details of a given bitmap.

bitmap: The bitmap to query.

w: Pointer to storage to retrieve width (or NULL).

h: Pointer to storage to retrieve height (or NULL).

n: Pointer to storage to retrieve number of color components (or NULL).

stride: Pointer to storage to retrieve bitmap stride (or NULL).

◆ fz_clear_bitmap()

void fz_clear_bitmap ( fz_context * ctx,
fz_bitmap * bit )

Set the entire bitmap to 0.

Never throws exceptions.

◆ fz_default_halftone()

fz_halftone * fz_default_halftone ( fz_context * ctx,
int num_comps )

Create a 'default' halftone structure for the given number of components.

num_comps: The number of components to use.

Returns a simple default halftone. The default halftone uses the same halftone tile for each plane, which may not be ideal for all purposes.

◆ fz_drop_bitmap()

void fz_drop_bitmap ( fz_context * ctx,
fz_bitmap * bit )

Drop a reference to the bitmap. When the reference count reaches zero, the bitmap will be destroyed.

Never throws exceptions.

◆ fz_drop_halftone()

void fz_drop_halftone ( fz_context * ctx,
fz_halftone * ht )

Drop a reference to the halftone. When the reference count reaches zero, the halftone is destroyed.

Never throws exceptions.

◆ fz_invert_bitmap()

void fz_invert_bitmap ( fz_context * ctx,
fz_bitmap * bmp )

Invert bitmap.

Never throws exceptions.

◆ fz_keep_bitmap()

fz_bitmap * fz_keep_bitmap ( fz_context * ctx,
fz_bitmap * bit )

Take an additional reference to the bitmap. The same pointer is returned.

Never throws exceptions.

◆ fz_keep_halftone()

fz_halftone * fz_keep_halftone ( fz_context * ctx,
fz_halftone * half )

Take an additional reference to the halftone. The same pointer is returned.

Never throws exceptions.

◆ fz_new_bitmap()

fz_bitmap * fz_new_bitmap ( fz_context * ctx,
int w,
int h,
int n,
int xres,
int yres )

Create a new bitmap.

w, h: Width and Height for the bitmap

n: Number of color components (assumed to be a divisor of 8)

xres, yres: X and Y resolutions (in pixels per inch).

Returns pointer to created bitmap structure. The bitmap data is uninitialised.

◆ fz_new_bitmap_from_image()

fz_bitmap * fz_new_bitmap_from_image ( fz_context * ctx,
fz_image * img,
fz_halftone * ht )

Make a bitmap from a pixmap and a halftone.

img: The image to generate from. Currently must be a single color component with no alpha.

ht: The halftone to use. NULL implies the default halftone.

Returns the resultant bitmap. Throws exceptions in the case of failure to allocate.

◆ fz_new_bitmap_from_pixmap()

fz_bitmap * fz_new_bitmap_from_pixmap ( fz_context * ctx,
fz_pixmap * pix,
fz_halftone * ht )

Make a bitmap from a pixmap and a halftone.

pix: The pixmap to generate from. Currently must be a single color component with no alpha.

ht: The halftone to use. NULL implies the default halftone.

Returns the resultant bitmap. Throws exceptions in the case of failure to allocate.

◆ fz_new_bitmap_from_pixmap_band()

fz_bitmap * fz_new_bitmap_from_pixmap_band ( fz_context * ctx,
fz_pixmap * pix,
fz_halftone * ht,
int band_start )

Make a bitmap from a pixmap and a halftone, allowing for the position of the pixmap within an overall banded rendering.

pix: The pixmap to generate from. Currently must be a single color component with no alpha.

ht: The halftone to use. NULL implies the default halftone.

band_start: Vertical offset within the overall banded rendering (in pixels)

Returns the resultant bitmap. Throws exceptions in the case of failure to allocate.