diff options
Diffstat (limited to 'fitz/fitz.h')
-rw-r--r-- | fitz/fitz.h | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/fitz/fitz.h b/fitz/fitz.h index 7243c341..0e025e44 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -748,6 +748,18 @@ struct fz_rect_s }; /* + fz_irect is a rectangle using integers instead of floats. + + It's used in the draw device and for pixmap dimensions. +*/ +typedef struct fz_irect_s fz_irect; +struct fz_irect_s +{ + int x0, y0; + int x1, y1; +}; + +/* A rectangle with sides of length one. The bottom left corner is at (0, 0) and the top right corner @@ -761,6 +773,7 @@ extern const fz_rect fz_unit_rect; Both the top left and bottom right corner are at (0, 0). */ extern const fz_rect fz_empty_rect; +extern const fz_irect fz_empty_irect; /* An infinite rectangle with negative area. @@ -769,6 +782,7 @@ extern const fz_rect fz_empty_rect; at (-1, -1). */ extern const fz_rect fz_infinite_rect; +extern const fz_irect fz_infinite_irect; /* fz_is_empty_rect: Check if rectangle is empty. @@ -912,6 +926,7 @@ float fz_matrix_expansion(fz_matrix m); /* sumatrapdf */ Does not throw exceptions. */ fz_rect fz_intersect_rect(fz_rect a, fz_rect b); +fz_irect fz_intersect_irect(fz_irect a, fz_irect b); /* fz_union_rect: Compute union of two rectangles. @@ -938,7 +953,7 @@ fz_rect fz_union_rect(fz_rect a, fz_rect b); Does not throw exceptions. */ -fz_rect fz_rect_covering_rect(fz_rect rect); +fz_irect fz_rect_covering_rect(fz_rect rect); /* fz_round_rect: Round rectangle coordinates. @@ -956,7 +971,9 @@ fz_rect fz_rect_covering_rect(fz_rect rect); Does not throw exceptions. */ -fz_rect fz_round_rect(fz_rect rect); +fz_irect fz_round_rect(fz_rect rect); + +fz_rect fz_rect_from_irect(fz_irect rect); /* fz_expand_rect: Expand a bbox by a given amount in all directions. @@ -973,6 +990,7 @@ fz_rect fz_expand_rect(fz_rect b, float expand); Does not throw exceptions. */ fz_rect fz_translate_rect(fz_rect a, float xoff, float yoff); +fz_irect fz_translate_irect(fz_irect a, int xoff, int yoff); /* fz_transform_point: Apply a transformation to a point. @@ -1245,7 +1263,7 @@ typedef struct fz_pixmap_s fz_pixmap; /* fz_pixmap_bbox: Return the bounding box for a pixmap. */ -fz_rect fz_pixmap_bbox(fz_context *ctx, fz_pixmap *pix); +fz_irect fz_pixmap_bbox(fz_context *ctx, fz_pixmap *pix); /* fz_pixmap_width: Return the width of the pixmap in pixels. @@ -1289,7 +1307,7 @@ fz_pixmap *fz_new_pixmap(fz_context *ctx, fz_colorspace *cs, int w, int h); Returns a pointer to the new pixmap. Throws exception on failure to allocate. */ -fz_pixmap *fz_new_pixmap_with_bbox(fz_context *ctx, fz_colorspace *colorspace, fz_rect bbox); +fz_pixmap *fz_new_pixmap_with_bbox(fz_context *ctx, fz_colorspace *colorspace, fz_irect bbox); /* fz_new_pixmap_with_data: Create a new pixmap, with it's origin at @@ -1328,7 +1346,7 @@ fz_pixmap *fz_new_pixmap_with_data(fz_context *ctx, fz_colorspace *colorspace, i Returns a pointer to the new pixmap. Throws exception on failure to allocate. */ -fz_pixmap *fz_new_pixmap_with_bbox_and_data(fz_context *ctx, fz_colorspace *colorspace, fz_rect rect, unsigned char *samples); +fz_pixmap *fz_new_pixmap_with_bbox_and_data(fz_context *ctx, fz_colorspace *colorspace, fz_irect rect, unsigned char *samples); /* fz_keep_pixmap: Take a reference to a pixmap. @@ -1396,7 +1414,7 @@ void fz_clear_pixmap_with_value(fz_context *ctx, fz_pixmap *pix, int value); Does not throw exceptions. */ -void fz_clear_pixmap_rect_with_value(fz_context *ctx, fz_pixmap *pix, int value, fz_rect r); +void fz_clear_pixmap_rect_with_value(fz_context *ctx, fz_pixmap *pix, int value, fz_irect r); /* fz_clear_pixmap_with_value: Sets all components (including alpha) of @@ -1423,7 +1441,7 @@ void fz_invert_pixmap(fz_context *ctx, fz_pixmap *pix); Does not throw exceptions. */ -void fz_invert_pixmap_rect(fz_pixmap *image, fz_rect rect); +void fz_invert_pixmap_rect(fz_pixmap *image, fz_irect rect); /* fz_gamma_pixmap: Apply gamma correction to a pixmap. All components @@ -1624,7 +1642,7 @@ fz_device *fz_new_draw_device(fz_context *ctx, fz_pixmap *dest); clip: Bounding box to restrict any marking operations of the draw device. */ -fz_device *fz_new_draw_device_with_bbox(fz_context *ctx, fz_pixmap *dest, fz_rect clip); +fz_device *fz_new_draw_device_with_bbox(fz_context *ctx, fz_pixmap *dest, fz_irect clip); /* Text extraction device: Used for searching, format conversion etc. |