diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2011-07-13 20:31:56 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2011-07-13 21:03:28 +0100 |
commit | 6913145eefde0e5c4cde9573d8d2cb2a35fd605d (patch) | |
tree | f79dc7269f4f562bdb168b572a37367e806e0190 /fitz/fitz.h | |
parent | 2c4bbbfdc7413a68cad395c3c61ff8e62dceb18b (diff) | |
download | mupdf-6913145eefde0e5c4cde9573d8d2cb2a35fd605d.tar.xz |
Non-isolated group support, and fix Bug 692336.
Firstly, this takes on some of Zenikos patch to correct the clip
stack handling that was broken by the fix to bug 692287 (in commit
2c3bbbf). This bug should now be solved.
We add a new 'shape' field to the draw device structure (and clip
stack). When we are inside non-isolated groups, this is set to be
a pixmap where we accumulate the 'shape' of the objects drawn.
When we come to blend back, if we are blending a non-isolated group
back, we have to use a different blending function that takes account
of the shape.
Various internal groups (the page group, and groups used to force
blending) are set to be isolated to avoid carrying shape planes
around when this is not required.
All our rendering code now has to know how to maintain the shape
plane as well as doing the basic rendering.
Diffstat (limited to 'fitz/fitz.h')
-rw-r--r-- | fitz/fitz.h | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/fitz/fitz.h b/fitz/fitz.h index 5bc22f4e..028c6325 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -620,6 +620,8 @@ fz_pixmap *fz_keep_pixmap(fz_pixmap *pix); void fz_drop_pixmap(fz_pixmap *pix); void fz_clear_pixmap(fz_pixmap *pix); void fz_clear_pixmap_with_color(fz_pixmap *pix, int value); +void fz_clear_pixmap_rect_with_color(fz_pixmap *pix, int value, fz_bbox r); +void fz_copy_pixmap_rect(fz_pixmap *dest, const fz_pixmap *src, fz_bbox r); void fz_premultiply_pixmap(fz_pixmap *pix); fz_pixmap *fz_alpha_from_gray(fz_pixmap *gray, int luminosity); fz_bbox fz_bound_pixmap(fz_pixmap *pix); @@ -1068,13 +1070,41 @@ 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_bbox scissor, fz_pixmap *img, fz_matrix ctm, int alpha); -void fz_paint_image_with_color(fz_pixmap *dst, fz_bbox scissor, 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_rect(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); +void fz_blend_pixmap(fz_pixmap *dst, fz_pixmap *src, int alpha, int blendmode, int isolated, fz_pixmap *shape); + +enum +{ + /* PDF 1.4 -- standard separable */ + FZ_BLEND_NORMAL, + FZ_BLEND_MULTIPLY, + FZ_BLEND_SCREEN, + FZ_BLEND_OVERLAY, + FZ_BLEND_DARKEN, + FZ_BLEND_LIGHTEN, + FZ_BLEND_COLOR_DODGE, + FZ_BLEND_COLOR_BURN, + FZ_BLEND_HARD_LIGHT, + FZ_BLEND_SOFT_LIGHT, + FZ_BLEND_DIFFERENCE, + FZ_BLEND_EXCLUSION, + + /* PDF 1.4 -- standard non-separable */ + FZ_BLEND_HUE, + FZ_BLEND_SATURATION, + FZ_BLEND_COLOR, + FZ_BLEND_LUMINOSITY, + + /* For packing purposes */ + FZ_BLEND_MODEMASK = 15, + FZ_BLEND_ISOLATED = 16, + FZ_BLEND_KNOCKOUT = 32 +}; #endif |