diff options
Diffstat (limited to 'fitz/res_pixmap.c')
-rw-r--r-- | fitz/res_pixmap.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/fitz/res_pixmap.c b/fitz/res_pixmap.c index eb5d58ef..60e615ec 100644 --- a/fitz/res_pixmap.c +++ b/fitz/res_pixmap.c @@ -83,9 +83,8 @@ 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_rect rf) +fz_new_pixmap_with_bbox(fz_context *ctx, fz_colorspace *colorspace, fz_irect r) { - fz_rect r = fz_round_rect(rf); fz_pixmap *pixmap = fz_new_pixmap(ctx, colorspace, r.x1 - r.x0, r.y1 - r.y0); pixmap->x = r.x0; pixmap->y = r.y0; @@ -93,19 +92,18 @@ fz_new_pixmap_with_bbox(fz_context *ctx, fz_colorspace *colorspace, fz_rect rf) } fz_pixmap * -fz_new_pixmap_with_bbox_and_data(fz_context *ctx, fz_colorspace *colorspace, fz_rect rf, unsigned char *samples) +fz_new_pixmap_with_bbox_and_data(fz_context *ctx, fz_colorspace *colorspace, fz_irect r, unsigned char *samples) { - fz_rect r = fz_round_rect(rf); fz_pixmap *pixmap = fz_new_pixmap_with_data(ctx, colorspace, r.x1 - r.x0, r.y1 - r.y0, samples); pixmap->x = r.x0; pixmap->y = r.y0; return pixmap; } -fz_rect +fz_irect fz_pixmap_bbox(fz_context *ctx, fz_pixmap *pix) { - fz_rect bbox; + fz_irect bbox; bbox.x0 = pix->x; bbox.y0 = pix->y; bbox.x1 = pix->x + pix->w; @@ -113,10 +111,10 @@ fz_pixmap_bbox(fz_context *ctx, fz_pixmap *pix) return bbox; } -fz_rect +fz_irect fz_pixmap_bbox_no_ctx(fz_pixmap *pix) { - fz_rect bbox; + fz_irect bbox; bbox.x0 = pix->x; bbox.y0 = pix->y; bbox.x1 = pix->x + pix->w; @@ -166,15 +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_rect r) +fz_copy_pixmap_rect(fz_context *ctx, fz_pixmap *dest, fz_pixmap *src, fz_irect r) { const unsigned char *srcp; unsigned char *destp; int x, y, w, destspan, srcspan; - r = fz_round_rect(r); - r = fz_intersect_rect(r, fz_pixmap_bbox(ctx, dest)); - r = fz_intersect_rect(r, fz_pixmap_bbox(ctx, src)); + r = fz_intersect_irect(r, fz_pixmap_bbox(ctx, dest)); + r = fz_intersect_irect(r, fz_pixmap_bbox(ctx, src)); w = r.x1 - r.x0; y = r.y1 - r.y0; if (w <= 0 || y <= 0) @@ -267,13 +264,12 @@ fz_copy_pixmap_rect(fz_context *ctx, fz_pixmap *dest, fz_pixmap *src, fz_rect r) } void -fz_clear_pixmap_rect_with_value(fz_context *ctx, fz_pixmap *dest, int value, fz_rect r) +fz_clear_pixmap_rect_with_value(fz_context *ctx, fz_pixmap *dest, int value, fz_irect r) { unsigned char *destp; int x, y, w, k, destspan; - r = fz_round_rect(r); - r = fz_intersect_rect(r, fz_pixmap_bbox(ctx, dest)); + r = fz_intersect_irect(r, fz_pixmap_bbox(ctx, dest)); w = r.x1 - r.x0; y = r.y1 - r.y0; if (w <= 0 || y <= 0) @@ -384,13 +380,12 @@ fz_invert_pixmap(fz_context *ctx, fz_pixmap *pix) } } -void fz_invert_pixmap_rect(fz_pixmap *image, fz_rect r) +void fz_invert_pixmap_rect(fz_pixmap *image, fz_irect r) { unsigned char *p; int x0, x1, y0, y1; int x, y, n; - r = fz_round_rect(r); x0 = fz_clampi(r.x0 - image->x, 0, image->w - 1); x1 = fz_clampi(r.x1 - image->x, 0, image->w - 1); y0 = fz_clampi(r.y0 - image->y, 0, image->h - 1); |