From 151188419c585e60a304e8168909eb449d8ba7fe Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 30 Jan 2013 16:54:13 +0100 Subject: Rename fz_irect back to fz_bbox. --- apps/mudraw.c | 2 +- apps/pdfapp.c | 6 +-- doc/example.c | 2 +- draw/draw_affine.c | 12 ++--- draw/draw_blend.c | 4 +- draw/draw_device.c | 112 +++++++++++++++++++++++------------------------ draw/draw_edge.c | 20 ++++----- draw/draw_glyph.c | 6 +-- draw/draw_mesh.c | 6 +-- draw/draw_paint.c | 16 +++---- draw/draw_scale.c | 4 +- draw/draw_simple_scale.c | 4 +- fitz/base_geometry.c | 36 +++++++-------- fitz/fitz-internal.h | 28 ++++++------ fitz/fitz.h | 36 +++++++-------- fitz/res_font.c | 8 ++-- fitz/res_pixmap.c | 24 +++++----- 17 files changed, 163 insertions(+), 163 deletions(-) diff --git a/apps/mudraw.c b/apps/mudraw.c index d0e597d7..e36b1570 100644 --- a/apps/mudraw.c +++ b/apps/mudraw.c @@ -403,7 +403,7 @@ static void drawpage(fz_context *ctx, fz_document *doc, int pagenum) float zoom; fz_matrix ctm; fz_rect bounds, tbounds; - fz_irect ibounds; + fz_bbox ibounds; fz_pixmap *pix = NULL; int w, h; diff --git a/apps/pdfapp.c b/apps/pdfapp.c index 1d2a2fa2..143a18c4 100644 --- a/apps/pdfapp.c +++ b/apps/pdfapp.c @@ -567,7 +567,7 @@ static void pdfapp_updatepage(pdfapp_t *app) while ((annot = fz_poll_changed_annot(idoc, app->page)) != NULL) { fz_rect bounds = fz_transform_rect(ctm, fz_bound_annot(app->doc, annot)); - fz_irect bbox = fz_round_rect(bounds); + fz_bbox bbox = fz_round_rect(bounds); fz_clear_pixmap_rect_with_value(app->ctx, app->image, 255, bbox); idev = fz_new_draw_device_with_bbox(app->ctx, app->image, bbox); @@ -591,7 +591,7 @@ static void pdfapp_showpage(pdfapp_t *app, int loadpage, int drawpage, int repai fz_colorspace *colorspace; fz_matrix ctm; fz_rect bounds; - fz_irect bbox; + fz_bbox bbox; fz_cookie cookie = { 0 }; if (!app->nowaitcursor) @@ -1339,7 +1339,7 @@ void pdfapp_onkey(pdfapp_t *app, int c) void pdfapp_onmouse(pdfapp_t *app, int x, int y, int btn, int modifiers, int state) { fz_context *ctx = app->ctx; - fz_irect rect = fz_pixmap_bbox(app->ctx, app->image); + fz_bbox rect = fz_pixmap_bbox(app->ctx, app->image); fz_link *link; fz_matrix ctm; fz_point p; diff --git a/doc/example.c b/doc/example.c index d1e4798f..ef2c658f 100644 --- a/doc/example.c +++ b/doc/example.c @@ -50,7 +50,7 @@ render(char *filename, int pagenumber, int zoom, int rotation) // space has the origin at the top left corner and the x axis // extends to the right and the y axis extends down. - fz_irect bbox = fz_round_rect(bounds); + fz_bbox bbox = fz_round_rect(bounds); fz_pixmap *pix = fz_new_pixmap_with_bbox(ctx, fz_device_rgb, bbox); fz_clear_pixmap_with_value(ctx, pix, 0xff); diff --git a/draw/draw_affine.c b/draw/draw_affine.c index be41aa35..64234bf5 100644 --- a/draw/draw_affine.c +++ b/draw/draw_affine.c @@ -598,14 +598,14 @@ fz_gridfit_matrix(fz_matrix m) /* Draw an image with an affine transform on destination */ static void -fz_paint_image_imp(fz_pixmap *dst, fz_irect scissor, fz_pixmap *shape, fz_pixmap *img, fz_matrix ctm, byte *color, int alpha) +fz_paint_image_imp(fz_pixmap *dst, fz_bbox scissor, fz_pixmap *shape, fz_pixmap *img, fz_matrix ctm, byte *color, int alpha) { byte *dp, *sp, *hp; int u, v, fa, fb, fc, fd; int x, y, w, h; int sw, sh, n, hw; fz_matrix inv; - fz_irect bbox; + fz_bbox bbox; int dolerp; void (*paintfn)(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int n, int alpha, byte *color, byte *hp); @@ -630,8 +630,8 @@ fz_paint_image_imp(fz_pixmap *dst, fz_irect scissor, fz_pixmap *shape, fz_pixmap dolerp = 0; } - bbox = fz_irect_from_rect(fz_transform_rect(ctm, fz_unit_rect)); - bbox = fz_intersect_irect(bbox, scissor); + bbox = fz_bbox_from_rect(fz_transform_rect(ctm, fz_unit_rect)); + bbox = fz_intersect_bbox(bbox, scissor); x = bbox.x0; if (shape && shape->x > x) @@ -731,14 +731,14 @@ fz_paint_image_imp(fz_pixmap *dst, fz_irect scissor, fz_pixmap *shape, fz_pixmap } void -fz_paint_image_with_color(fz_pixmap *dst, fz_irect scissor, fz_pixmap *shape, fz_pixmap *img, fz_matrix ctm, byte *color) +fz_paint_image_with_color(fz_pixmap *dst, fz_bbox scissor, fz_pixmap *shape, fz_pixmap *img, fz_matrix ctm, byte *color) { assert(img->n == 1); fz_paint_image_imp(dst, scissor, shape, img, ctm, color, 255); } void -fz_paint_image(fz_pixmap *dst, fz_irect scissor, fz_pixmap *shape, fz_pixmap *img, fz_matrix ctm, int alpha) +fz_paint_image(fz_pixmap *dst, fz_bbox scissor, fz_pixmap *shape, fz_pixmap *img, fz_matrix ctm, int alpha) { assert(dst->n == img->n || (dst->n == 4 && img->n == 2)); fz_paint_image_imp(dst, scissor, shape, img, ctm, NULL, alpha); diff --git a/draw/draw_blend.c b/draw/draw_blend.c index 27888cfe..e70699d4 100644 --- a/draw/draw_blend.c +++ b/draw/draw_blend.c @@ -574,7 +574,7 @@ void fz_blend_pixmap(fz_pixmap *dst, fz_pixmap *src, int alpha, int blendmode, int isolated, fz_pixmap *shape) { unsigned char *sp, *dp; - fz_irect bbox; + fz_bbox bbox; int x, y, w, h, n; /* TODO: fix this hack! */ @@ -590,7 +590,7 @@ fz_blend_pixmap(fz_pixmap *dst, fz_pixmap *src, int alpha, int blendmode, int is } bbox = fz_pixmap_bbox_no_ctx(dst); - bbox = fz_intersect_irect(bbox, fz_pixmap_bbox_no_ctx(src)); + bbox = fz_intersect_bbox(bbox, fz_pixmap_bbox_no_ctx(src)); x = bbox.x0; y = bbox.y0; diff --git a/draw/draw_device.c b/draw/draw_device.c index b992ce09..e631e472 100644 --- a/draw/draw_device.c +++ b/draw/draw_device.c @@ -22,7 +22,7 @@ enum { typedef struct fz_draw_state_s fz_draw_state; struct fz_draw_state_s { - fz_irect scissor; + fz_bbox scissor; fz_pixmap *dest; fz_pixmap *mask; fz_pixmap *shape; @@ -31,7 +31,7 @@ struct fz_draw_state_s { float alpha; fz_matrix ctm; float xstep, ystep; - fz_irect area; + fz_bbox area; }; struct fz_draw_device_s @@ -127,7 +127,7 @@ static fz_draw_state * fz_knockout_begin(fz_draw_device *dev) { fz_context *ctx = dev->ctx; - fz_irect bbox; + fz_bbox bbox; fz_pixmap *dest, *shape; fz_draw_state *state = &dev->stack[dev->top]; int isolated = state->blendmode & FZ_BLEND_ISOLATED; @@ -138,7 +138,7 @@ fz_knockout_begin(fz_draw_device *dev) state = push_stack(dev); bbox = fz_pixmap_bbox(dev->ctx, state->dest); - bbox = fz_intersect_irect(bbox, state->scissor); + bbox = fz_intersect_bbox(bbox, state->scissor); dest = fz_new_pixmap_with_bbox(dev->ctx, state->dest->colorspace, bbox); if (isolated) @@ -246,7 +246,7 @@ fz_draw_fill_path(fz_device *devp, fz_path *path, int even_odd, fz_matrix ctm, float flatness = 0.3f / expansion; unsigned char colorbv[FZ_MAX_COLORS + 1]; float colorfv[FZ_MAX_COLORS]; - fz_irect bbox; + fz_bbox bbox; int i; fz_draw_state *state = &dev->stack[dev->top]; fz_colorspace *model = state->dest->colorspace; @@ -259,7 +259,7 @@ fz_draw_fill_path(fz_device *devp, fz_path *path, int even_odd, fz_matrix ctm, fz_sort_gel(dev->gel); bbox = fz_bound_gel(dev->gel); - bbox = fz_intersect_irect(bbox, state->scissor); + bbox = fz_intersect_bbox(bbox, state->scissor); if (fz_is_empty_rect(bbox)) return; @@ -297,7 +297,7 @@ fz_draw_stroke_path(fz_device *devp, fz_path *path, fz_stroke_state *stroke, fz_ float linewidth = stroke->linewidth; unsigned char colorbv[FZ_MAX_COLORS + 1]; float colorfv[FZ_MAX_COLORS]; - fz_irect bbox; + fz_bbox bbox; int i; fz_draw_state *state = &dev->stack[dev->top]; fz_colorspace *model = state->dest->colorspace; @@ -316,7 +316,7 @@ fz_draw_stroke_path(fz_device *devp, fz_path *path, fz_stroke_state *stroke, fz_ fz_sort_gel(dev->gel); bbox = fz_bound_gel(dev->gel); - bbox = fz_intersect_irect(bbox, state->scissor); + bbox = fz_intersect_bbox(bbox, state->scissor); if (fz_is_empty_rect(bbox)) return; @@ -353,7 +353,7 @@ fz_draw_clip_path(fz_device *devp, fz_path *path, fz_rect rect, int even_odd, fz fz_draw_device *dev = devp->user; float expansion = fz_matrix_expansion(ctm); float flatness = 0.3f / expansion; - fz_irect bbox; + fz_bbox bbox; fz_draw_state *state = &dev->stack[dev->top]; fz_colorspace *model; fz_context *ctx = dev->ctx; @@ -366,8 +366,8 @@ fz_draw_clip_path(fz_device *devp, fz_path *path, fz_rect rect, int even_odd, fz model = state->dest->colorspace; bbox = fz_bound_gel(dev->gel); - bbox = fz_intersect_irect(bbox, state->scissor); - bbox = fz_intersect_irect(bbox, fz_irect_from_rect(rect)); + bbox = fz_intersect_bbox(bbox, state->scissor); + bbox = fz_intersect_bbox(bbox, fz_bbox_from_rect(rect)); if (fz_is_empty_rect(bbox) || fz_is_rect_gel(dev->gel)) { @@ -412,7 +412,7 @@ fz_draw_clip_stroke_path(fz_device *devp, fz_path *path, fz_rect rect, fz_stroke float expansion = fz_matrix_expansion(ctm); float flatness = 0.3f / expansion; float linewidth = stroke->linewidth; - fz_irect bbox; + fz_bbox bbox; fz_draw_state *state = &dev->stack[dev->top]; fz_colorspace *model; fz_context *ctx = dev->ctx; @@ -431,8 +431,8 @@ fz_draw_clip_stroke_path(fz_device *devp, fz_path *path, fz_rect rect, fz_stroke model = state->dest->colorspace; bbox = fz_bound_gel(dev->gel); - bbox = fz_intersect_irect(bbox, state->scissor); - bbox = fz_intersect_irect(bbox, fz_irect_from_rect(rect)); + bbox = fz_intersect_bbox(bbox, state->scissor); + bbox = fz_intersect_bbox(bbox, fz_bbox_from_rect(rect)); fz_try(ctx) { @@ -463,15 +463,15 @@ fz_draw_clip_stroke_path(fz_device *devp, fz_path *path, fz_rect rect, fz_stroke static void draw_glyph(unsigned char *colorbv, fz_pixmap *dst, fz_pixmap *msk, - int xorig, int yorig, fz_irect scissor) + int xorig, int yorig, fz_bbox scissor) { unsigned char *dp, *mp; - fz_irect bbox; + fz_bbox bbox; int x, y, w, h; bbox = fz_pixmap_bbox_no_ctx(msk); - bbox = fz_translate_irect(bbox, xorig, yorig); - bbox = fz_intersect_irect(bbox, scissor); /* scissor < dst */ + bbox = fz_translate_bbox(bbox, xorig, yorig); + bbox = fz_intersect_bbox(bbox, scissor); /* scissor < dst */ x = bbox.x0; y = bbox.y0; w = bbox.x1 - bbox.x0; @@ -506,7 +506,7 @@ fz_draw_fill_text(fz_device *devp, fz_text *text, fz_matrix ctm, int i, x, y, gid; fz_draw_state *state = &dev->stack[dev->top]; fz_colorspace *model = state->dest->colorspace; - fz_irect scissor = state->scissor; + fz_bbox scissor = state->scissor; if (state->blendmode & FZ_BLEND_KNOCKOUT) state = fz_knockout_begin(dev); @@ -585,7 +585,7 @@ fz_draw_stroke_text(fz_device *devp, fz_text *text, fz_stroke_state *stroke, fz_ int i, x, y, gid; fz_draw_state *state = &dev->stack[dev->top]; fz_colorspace *model = state->dest->colorspace; - fz_irect scissor = state->scissor; + fz_bbox scissor = state->scissor; if (state->blendmode & FZ_BLEND_KNOCKOUT) state = fz_knockout_begin(dev); @@ -648,7 +648,7 @@ fz_draw_clip_text(fz_device *devp, fz_text *text, fz_matrix ctm, int accumulate) { fz_draw_device *dev = devp->user; fz_context *ctx = dev->ctx; - fz_irect bbox; + fz_bbox bbox; fz_pixmap *mask, *dest, *shape; fz_matrix tm, trm, trunc_trm; fz_pixmap *glyph; @@ -666,8 +666,8 @@ fz_draw_clip_text(fz_device *devp, fz_text *text, fz_matrix ctm, int accumulate) if (accumulate == 0) { /* make the mask the exact size needed */ - bbox = fz_irect_from_rect(fz_bound_text(dev->ctx, text, ctm)); - bbox = fz_intersect_irect(bbox, state->scissor); + bbox = fz_bbox_from_rect(fz_bound_text(dev->ctx, text, ctm)); + bbox = fz_intersect_bbox(bbox, state->scissor); } else { @@ -782,7 +782,7 @@ fz_draw_clip_stroke_text(fz_device *devp, fz_text *text, fz_stroke_state *stroke { fz_draw_device *dev = devp->user; fz_context *ctx = dev->ctx; - fz_irect bbox; + fz_bbox bbox; fz_pixmap *mask, *dest, *shape; fz_matrix tm, trm, trunc_trm; fz_pixmap *glyph; @@ -791,8 +791,8 @@ fz_draw_clip_stroke_text(fz_device *devp, fz_text *text, fz_stroke_state *stroke fz_colorspace *model = state->dest->colorspace; /* make the mask the exact size needed */ - bbox = fz_irect_from_rect(fz_bound_text(dev->ctx, text, ctm)); - bbox = fz_intersect_irect(bbox, state->scissor); + bbox = fz_bbox_from_rect(fz_bound_text(dev->ctx, text, ctm)); + bbox = fz_intersect_bbox(bbox, state->scissor); fz_try(ctx) { @@ -893,7 +893,7 @@ fz_draw_fill_shade(fz_device *devp, fz_shade *shade, fz_matrix ctm, float alpha) { fz_draw_device *dev = devp->user; fz_rect bounds; - fz_irect bbox, scissor; + fz_bbox bbox, scissor; fz_pixmap *dest, *shape; float colorfv[FZ_MAX_COLORS]; unsigned char colorbv[FZ_MAX_COLORS + 1]; @@ -902,7 +902,7 @@ fz_draw_fill_shade(fz_device *devp, fz_shade *shade, fz_matrix ctm, float alpha) bounds = fz_bound_shade(dev->ctx, shade, ctm); scissor = state->scissor; - bbox = fz_intersect_irect(fz_irect_from_rect(bounds), scissor); + bbox = fz_intersect_bbox(fz_bbox_from_rect(bounds), scissor); if (fz_is_empty_rect(bbox)) return; @@ -982,7 +982,7 @@ fz_draw_fill_shade(fz_device *devp, fz_shade *shade, fz_matrix ctm, float alpha) } static fz_pixmap * -fz_transform_pixmap(fz_draw_device *dev, fz_pixmap *image, fz_matrix *ctm, int x, int y, int dx, int dy, int gridfit, fz_irect *clip) +fz_transform_pixmap(fz_draw_device *dev, fz_pixmap *image, fz_matrix *ctm, int x, int y, int dx, int dy, int gridfit, fz_bbox *clip) { fz_pixmap *scaled; fz_context *ctx = dev->ctx; @@ -1007,7 +1007,7 @@ fz_transform_pixmap(fz_draw_device *dev, fz_pixmap *image, fz_matrix *ctm, int x { /* Other orthogonal flip/rotation cases */ fz_matrix m = *ctm; - fz_irect rclip; + fz_bbox rclip; if (gridfit) m = fz_gridfit_matrix(m); if (clip) @@ -1050,9 +1050,9 @@ fz_draw_fill_image(fz_device *devp, fz_image *image, fz_matrix ctm, float alpha) fz_context *ctx = dev->ctx; fz_draw_state *state = &dev->stack[dev->top]; fz_colorspace *model = state->dest->colorspace; - fz_irect clip = fz_pixmap_bbox(ctx, state->dest); + fz_bbox clip = fz_pixmap_bbox(ctx, state->dest); - clip = fz_intersect_irect(clip, state->scissor); + clip = fz_intersect_bbox(clip, state->scissor); fz_var(scaled); @@ -1154,9 +1154,9 @@ fz_draw_fill_image_mask(fz_device *devp, fz_image *image, fz_matrix ctm, fz_context *ctx = dev->ctx; fz_draw_state *state = &dev->stack[dev->top]; fz_colorspace *model = state->dest->colorspace; - fz_irect clip = fz_pixmap_bbox(ctx, state->dest); + fz_bbox clip = fz_pixmap_bbox(ctx, state->dest); - clip = fz_intersect_irect(clip, state->scissor); + clip = fz_intersect_bbox(clip, state->scissor); if (image->w == 0 || image->h == 0) return; @@ -1215,7 +1215,7 @@ fz_draw_clip_image_mask(fz_device *devp, fz_image *image, fz_rect rect, fz_matri { fz_draw_device *dev = devp->user; fz_context *ctx = dev->ctx; - fz_irect bbox; + fz_bbox bbox; fz_pixmap *mask = NULL; fz_pixmap *dest = NULL; fz_pixmap *shape = NULL; @@ -1225,9 +1225,9 @@ fz_draw_clip_image_mask(fz_device *devp, fz_image *image, fz_rect rect, fz_matri int dx, dy; fz_draw_state *state = push_stack(dev); fz_colorspace *model = state->dest->colorspace; - fz_irect clip = fz_pixmap_bbox(ctx, state->dest); + fz_bbox clip = fz_pixmap_bbox(ctx, state->dest); - clip = fz_intersect_irect(clip, state->scissor); + clip = fz_intersect_bbox(clip, state->scissor); fz_var(mask); fz_var(dest); @@ -1240,7 +1240,7 @@ fz_draw_clip_image_mask(fz_device *devp, fz_image *image, fz_rect rect, fz_matri #ifdef DUMP_GROUP_BLENDS dump_spaces(dev->top-1, "Clip (image mask) (empty) begin\n"); #endif - state[1].scissor = fz_empty_irect; + state[1].scissor = fz_empty_bbox; state[1].mask = NULL; return; } @@ -1249,9 +1249,9 @@ fz_draw_clip_image_mask(fz_device *devp, fz_image *image, fz_rect rect, fz_matri dump_spaces(dev->top-1, "Clip (image mask) begin\n"); #endif - bbox = fz_irect_from_rect(fz_transform_rect(ctm, fz_unit_rect)); - bbox = fz_intersect_irect(bbox, state->scissor); - bbox = fz_intersect_irect(bbox, fz_irect_from_rect(rect)); + bbox = fz_bbox_from_rect(fz_transform_rect(ctm, fz_unit_rect)); + bbox = fz_intersect_bbox(bbox, state->scissor); + bbox = fz_intersect_bbox(bbox, fz_bbox_from_rect(rect)); dx = sqrtf(ctm.a * ctm.a + ctm.b * ctm.b); dy = sqrtf(ctm.c * ctm.c + ctm.d * ctm.d); @@ -1360,13 +1360,13 @@ fz_draw_begin_mask(fz_device *devp, fz_rect rect, int luminosity, fz_colorspace { fz_draw_device *dev = devp->user; fz_pixmap *dest; - fz_irect bbox; + fz_bbox bbox; fz_draw_state *state = push_stack(dev); fz_pixmap *shape = state->shape; fz_context *ctx = dev->ctx; - bbox = fz_irect_from_rect(rect); - bbox = fz_intersect_irect(bbox, state->scissor); + bbox = fz_bbox_from_rect(rect); + bbox = fz_intersect_bbox(bbox, state->scissor); fz_try(ctx) { @@ -1416,7 +1416,7 @@ fz_draw_end_mask(fz_device *devp) { fz_draw_device *dev = devp->user; fz_pixmap *temp, *dest; - fz_irect bbox; + fz_bbox bbox; int luminosity; fz_context *ctx = dev->ctx; fz_draw_state *state; @@ -1468,7 +1468,7 @@ static void fz_draw_begin_group(fz_device *devp, fz_rect rect, int isolated, int knockout, int blendmode, float alpha) { fz_draw_device *dev = devp->user; - fz_irect bbox; + fz_bbox bbox; fz_pixmap *dest, *shape; fz_context *ctx = dev->ctx; fz_draw_state *state = &dev->stack[dev->top]; @@ -1478,8 +1478,8 @@ fz_draw_begin_group(fz_device *devp, fz_rect rect, int isolated, int knockout, i fz_knockout_begin(dev); state = push_stack(dev); - bbox = fz_irect_from_rect(rect); - bbox = fz_intersect_irect(bbox, state->scissor); + bbox = fz_bbox_from_rect(rect); + bbox = fz_intersect_bbox(bbox, state->scissor); fz_try(ctx) { @@ -1591,7 +1591,7 @@ fz_draw_begin_tile(fz_device *devp, fz_rect area, fz_rect view, float xstep, flo fz_draw_device *dev = devp->user; fz_pixmap *dest = NULL; fz_pixmap *shape; - fz_irect bbox; + fz_bbox bbox; fz_context *ctx = dev->ctx; fz_draw_state *state = &dev->stack[dev->top]; fz_colorspace *model = state->dest->colorspace; @@ -1603,7 +1603,7 @@ fz_draw_begin_tile(fz_device *devp, fz_rect area, fz_rect view, float xstep, flo fz_knockout_begin(dev); state = push_stack(dev); - bbox = fz_irect_from_rect(fz_transform_rect(ctm, view)); + bbox = fz_bbox_from_rect(fz_transform_rect(ctm, view)); /* We should never have a bbox that entirely covers our destination. * If we do, then the check for only 1 tile being visible above has * failed. Actually, this *can* fail due to the round_rect, at extreme @@ -1624,7 +1624,7 @@ fz_draw_begin_tile(fz_device *devp, fz_rect area, fz_rect view, float xstep, flo state[1].blendmode |= FZ_BLEND_ISOLATED; state[1].xstep = xstep; state[1].ystep = ystep; - state[1].area = fz_irect_from_rect(area); + state[1].area = fz_bbox_from_rect(area); state[1].ctm = ctm; #ifdef DUMP_GROUP_BLENDS dump_spaces(dev->top-1, "Tile begin\n"); @@ -1645,7 +1645,7 @@ fz_draw_end_tile(fz_device *devp) fz_draw_device *dev = devp->user; float xstep, ystep; fz_matrix ttm, ctm, shapectm; - fz_irect area, scissor; + fz_bbox area, scissor; fz_rect scissor_tmp; int x0, y0, x1, y1, x, y; fz_context *ctx = dev->ctx; @@ -1665,11 +1665,11 @@ fz_draw_end_tile(fz_device *devp) /* Fudge the scissor bbox a little to allow for inaccuracies in the * matrix inversion. */ - scissor_tmp = fz_rect_from_irect(state[0].scissor); + scissor_tmp = fz_rect_from_bbox(state[0].scissor); scissor_tmp = fz_expand_rect(scissor_tmp, 1); scissor_tmp = fz_transform_rect(fz_invert_matrix(ctm), scissor_tmp); - scissor = fz_irect_from_rect(scissor_tmp); - area = fz_intersect_irect(area, scissor); + scissor = fz_bbox_from_rect(scissor_tmp); + area = fz_intersect_bbox(area, scissor); x0 = floorf(area.x0 / xstep); y0 = floorf(area.y0 / ystep); @@ -1829,7 +1829,7 @@ fz_new_draw_device(fz_context *ctx, fz_pixmap *dest) } fz_device * -fz_new_draw_device_with_bbox(fz_context *ctx, fz_pixmap *dest, fz_irect clip) +fz_new_draw_device_with_bbox(fz_context *ctx, fz_pixmap *dest, fz_bbox clip) { fz_device *dev = fz_new_draw_device(ctx, dest); fz_draw_device *ddev = dev->user; diff --git a/draw/draw_edge.c b/draw/draw_edge.c index c5438ffe..6c22aa73 100644 --- a/draw/draw_edge.c +++ b/draw/draw_edge.c @@ -203,7 +203,7 @@ fz_new_gel(fz_context *ctx) } void -fz_reset_gel(fz_gel *gel, fz_irect clip) +fz_reset_gel(fz_gel *gel, fz_bbox clip) { fz_aa_context *ctxaa = gel->ctx->aa; @@ -235,13 +235,13 @@ fz_free_gel(fz_gel *gel) fz_free(gel->ctx, gel); } -fz_irect +fz_bbox fz_bound_gel(fz_gel *gel) { - fz_irect bbox; + fz_bbox bbox; fz_aa_context *ctxaa = gel->ctx->aa; if (gel->len == 0) - return fz_empty_irect; + return fz_empty_bbox; bbox.x0 = fz_idiv(gel->bbox.x0, fz_aa_hscale); bbox.y0 = fz_idiv(gel->bbox.y0, fz_aa_vscale); bbox.x1 = fz_idiv(gel->bbox.x1, fz_aa_hscale) + 1; @@ -666,7 +666,7 @@ static inline void blit_aa(fz_pixmap *dst, int x, int y, } static void -fz_scan_convert_aa(fz_gel *gel, int eofill, fz_irect clip, +fz_scan_convert_aa(fz_gel *gel, int eofill, fz_bbox clip, fz_pixmap *dst, unsigned char *color) { unsigned char *alphas; @@ -851,7 +851,7 @@ clip_ended: */ static inline void blit_sharp(int x0, int x1, int y, - fz_irect clip, fz_pixmap *dst, unsigned char *color) + fz_bbox clip, fz_pixmap *dst, unsigned char *color) { unsigned char *dp; x0 = fz_clampi(x0, dst->x, dst->x + dst->w); @@ -867,7 +867,7 @@ static inline void blit_sharp(int x0, int x1, int y, } static inline void non_zero_winding_sharp(fz_gel *gel, int y, - fz_irect clip, fz_pixmap *dst, unsigned char *color) + fz_bbox clip, fz_pixmap *dst, unsigned char *color) { int winding = 0; int x = 0; @@ -883,7 +883,7 @@ static inline void non_zero_winding_sharp(fz_gel *gel, int y, } static inline void even_odd_sharp(fz_gel *gel, int y, - fz_irect clip, fz_pixmap *dst, unsigned char *color) + fz_bbox clip, fz_pixmap *dst, unsigned char *color) { int even = 0; int x = 0; @@ -899,7 +899,7 @@ static inline void even_odd_sharp(fz_gel *gel, int y, } static void -fz_scan_convert_sharp(fz_gel *gel, int eofill, fz_irect clip, +fz_scan_convert_sharp(fz_gel *gel, int eofill, fz_bbox clip, fz_pixmap *dst, unsigned char *color) { int e = 0; @@ -955,7 +955,7 @@ fz_scan_convert_sharp(fz_gel *gel, int eofill, fz_irect clip, } void -fz_scan_convert(fz_gel *gel, int eofill, fz_irect clip, +fz_scan_convert(fz_gel *gel, int eofill, fz_bbox clip, fz_pixmap *dst, unsigned char *color) { fz_aa_context *ctxaa = gel->ctx->aa; diff --git a/draw/draw_glyph.c b/draw/draw_glyph.c index 93caf478..de2f47c2 100644 --- a/draw/draw_glyph.c +++ b/draw/draw_glyph.c @@ -95,7 +95,7 @@ fz_keep_glyph_cache(fz_context *ctx) } fz_pixmap * -fz_render_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_matrix ctm, fz_stroke_state *stroke, fz_irect scissor) +fz_render_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_matrix ctm, fz_stroke_state *stroke, fz_bbox scissor) { if (font->ft_face) { @@ -116,7 +116,7 @@ fz_render_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, This must not be inserted into the cache. */ fz_pixmap * -fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix ctm, fz_colorspace *model, fz_irect scissor) +fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix ctm, fz_colorspace *model, fz_bbox scissor) { fz_glyph_cache *cache; fz_glyph_key key; @@ -126,7 +126,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix ctm, fz_color if (size <= MAX_GLYPH_SIZE) { - scissor = fz_infinite_irect; + scissor = fz_infinite_bbox; do_cache = 1; } else diff --git a/draw/draw_mesh.c b/draw/draw_mesh.c index bbd3dc02..03d187f7 100644 --- a/draw/draw_mesh.c +++ b/draw/draw_mesh.c @@ -213,7 +213,7 @@ static inline void step_edge(int *ael, int *del, int n) } static void -fz_paint_triangle(fz_pixmap *pix, float *av, float *bv, float *cv, int n, fz_irect bbox) +fz_paint_triangle(fz_pixmap *pix, float *av, float *bv, float *cv, int n, fz_bbox bbox) { float poly[MAXV][MAXN]; float temp[MAXV][MAXN]; @@ -307,7 +307,7 @@ struct paint_tri_data fz_context *ctx; fz_shade *shade; fz_pixmap *dest; - fz_irect bbox; + fz_bbox bbox; }; static void @@ -349,7 +349,7 @@ do_paint_tri(void *arg, fz_vertex *av, fz_vertex *bv, fz_vertex *cv) } void -fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_pixmap *dest, fz_irect bbox) +fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_pixmap *dest, fz_bbox bbox) { unsigned char clut[256][FZ_MAX_COLORS]; fz_pixmap *temp = NULL; diff --git a/draw/draw_paint.c b/draw/draw_paint.c index de0f1d34..4c99dc7d 100644 --- a/draw/draw_paint.c +++ b/draw/draw_paint.c @@ -375,15 +375,15 @@ fz_paint_span(byte * restrict dp, byte * restrict sp, int n, int w, int alpha) */ void -fz_paint_pixmap_with_bbox(fz_pixmap *dst, fz_pixmap *src, int alpha, fz_irect bbox) +fz_paint_pixmap_with_bbox(fz_pixmap *dst, fz_pixmap *src, int alpha, fz_bbox bbox) { unsigned char *sp, *dp; int x, y, w, h, n; assert(dst->n == src->n); - bbox = fz_intersect_irect(bbox, fz_pixmap_bbox_no_ctx(dst)); - bbox = fz_intersect_irect(bbox, fz_pixmap_bbox_no_ctx(src)); + bbox = fz_intersect_bbox(bbox, fz_pixmap_bbox_no_ctx(dst)); + bbox = fz_intersect_bbox(bbox, fz_pixmap_bbox_no_ctx(src)); x = bbox.x0; y = bbox.y0; @@ -408,13 +408,13 @@ void fz_paint_pixmap(fz_pixmap *dst, fz_pixmap *src, int alpha) { unsigned char *sp, *dp; - fz_irect bbox; + fz_bbox bbox; int x, y, w, h, n; assert(dst->n == src->n); bbox = fz_pixmap_bbox_no_ctx(dst); - bbox = fz_intersect_irect(bbox, fz_pixmap_bbox_no_ctx(src)); + bbox = fz_intersect_bbox(bbox, fz_pixmap_bbox_no_ctx(src)); x = bbox.x0; y = bbox.y0; @@ -439,15 +439,15 @@ void fz_paint_pixmap_with_mask(fz_pixmap *dst, fz_pixmap *src, fz_pixmap *msk) { unsigned char *sp, *dp, *mp; - fz_irect bbox; + fz_bbox bbox; int x, y, w, h, n; assert(dst->n == src->n); assert(msk->n == 1); bbox = fz_pixmap_bbox_no_ctx(dst); - bbox = fz_intersect_irect(bbox, fz_pixmap_bbox_no_ctx(src)); - bbox = fz_intersect_irect(bbox, fz_pixmap_bbox_no_ctx(msk)); + bbox = fz_intersect_bbox(bbox, fz_pixmap_bbox_no_ctx(src)); + bbox = fz_intersect_bbox(bbox, fz_pixmap_bbox_no_ctx(msk)); x = bbox.x0; y = bbox.y0; diff --git a/draw/draw_scale.c b/draw/draw_scale.c index 8cb99166..93d2219a 100644 --- a/draw/draw_scale.c +++ b/draw/draw_scale.c @@ -1238,13 +1238,13 @@ scale_single_col(unsigned char *dst, unsigned char *src, fz_weights *weights, in #endif /* SINGLE_PIXEL_SPECIALS */ fz_pixmap * -fz_scale_pixmap(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_irect *clip) +fz_scale_pixmap(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_bbox *clip) { return fz_scale_pixmap_cached(ctx, src, x, y, w, h, clip, NULL, NULL); } fz_pixmap * -fz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_irect *clip, fz_scale_cache *cache_x, fz_scale_cache *cache_y) +fz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_bbox *clip, fz_scale_cache *cache_x, fz_scale_cache *cache_y) { fz_scale_filter *filter = &fz_scale_filter_simple; fz_weights *contrib_rows = NULL; diff --git a/draw/draw_simple_scale.c b/draw/draw_simple_scale.c index 60914e52..0096d93d 100644 --- a/draw/draw_simple_scale.c +++ b/draw/draw_simple_scale.c @@ -1214,13 +1214,13 @@ scale_single_col(unsigned char *dst, unsigned char *src, fz_weights *weights, in #endif /* SINGLE_PIXEL_SPECIALS */ fz_pixmap * -fz_scale_pixmap(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_irect *clip) +fz_scale_pixmap(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_bbox *clip) { return fz_scale_pixmap_cached(ctx, src, x, y, w, h, clip, NULL, NULL); } fz_pixmap * -fz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_irect *clip, fz_scale_cache *cache_x, fz_scale_cache *cache_y) +fz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_bbox *clip, fz_scale_cache *cache_x, fz_scale_cache *cache_y) { fz_scale_filter *filter = &fz_scale_filter_simple; fz_weights *contrib_rows = NULL; diff --git a/fitz/base_geometry.c b/fitz/base_geometry.c index 54380c84..9fc29217 100644 --- a/fitz/base_geometry.c +++ b/fitz/base_geometry.c @@ -188,14 +188,14 @@ 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_irect fz_infinite_irect = { 1, 1, -1, -1 }; -const fz_irect fz_empty_irect = { 0, 0, 0, 0 }; -const fz_irect fz_unit_irect = { 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 }; -fz_irect -fz_irect_from_rect(fz_rect a) +fz_bbox +fz_bbox_from_rect(fz_rect a) { - fz_irect b; + fz_bbox b; a.x0 = floorf(a.x0); a.y0 = floorf(a.y0); @@ -212,7 +212,7 @@ fz_irect_from_rect(fz_rect a) } fz_rect -fz_rect_from_irect(fz_irect a) +fz_rect_from_bbox(fz_bbox a) { fz_rect b; b.x0 = a.x0; @@ -222,10 +222,10 @@ fz_rect_from_irect(fz_irect a) return b; } -fz_irect +fz_bbox fz_round_rect(fz_rect a) { - fz_irect b; + fz_bbox b; a.x0 = floorf(a.x0 + 0.001); a.y0 = floorf(a.y0 + 0.001); @@ -257,20 +257,20 @@ fz_intersect_rect(fz_rect a, fz_rect b) return (r.x1 < r.x0 || r.y1 < r.y0) ? fz_empty_rect : r; } -fz_irect -fz_intersect_irect(fz_irect a, fz_irect b) +fz_bbox +fz_intersect_bbox(fz_bbox a, fz_bbox b) { - fz_irect r; + fz_bbox r; /* Check for empty box before infinite box */ - if (fz_is_empty_rect(a)) return fz_empty_irect; - if (fz_is_empty_rect(b)) return fz_empty_irect; + if (fz_is_empty_rect(a)) return fz_empty_bbox; + if (fz_is_empty_rect(b)) return fz_empty_bbox; if (fz_is_infinite_rect(a)) return b; if (fz_is_infinite_rect(b)) return a; r.x0 = fz_maxi(a.x0, b.x0); r.y0 = fz_maxi(a.y0, b.y0); r.x1 = fz_mini(a.x1, b.x1); r.y1 = fz_mini(a.y1, b.y1); - return (r.x1 < r.x0 || r.y1 < r.y0) ? fz_empty_irect : r; + return (r.x1 < r.x0 || r.y1 < r.y0) ? fz_empty_bbox : r; } fz_rect @@ -325,10 +325,10 @@ fz_translate_rect(fz_rect a, float xoff, float yoff) return b; } -fz_irect -fz_translate_irect(fz_irect a, int xoff, int yoff) +fz_bbox +fz_translate_bbox(fz_bbox a, int xoff, int yoff) { - fz_irect b; + fz_bbox b; if (fz_is_empty_rect(a)) return a; if (fz_is_infinite_rect(a)) return a; ADD_WITH_SAT(b.x0, a.x0, xoff); diff --git a/fitz/fitz-internal.h b/fitz/fitz-internal.h index 0f6b70c3..13fd94de 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, fz_irect r); +void fz_copy_pixmap_rect(fz_context *ctx, fz_pixmap *dest, fz_pixmap *src, fz_bbox 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_irect *clip); +fz_pixmap *fz_scale_pixmap(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_bbox *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, fz_irect *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, fz_bbox *clip, fz_scale_cache *cache_x, fz_scale_cache *cache_y); void fz_subsample_pixmap(fz_context *ctx, fz_pixmap *tile, int factor); -fz_irect fz_pixmap_bbox_no_ctx(fz_pixmap *src); +fz_bbox fz_pixmap_bbox_no_ctx(fz_pixmap *src); 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, fz_matrix trm); fz_path *fz_outline_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix ctm); fz_pixmap *fz_render_ft_glyph(fz_context *ctx, fz_font *font, int cid, fz_matrix trm, int aa); -fz_pixmap *fz_render_t3_glyph(fz_context *ctx, fz_font *font, int cid, fz_matrix trm, fz_colorspace *model, fz_irect scissor); +fz_pixmap *fz_render_t3_glyph(fz_context *ctx, fz_font *font, int cid, fz_matrix trm, fz_colorspace *model, fz_bbox scissor); fz_pixmap *fz_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_matrix ctm, fz_stroke_state *state); -fz_pixmap *fz_render_glyph(fz_context *ctx, fz_font*, int, fz_matrix, fz_colorspace *model, fz_irect scissor); -fz_pixmap *fz_render_stroked_glyph(fz_context *ctx, fz_font*, int, fz_matrix, fz_matrix, fz_stroke_state *stroke, fz_irect scissor); +fz_pixmap *fz_render_glyph(fz_context *ctx, fz_font*, int, fz_matrix, fz_colorspace *model, fz_bbox scissor); +fz_pixmap *fz_render_stroked_glyph(fz_context *ctx, fz_font*, int, fz_matrix, fz_matrix, fz_stroke_state *stroke, fz_bbox scissor); void fz_render_t3_glyph_direct(fz_context *ctx, fz_device *dev, fz_font *font, int gid, fz_matrix trm, void *gstate, int nestedDepth); void fz_prepare_t3_glyph(fz_context *ctx, fz_font *font, int gid, int nestedDepth); @@ -1300,7 +1300,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, fz_matrix ctm); -void fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_pixmap *dest, fz_irect bbox); +void fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_pixmap *dest, fz_bbox bbox); /* * Handy routine for processing mesh based shades @@ -1339,13 +1339,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, fz_irect clip); +void fz_reset_gel(fz_gel *gel, fz_bbox clip); void fz_sort_gel(fz_gel *gel); -fz_irect fz_bound_gel(fz_gel *gel); +fz_bbox fz_bound_gel(fz_gel *gel); void fz_free_gel(fz_gel *gel); int fz_is_rect_gel(fz_gel *gel); -void fz_scan_convert(fz_gel *gel, int eofill, fz_irect clip, fz_pixmap *pix, unsigned char *colorbv); +void fz_scan_convert(fz_gel *gel, int eofill, fz_bbox clip, fz_pixmap *pix, unsigned char *colorbv); void fz_flatten_fill_path(fz_gel *gel, fz_path *path, fz_matrix ctm, float flatness); void fz_flatten_stroke_path(fz_gel *gel, fz_path *path, fz_stroke_state *stroke, fz_matrix ctm, float flatness, float linewidth); @@ -1458,12 +1458,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, fz_irect scissor, fz_pixmap *shape, fz_pixmap *img, fz_matrix ctm, int alpha); -void fz_paint_image_with_color(fz_pixmap *dst, fz_irect scissor, fz_pixmap *shape, fz_pixmap *img, fz_matrix ctm, unsigned char *colorbv); +void fz_paint_image(fz_pixmap *dst, fz_bbox scissor, fz_pixmap *shape, fz_pixmap *img, fz_matrix ctm, int alpha); +void fz_paint_image_with_color(fz_pixmap *dst, fz_bbox scissor, fz_pixmap *shape, fz_pixmap *img, 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_irect bbox); +void fz_paint_pixmap_with_bbox(fz_pixmap *dst, fz_pixmap *src, int alpha, fz_bbox 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 71f9f214..8f39d3f4 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -748,12 +748,12 @@ struct fz_rect_s }; /* - fz_irect is a rectangle using integers instead of floats. + fz_bbox 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 +typedef struct fz_bbox_s fz_bbox; +struct fz_bbox_s { int x0, y0; int x1, y1; @@ -773,7 +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; +extern const fz_bbox fz_empty_bbox; /* An infinite rectangle with negative area. @@ -782,7 +782,7 @@ extern const fz_irect fz_empty_irect; at (-1, -1). */ extern const fz_rect fz_infinite_rect; -extern const fz_irect fz_infinite_irect; +extern const fz_bbox fz_infinite_bbox; /* fz_is_empty_rect: Check if rectangle is empty. @@ -926,7 +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_bbox fz_intersect_bbox(fz_bbox a, fz_bbox b); /* fz_union_rect: Compute union of two rectangles. @@ -942,7 +942,7 @@ fz_irect fz_intersect_irect(fz_irect a, fz_irect b); fz_rect fz_union_rect(fz_rect a, fz_rect b); /* - fz_irect_from_rect: Convert a rect into the minimal bounding box + fz_bbox_from_rect: Convert a rect into the minimal bounding box that covers the rectangle. Coordinates in a bounding box are integers, so rounding of the @@ -953,7 +953,7 @@ fz_rect fz_union_rect(fz_rect a, fz_rect b); Does not throw exceptions. */ -fz_irect fz_irect_from_rect(fz_rect rect); +fz_bbox fz_bbox_from_rect(fz_rect rect); /* fz_round_rect: Round rectangle coordinates. @@ -963,7 +963,7 @@ fz_irect fz_irect_from_rect(fz_rect rect); upwards and left while the bottom right corner is rounded downwards and to the right. - This differs from fz_irect_from_rect, in that fz_rect_covering_rect + This differs from fz_bbox_from_rect, in that fz_rect_covering_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 @@ -971,9 +971,9 @@ fz_irect fz_irect_from_rect(fz_rect rect); Does not throw exceptions. */ -fz_irect fz_round_rect(fz_rect rect); +fz_bbox fz_round_rect(fz_rect rect); -fz_rect fz_rect_from_irect(fz_irect rect); +fz_rect fz_rect_from_bbox(fz_bbox rect); /* fz_expand_rect: Expand a bbox by a given amount in all directions. @@ -990,7 +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_bbox fz_translate_bbox(fz_bbox a, int xoff, int yoff); /* fz_transform_point: Apply a transformation to a point. @@ -1263,7 +1263,7 @@ typedef struct fz_pixmap_s fz_pixmap; /* fz_pixmap_bbox: Return the bounding box for a pixmap. */ -fz_irect fz_pixmap_bbox(fz_context *ctx, fz_pixmap *pix); +fz_bbox fz_pixmap_bbox(fz_context *ctx, fz_pixmap *pix); /* fz_pixmap_width: Return the width of the pixmap in pixels. @@ -1307,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_irect bbox); +fz_pixmap *fz_new_pixmap_with_bbox(fz_context *ctx, fz_colorspace *colorspace, fz_bbox bbox); /* fz_new_pixmap_with_data: Create a new pixmap, with it's origin at @@ -1346,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_irect rect, unsigned char *samples); +fz_pixmap *fz_new_pixmap_with_bbox_and_data(fz_context *ctx, fz_colorspace *colorspace, fz_bbox rect, unsigned char *samples); /* fz_keep_pixmap: Take a reference to a pixmap. @@ -1414,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_irect r); +void fz_clear_pixmap_rect_with_value(fz_context *ctx, fz_pixmap *pix, int value, fz_bbox r); /* fz_clear_pixmap_with_value: Sets all components (including alpha) of @@ -1441,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_irect rect); +void fz_invert_pixmap_rect(fz_pixmap *image, fz_bbox rect); /* fz_gamma_pixmap: Apply gamma correction to a pixmap. All components @@ -1642,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_irect clip); +fz_device *fz_new_draw_device_with_bbox(fz_context *ctx, fz_pixmap *dest, fz_bbox clip); /* Text extraction device: Used for searching, format conversion etc. diff --git a/fitz/res_font.c b/fitz/res_font.c index 47ec7c37..ea4b588f 100644 --- a/fitz/res_font.c +++ b/fitz/res_font.c @@ -887,12 +887,12 @@ fz_bound_t3_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm) } fz_pixmap * -fz_render_t3_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_colorspace *model, fz_irect scissor) +fz_render_t3_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_colorspace *model, fz_bbox scissor) { fz_display_list *list; fz_matrix ctm; fz_rect bounds; - fz_irect bbox; + fz_bbox bbox; fz_device *dev; fz_pixmap *glyph; fz_pixmap *result; @@ -923,8 +923,8 @@ fz_render_t3_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_co bounds = fz_bound_glyph(ctx, font, gid, trm); bounds = fz_expand_rect(bounds, 1); - bbox = fz_irect_from_rect(bounds); - bbox = fz_intersect_irect(bbox, scissor); + bbox = fz_bbox_from_rect(bounds); + bbox = fz_intersect_bbox(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 60e615ec..c498f974 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, fz_irect r) +fz_new_pixmap_with_bbox(fz_context *ctx, fz_colorspace *colorspace, fz_bbox r) { fz_pixmap *pixmap = fz_new_pixmap(ctx, colorspace, r.x1 - r.x0, r.y1 - r.y0); pixmap->x = r.x0; @@ -92,7 +92,7 @@ fz_new_pixmap_with_bbox(fz_context *ctx, fz_colorspace *colorspace, fz_irect r) } fz_pixmap * -fz_new_pixmap_with_bbox_and_data(fz_context *ctx, fz_colorspace *colorspace, fz_irect r, unsigned char *samples) +fz_new_pixmap_with_bbox_and_data(fz_context *ctx, fz_colorspace *colorspace, fz_bbox 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; @@ -100,10 +100,10 @@ fz_new_pixmap_with_bbox_and_data(fz_context *ctx, fz_colorspace *colorspace, fz_ return pixmap; } -fz_irect +fz_bbox fz_pixmap_bbox(fz_context *ctx, fz_pixmap *pix) { - fz_irect bbox; + fz_bbox bbox; bbox.x0 = pix->x; bbox.y0 = pix->y; bbox.x1 = pix->x + pix->w; @@ -111,10 +111,10 @@ fz_pixmap_bbox(fz_context *ctx, fz_pixmap *pix) return bbox; } -fz_irect +fz_bbox fz_pixmap_bbox_no_ctx(fz_pixmap *pix) { - fz_irect bbox; + fz_bbox bbox; bbox.x0 = pix->x; bbox.y0 = pix->y; bbox.x1 = pix->x + pix->w; @@ -164,14 +164,14 @@ 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, fz_irect r) +fz_copy_pixmap_rect(fz_context *ctx, fz_pixmap *dest, fz_pixmap *src, fz_bbox r) { const unsigned char *srcp; unsigned char *destp; int x, y, w, destspan, srcspan; - r = fz_intersect_irect(r, fz_pixmap_bbox(ctx, dest)); - r = fz_intersect_irect(r, fz_pixmap_bbox(ctx, src)); + r = fz_intersect_bbox(r, fz_pixmap_bbox(ctx, dest)); + r = fz_intersect_bbox(r, fz_pixmap_bbox(ctx, src)); w = r.x1 - r.x0; y = r.y1 - r.y0; if (w <= 0 || y <= 0) @@ -264,12 +264,12 @@ fz_copy_pixmap_rect(fz_context *ctx, fz_pixmap *dest, fz_pixmap *src, fz_irect r } void -fz_clear_pixmap_rect_with_value(fz_context *ctx, fz_pixmap *dest, int value, fz_irect r) +fz_clear_pixmap_rect_with_value(fz_context *ctx, fz_pixmap *dest, int value, fz_bbox r) { unsigned char *destp; int x, y, w, k, destspan; - r = fz_intersect_irect(r, fz_pixmap_bbox(ctx, dest)); + r = fz_intersect_bbox(r, fz_pixmap_bbox(ctx, dest)); w = r.x1 - r.x0; y = r.y1 - r.y0; if (w <= 0 || y <= 0) @@ -380,7 +380,7 @@ fz_invert_pixmap(fz_context *ctx, fz_pixmap *pix) } } -void fz_invert_pixmap_rect(fz_pixmap *image, fz_irect r) +void fz_invert_pixmap_rect(fz_pixmap *image, fz_bbox r) { unsigned char *p; int x0, x1, y0, y1; -- cgit v1.2.3