diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2013-02-06 15:14:20 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-02-06 19:24:15 +0000 |
commit | 0bd405c16618e1b0cdaba67fe61509cd113ba653 (patch) | |
tree | 4434bd3d873418feaa5d96d7a6f4539ec3b57fb4 /fitz | |
parent | b951f35ea59e27a21a63b84ec1506974ceab27a0 (diff) | |
download | mupdf-0bd405c16618e1b0cdaba67fe61509cd113ba653.tar.xz |
Rename bbox to irect.
Diffstat (limited to 'fitz')
-rw-r--r-- | fitz/base_geometry.c | 40 | ||||
-rw-r--r-- | fitz/fitz-internal.h | 28 | ||||
-rw-r--r-- | fitz/fitz.h | 46 | ||||
-rw-r--r-- | fitz/image_save.c | 2 | ||||
-rw-r--r-- | fitz/res_font.c | 8 | ||||
-rw-r--r-- | fitz/res_pixmap.c | 32 |
6 files changed, 78 insertions, 78 deletions
diff --git a/fitz/base_geometry.c b/fitz/base_geometry.c index cc69a108..d1d23eb8 100644 --- a/fitz/base_geometry.c +++ b/fitz/base_geometry.c @@ -270,12 +270,12 @@ const fz_rect fz_infinite_rect = { 1, 1, -1, -1 }; const fz_rect fz_empty_rect = { 0, 0, 0, 0 }; const fz_rect fz_unit_rect = { 0, 0, 1, 1 }; -const fz_bbox fz_infinite_bbox = { 1, 1, -1, -1 }; -const fz_bbox fz_empty_bbox = { 0, 0, 0, 0 }; -const fz_bbox fz_unit_bbox = { 0, 0, 1, 1 }; +const fz_irect fz_infinite_irect = { 1, 1, -1, -1 }; +const fz_irect fz_empty_irect = { 0, 0, 0, 0 }; +const fz_irect fz_unit_bbox = { 0, 0, 1, 1 }; -fz_bbox * -fz_bbox_from_rect(fz_bbox *restrict b, const fz_rect *restrict r) +fz_irect * +fz_irect_from_rect(fz_irect *restrict b, const fz_rect *restrict r) { int i; @@ -292,7 +292,7 @@ fz_bbox_from_rect(fz_bbox *restrict b, const fz_rect *restrict r) } fz_rect * -fz_rect_from_bbox(fz_rect *restrict r, const fz_bbox *restrict a) +fz_rect_from_irect(fz_rect *restrict r, const fz_irect *restrict a) { r->x0 = a->x0; r->y0 = a->y0; @@ -301,8 +301,8 @@ fz_rect_from_bbox(fz_rect *restrict r, const fz_bbox *restrict a) return r; } -fz_bbox * -fz_round_rect(fz_bbox * restrict b, const fz_rect *restrict r) +fz_irect * +fz_round_rect(fz_irect * restrict b, const fz_rect *restrict r) { int i; @@ -345,18 +345,18 @@ fz_intersect_rect(fz_rect *restrict a, const fz_rect *restrict b) return a; } -fz_bbox * -fz_intersect_bbox(fz_bbox *restrict a, const fz_bbox *restrict b) +fz_irect * +fz_intersect_irect(fz_irect *restrict a, const fz_irect *restrict b) { /* Check for empty box before infinite box */ - if (fz_is_empty_bbox(a)) return a; - if (fz_is_empty_bbox(b)) + if (fz_is_empty_irect(a)) return a; + if (fz_is_empty_irect(b)) { - *a = fz_empty_bbox; + *a = fz_empty_irect; return a; } - if (fz_is_infinite_bbox(b)) return a; - if (fz_is_infinite_bbox(a)) + if (fz_is_infinite_irect(b)) return a; + if (fz_is_infinite_irect(a)) { *a = *b; return a; @@ -370,7 +370,7 @@ fz_intersect_bbox(fz_bbox *restrict a, const fz_bbox *restrict b) if (a->y1 > b->y1) a->y1 = b->y1; if (a->x1 < a->x0 || a->y1 < a->y0) - *a = fz_empty_bbox; + *a = fz_empty_irect; return a; } @@ -399,13 +399,13 @@ fz_union_rect(fz_rect *restrict a, const fz_rect *restrict b) return a; } -fz_bbox * -fz_translate_bbox(fz_bbox *a, int xoff, int yoff) +fz_irect * +fz_translate_irect(fz_irect *a, int xoff, int yoff) { int t; - if (fz_is_empty_bbox(a)) return a; - if (fz_is_infinite_bbox(a)) return a; + if (fz_is_empty_irect(a)) return a; + if (fz_is_infinite_irect(a)) return a; a->x0 = ADD_WITH_SAT(t, a->x0, xoff); a->y0 = ADD_WITH_SAT(t, a->y0, yoff); a->x1 = ADD_WITH_SAT(t, a->x1, xoff); diff --git a/fitz/fitz-internal.h b/fitz/fitz-internal.h index cc8efafe..ed18b9d6 100644 --- a/fitz/fitz-internal.h +++ b/fitz/fitz-internal.h @@ -872,22 +872,22 @@ struct fz_pixmap_s void fz_free_pixmap_imp(fz_context *ctx, fz_storable *pix); -void fz_copy_pixmap_rect(fz_context *ctx, fz_pixmap *dest, fz_pixmap *src, const fz_bbox *r); +void fz_copy_pixmap_rect(fz_context *ctx, fz_pixmap *dest, fz_pixmap *src, const fz_irect *r); void fz_premultiply_pixmap(fz_context *ctx, fz_pixmap *pix); fz_pixmap *fz_alpha_from_gray(fz_context *ctx, fz_pixmap *gray, int luminosity); unsigned int fz_pixmap_size(fz_context *ctx, fz_pixmap *pix); -fz_pixmap *fz_scale_pixmap(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_bbox *clip); +fz_pixmap *fz_scale_pixmap(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_irect *clip); typedef struct fz_scale_cache_s fz_scale_cache; fz_scale_cache *fz_new_scale_cache(fz_context *ctx); void fz_free_scale_cache(fz_context *ctx, fz_scale_cache *cache); -fz_pixmap *fz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, const fz_bbox *clip, fz_scale_cache *cache_x, fz_scale_cache *cache_y); +fz_pixmap *fz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, const fz_irect *clip, fz_scale_cache *cache_x, fz_scale_cache *cache_y); void fz_subsample_pixmap(fz_context *ctx, fz_pixmap *tile, int factor); -fz_bbox *fz_pixmap_bbox_no_ctx(fz_pixmap *src, fz_bbox *bbox); +fz_irect *fz_pixmap_bbox_no_ctx(fz_pixmap *src, fz_irect *bbox); typedef struct fz_compression_params_s fz_compression_params; @@ -1187,10 +1187,10 @@ void fz_purge_glyph_cache(fz_context *ctx); fz_path *fz_outline_ft_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm); fz_path *fz_outline_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *ctm); fz_pixmap *fz_render_ft_glyph(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, int aa); -fz_pixmap *fz_render_t3_glyph(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, fz_colorspace *model, fz_bbox scissor); +fz_pixmap *fz_render_t3_glyph(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, fz_colorspace *model, fz_irect scissor); fz_pixmap *fz_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, const fz_matrix *ctm, fz_stroke_state *state); -fz_pixmap *fz_render_glyph(fz_context *ctx, fz_font*, int, const fz_matrix *, fz_colorspace *model, fz_bbox scissor); -fz_pixmap *fz_render_stroked_glyph(fz_context *ctx, fz_font*, int, const fz_matrix *, const fz_matrix *, fz_stroke_state *stroke, fz_bbox scissor); +fz_pixmap *fz_render_glyph(fz_context *ctx, fz_font*, int, const fz_matrix *, fz_colorspace *model, fz_irect scissor); +fz_pixmap *fz_render_stroked_glyph(fz_context *ctx, fz_font*, int, const fz_matrix *, const fz_matrix *, fz_stroke_state *stroke, fz_irect scissor); void fz_render_t3_glyph_direct(fz_context *ctx, fz_device *dev, fz_font *font, int gid, const fz_matrix *trm, void *gstate, int nestedDepth); void fz_prepare_t3_glyph(fz_context *ctx, fz_font *font, int gid, int nestedDepth); @@ -1318,7 +1318,7 @@ void fz_drop_shade(fz_context *ctx, fz_shade *shade); void fz_free_shade_imp(fz_context *ctx, fz_storable *shade); fz_rect *fz_bound_shade(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm, fz_rect *r); -void fz_paint_shade(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm, fz_pixmap *dest, const fz_bbox *bbox); +void fz_paint_shade(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm, fz_pixmap *dest, const fz_irect *bbox); /* * Handy routine for processing mesh based shades @@ -1357,13 +1357,13 @@ typedef struct fz_gel_s fz_gel; fz_gel *fz_new_gel(fz_context *ctx); void fz_insert_gel(fz_gel *gel, float x0, float y0, float x1, float y1); -void fz_reset_gel(fz_gel *gel, const fz_bbox *clip); +void fz_reset_gel(fz_gel *gel, const fz_irect *clip); void fz_sort_gel(fz_gel *gel); -fz_bbox *fz_bound_gel(const fz_gel *gel, fz_bbox *bbox); +fz_irect *fz_bound_gel(const fz_gel *gel, fz_irect *bbox); void fz_free_gel(fz_gel *gel); int fz_is_rect_gel(fz_gel *gel); -void fz_scan_convert(fz_gel *gel, int eofill, const fz_bbox *clip, fz_pixmap *pix, unsigned char *colorbv); +void fz_scan_convert(fz_gel *gel, int eofill, const fz_irect *clip, fz_pixmap *pix, unsigned char *colorbv); void fz_flatten_fill_path(fz_gel *gel, fz_path *path, const fz_matrix *ctm, float flatness); void fz_flatten_stroke_path(fz_gel *gel, fz_path *path, fz_stroke_state *stroke, const fz_matrix *ctm, float flatness, float linewidth); @@ -1476,12 +1476,12 @@ void fz_paint_solid_color(unsigned char * restrict dp, int n, int w, unsigned ch void fz_paint_span(unsigned char * restrict dp, unsigned char * restrict sp, int n, int w, int alpha); void fz_paint_span_with_color(unsigned char * restrict dp, unsigned char * restrict mp, int n, int w, unsigned char *color); -void fz_paint_image(fz_pixmap *dst, const fz_bbox *scissor, fz_pixmap *shape, fz_pixmap *img, const fz_matrix *ctm, int alpha); -void fz_paint_image_with_color(fz_pixmap *dst, const fz_bbox *scissor, fz_pixmap *shape, fz_pixmap *img, const fz_matrix *ctm, unsigned char *colorbv); +void fz_paint_image(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *img, const fz_matrix *ctm, int alpha); +void fz_paint_image_with_color(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *img, const fz_matrix *ctm, unsigned char *colorbv); void fz_paint_pixmap(fz_pixmap *dst, fz_pixmap *src, int alpha); void fz_paint_pixmap_with_mask(fz_pixmap *dst, fz_pixmap *src, fz_pixmap *msk); -void fz_paint_pixmap_with_bbox(fz_pixmap *dst, fz_pixmap *src, int alpha, fz_bbox bbox); +void fz_paint_pixmap_with_bbox(fz_pixmap *dst, fz_pixmap *src, int alpha, fz_irect bbox); void fz_blend_pixmap(fz_pixmap *dst, fz_pixmap *src, int alpha, int blendmode, int isolated, fz_pixmap *shape); void fz_blend_pixel(unsigned char dp[3], unsigned char bp[3], unsigned char sp[3], int blendmode); diff --git a/fitz/fitz.h b/fitz/fitz.h index 9fe3597e..a0f29dd9 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -764,12 +764,12 @@ static inline fz_point *fz_rect_max(fz_rect *f) } /* - fz_bbox is a rectangle using integers instead of floats. + fz_irect is a rectangle using integers instead of floats. It's used in the draw device and for pixmap dimensions. */ -typedef struct fz_bbox_s fz_bbox; -struct fz_bbox_s +typedef struct fz_irect_s fz_irect; +struct fz_irect_s { int x0, y0; int x1, y1; @@ -789,7 +789,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_bbox fz_empty_bbox; +extern const fz_irect fz_empty_irect; /* An infinite rectangle with negative area. @@ -798,7 +798,7 @@ extern const fz_bbox fz_empty_bbox; at (-1, -1). */ extern const fz_rect fz_infinite_rect; -extern const fz_bbox fz_infinite_bbox; +extern const fz_irect fz_infinite_irect; /* fz_is_empty_rect: Check if rectangle is empty. @@ -812,7 +812,7 @@ fz_is_empty_rect(const fz_rect *r) } static inline int -fz_is_empty_bbox(const fz_bbox *r) +fz_is_empty_irect(const fz_irect *r) { return ((r)->x0 == (r)->x1 || (r)->y0 == (r)->y1); } @@ -830,7 +830,7 @@ fz_is_infinite_rect(const fz_rect *r) } static inline int -fz_is_infinite_bbox(const fz_bbox *r) +fz_is_infinite_irect(const fz_irect *r) { return ((r)->x0 > (r)->x1 || (r)->y0 > (r)->y1); } @@ -1056,14 +1056,14 @@ float fz_matrix_expansion(const fz_matrix *m); /* sumatrapdf */ fz_rect *fz_intersect_rect(fz_rect *a, const fz_rect *b); /* - fz_intersect_bbox: Compute intersection of two bounding boxes. + fz_intersect_irect: Compute intersection of two bounding boxes. Similar to fz_intersect_rect but operates on two bounding boxes instead of two rectangles. Does not throw exceptions. */ -fz_bbox *fz_intersect_bbox(fz_bbox *a, const fz_bbox *b); +fz_irect *fz_intersect_irect(fz_irect *a, const fz_irect *b); /* fz_union_rect: Compute union of two rectangles. @@ -1080,7 +1080,7 @@ fz_bbox *fz_intersect_bbox(fz_bbox *a, const fz_bbox *b); fz_rect *fz_union_rect(fz_rect *a, const fz_rect *b); /* - fz_bbox_from_rect: Convert a rect into the minimal bounding box + fz_irect_from_rect: Convert a rect into the minimal bounding box that covers the rectangle. bbox: Place to store the returned bbox. @@ -1097,7 +1097,7 @@ fz_rect *fz_union_rect(fz_rect *a, const fz_rect *b); Does not throw exceptions. */ -fz_bbox *fz_bbox_from_rect(fz_bbox *bbox, const fz_rect *rect); +fz_irect *fz_irect_from_rect(fz_irect *bbox, const fz_rect *rect); /* fz_round_rect: Round rectangle coordinates. @@ -1107,7 +1107,7 @@ fz_bbox *fz_bbox_from_rect(fz_bbox *bbox, const fz_rect *rect); upwards and left while the bottom right corner is rounded downwards and to the right. - This differs from fz_bbox_from_rect, in that fz_bbox_from_rect + This differs from fz_irect_from_rect, in that fz_irect_from_rect slavishly follows the numbers (i.e any slight over/under calculations can cause whole extra pixels to be added). fz_round_rect allows for a small amount of rounding error when calculating @@ -1115,10 +1115,10 @@ fz_bbox *fz_bbox_from_rect(fz_bbox *bbox, const fz_rect *rect); Does not throw exceptions. */ -fz_bbox *fz_round_rect(fz_bbox *bbox, const fz_rect *rect); +fz_irect *fz_round_rect(fz_irect *bbox, const fz_rect *rect); /* - fz_rect_from_bbox: Convert a bbox into a rect. + fz_rect_from_irect: Convert a bbox into a rect. For our purposes, a rect can represent all the values we meet in a bbox, so nothing can go wrong. @@ -1131,7 +1131,7 @@ fz_bbox *fz_round_rect(fz_bbox *bbox, const fz_rect *rect); Does not throw exceptions. */ -fz_rect *fz_rect_from_bbox(fz_rect *rect, const fz_bbox *bbox); +fz_rect *fz_rect_from_irect(fz_rect *rect, const fz_irect *bbox); /* fz_expand_rect: Expand a bbox by a given amount in all directions. @@ -1141,13 +1141,13 @@ fz_rect *fz_rect_from_bbox(fz_rect *rect, const fz_bbox *bbox); fz_rect *fz_expand_rect(fz_rect *b, float expand); /* - fz_translate_bbox: Translate bounding box. + fz_translate_irect: Translate bounding box. Translate a bbox by a given x and y offset. Allows for overflow. Does not throw exceptions. */ -fz_bbox *fz_translate_bbox(fz_bbox *a, int xoff, int yoff); +fz_irect *fz_translate_irect(fz_irect *a, int xoff, int yoff); /* fz_translate_rect: Translate rectangle. @@ -1435,7 +1435,7 @@ typedef struct fz_pixmap_s fz_pixmap; /* fz_pixmap_bbox: Return the bounding box for a pixmap. */ -fz_bbox *fz_pixmap_bbox(fz_context *ctx, fz_pixmap *pix, fz_bbox *bbox); +fz_irect *fz_pixmap_bbox(fz_context *ctx, fz_pixmap *pix, fz_irect *bbox); /* fz_pixmap_width: Return the width of the pixmap in pixels. @@ -1479,7 +1479,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, const fz_bbox *bbox); +fz_pixmap *fz_new_pixmap_with_bbox(fz_context *ctx, fz_colorspace *colorspace, const fz_irect *bbox); /* fz_new_pixmap_with_data: Create a new pixmap, with it's origin at @@ -1518,7 +1518,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, const fz_bbox *rect, unsigned char *samples); +fz_pixmap *fz_new_pixmap_with_bbox_and_data(fz_context *ctx, fz_colorspace *colorspace, const fz_irect *rect, unsigned char *samples); /* fz_keep_pixmap: Take a reference to a pixmap. @@ -1586,7 +1586,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, const fz_bbox *r); +void fz_clear_pixmap_rect_with_value(fz_context *ctx, fz_pixmap *pix, int value, const fz_irect *r); /* fz_clear_pixmap_with_value: Sets all components (including alpha) of @@ -1613,7 +1613,7 @@ void fz_invert_pixmap(fz_context *ctx, fz_pixmap *pix); Does not throw exceptions. */ -void fz_invert_pixmap_rect(fz_pixmap *image, const fz_bbox *rect); +void fz_invert_pixmap_rect(fz_pixmap *image, const fz_irect *rect); /* fz_gamma_pixmap: Apply gamma correction to a pixmap. All components @@ -1814,7 +1814,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, const fz_bbox *clip); +fz_device *fz_new_draw_device_with_bbox(fz_context *ctx, fz_pixmap *dest, const fz_irect *clip); /* Text extraction device: Used for searching, format conversion etc. diff --git a/fitz/image_save.c b/fitz/image_save.c index 4f006f18..b0856507 100644 --- a/fitz/image_save.c +++ b/fitz/image_save.c @@ -10,7 +10,7 @@ void fz_write_pixmap(fz_context *ctx, fz_pixmap *img, char *file, int rgb) if (rgb && img->colorspace && img->colorspace != fz_device_rgb) { - fz_bbox bbox; + fz_irect bbox; converted = fz_new_pixmap_with_bbox(ctx, fz_device_rgb, fz_pixmap_bbox(ctx, img, &bbox)); fz_convert_pixmap(ctx, converted, img); img = converted; diff --git a/fitz/res_font.c b/fitz/res_font.c index e4882640..cef70d55 100644 --- a/fitz/res_font.c +++ b/fitz/res_font.c @@ -902,12 +902,12 @@ fz_bound_t3_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, } fz_pixmap * -fz_render_t3_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, fz_colorspace *model, fz_bbox scissor) +fz_render_t3_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, fz_colorspace *model, fz_irect scissor) { fz_display_list *list; fz_matrix ctm; fz_rect bounds; - fz_bbox bbox; + fz_irect bbox; fz_device *dev; fz_pixmap *glyph; fz_pixmap *result; @@ -937,8 +937,8 @@ fz_render_t3_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm } fz_expand_rect(fz_bound_glyph(ctx, font, gid, trm, &bounds), 1); - fz_bbox_from_rect(&bbox, &bounds); - fz_intersect_bbox(&bbox, &scissor); + fz_irect_from_rect(&bbox, &bounds); + fz_intersect_irect(&bbox, &scissor); glyph = fz_new_pixmap_with_bbox(ctx, model ? model : fz_device_gray, &bbox); fz_clear_pixmap(ctx, glyph); diff --git a/fitz/res_pixmap.c b/fitz/res_pixmap.c index 53d0116a..08e88a32 100644 --- a/fitz/res_pixmap.c +++ b/fitz/res_pixmap.c @@ -83,7 +83,7 @@ fz_new_pixmap(fz_context *ctx, fz_colorspace *colorspace, int w, int h) } fz_pixmap * -fz_new_pixmap_with_bbox(fz_context *ctx, fz_colorspace *colorspace, const fz_bbox *r) +fz_new_pixmap_with_bbox(fz_context *ctx, fz_colorspace *colorspace, const fz_irect *r) { fz_pixmap *pixmap; pixmap = fz_new_pixmap(ctx, colorspace, r->x1 - r->x0, r->y1 - r->y0); @@ -93,7 +93,7 @@ fz_new_pixmap_with_bbox(fz_context *ctx, fz_colorspace *colorspace, const fz_bbo } fz_pixmap * -fz_new_pixmap_with_bbox_and_data(fz_context *ctx, fz_colorspace *colorspace, const fz_bbox *r, unsigned char *samples) +fz_new_pixmap_with_bbox_and_data(fz_context *ctx, fz_colorspace *colorspace, const fz_irect *r, unsigned char *samples) { fz_pixmap *pixmap = fz_new_pixmap_with_data(ctx, colorspace, r->x1 - r->x0, r->y1 - r->y0, samples); pixmap->x = r->x0; @@ -101,8 +101,8 @@ fz_new_pixmap_with_bbox_and_data(fz_context *ctx, fz_colorspace *colorspace, con return pixmap; } -fz_bbox * -fz_pixmap_bbox(fz_context *ctx, fz_pixmap *pix, fz_bbox *bbox) +fz_irect * +fz_pixmap_bbox(fz_context *ctx, fz_pixmap *pix, fz_irect *bbox) { bbox->x0 = pix->x; bbox->y0 = pix->y; @@ -111,8 +111,8 @@ fz_pixmap_bbox(fz_context *ctx, fz_pixmap *pix, fz_bbox *bbox) return bbox; } -fz_bbox * -fz_pixmap_bbox_no_ctx(fz_pixmap *pix, fz_bbox *bbox) +fz_irect * +fz_pixmap_bbox_no_ctx(fz_pixmap *pix, fz_irect *bbox) { bbox->x0 = pix->x; bbox->y0 = pix->y; @@ -163,16 +163,16 @@ fz_clear_pixmap_with_value(fz_context *ctx, fz_pixmap *pix, int value) } void -fz_copy_pixmap_rect(fz_context *ctx, fz_pixmap *dest, fz_pixmap *src, const fz_bbox *b) +fz_copy_pixmap_rect(fz_context *ctx, fz_pixmap *dest, fz_pixmap *src, const fz_irect *b) { const unsigned char *srcp; unsigned char *destp; int x, y, w, destspan, srcspan; - fz_bbox local_b, bb; + fz_irect local_b, bb; local_b = *b; - fz_intersect_bbox(&local_b, fz_pixmap_bbox(ctx, dest, &bb)); - fz_intersect_bbox(&local_b, fz_pixmap_bbox(ctx, src, &bb)); + fz_intersect_irect(&local_b, fz_pixmap_bbox(ctx, dest, &bb)); + fz_intersect_irect(&local_b, fz_pixmap_bbox(ctx, src, &bb)); w = local_b.x1 - local_b.x0; y = local_b.y1 - local_b.y0; if (w <= 0 || y <= 0) @@ -265,14 +265,14 @@ fz_copy_pixmap_rect(fz_context *ctx, fz_pixmap *dest, fz_pixmap *src, const fz_b } void -fz_clear_pixmap_rect_with_value(fz_context *ctx, fz_pixmap *dest, int value, const fz_bbox *b) +fz_clear_pixmap_rect_with_value(fz_context *ctx, fz_pixmap *dest, int value, const fz_irect *b) { unsigned char *destp; int x, y, w, k, destspan; - fz_bbox bb; - fz_bbox local_b = *b; + fz_irect bb; + fz_irect local_b = *b; - fz_intersect_bbox(&local_b, fz_pixmap_bbox(ctx, dest, &bb)); + fz_intersect_irect(&local_b, fz_pixmap_bbox(ctx, dest, &bb)); w = local_b.x1 - local_b.x0; y = local_b.y1 - local_b.y0; if (w <= 0 || y <= 0) @@ -347,7 +347,7 @@ fz_alpha_from_gray(fz_context *ctx, fz_pixmap *gray, int luminosity) fz_pixmap *alpha; unsigned char *sp, *dp; int len; - fz_bbox bbox; + fz_irect bbox; assert(gray->n == 2); @@ -384,7 +384,7 @@ fz_invert_pixmap(fz_context *ctx, fz_pixmap *pix) } } -void fz_invert_pixmap_rect(fz_pixmap *image, const fz_bbox *rect) +void fz_invert_pixmap_rect(fz_pixmap *image, const fz_irect *rect) { unsigned char *p; int x, y, n; |