summaryrefslogtreecommitdiff
path: root/fitz
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2011-04-10 01:24:01 +0200
committerTor Andersson <tor.andersson@artifex.com>2011-04-10 01:24:01 +0200
commitd914e3415af1c9c7d8644dfa50fdcf9a79cc01d5 (patch)
tree42b1abdc4ebe58dd008d9f8906db24fa5187324d /fitz
parente8e507b38b8c4429abd6e7b32fe8e3029bfab065 (diff)
downloadmupdf-d914e3415af1c9c7d8644dfa50fdcf9a79cc01d5.tar.xz
Make blendmode opaque.
Diffstat (limited to 'fitz')
-rw-r--r--fitz/dev_list.c2
-rw-r--r--fitz/dev_null.c2
-rw-r--r--fitz/dev_trace.c4
-rw-r--r--fitz/fitz.h34
4 files changed, 10 insertions, 32 deletions
diff --git a/fitz/dev_list.c b/fitz/dev_list.c
index 33e86b73..fc9342fc 100644
--- a/fitz/dev_list.c
+++ b/fitz/dev_list.c
@@ -273,7 +273,7 @@ fz_list_end_mask(void *user)
}
static void
-fz_list_begin_group(void *user, fz_rect rect, int isolated, int knockout, fz_blendmode blendmode, float alpha)
+fz_list_begin_group(void *user, fz_rect rect, int isolated, int knockout, int blendmode, float alpha)
{
fz_display_node *node;
node = fz_new_display_node(FZ_CMD_BEGIN_GROUP, fz_identity, NULL, NULL, alpha);
diff --git a/fitz/dev_null.c b/fitz/dev_null.c
index d351c0a0..f81b330c 100644
--- a/fitz/dev_null.c
+++ b/fitz/dev_null.c
@@ -136,7 +136,7 @@ fz_end_mask(fz_device *dev)
}
void
-fz_begin_group(fz_device *dev, fz_rect area, int isolated, int knockout, fz_blendmode blendmode, float alpha)
+fz_begin_group(fz_device *dev, fz_rect area, int isolated, int knockout, int blendmode, float alpha)
{
if (dev->begin_group)
dev->begin_group(dev->user, area, isolated, knockout, blendmode, alpha);
diff --git a/fitz/dev_trace.c b/fitz/dev_trace.c
index 2bc171de..758a18f9 100644
--- a/fitz/dev_trace.c
+++ b/fitz/dev_trace.c
@@ -240,11 +240,11 @@ fz_trace_end_mask(void *user)
}
static void
-fz_trace_begin_group(void *user, fz_rect bbox, int isolated, int knockout, fz_blendmode blendmode, float alpha)
+fz_trace_begin_group(void *user, fz_rect bbox, int isolated, int knockout, int blendmode, float alpha)
{
printf("<group bbox=\"%g %g %g %g\" isolated=\"%d\" knockout=\"%d\" blendmode=\"%s\" alpha=\"%g\">\n",
bbox.x0, bbox.y0, bbox.x1, bbox.y1,
- isolated, knockout, fz_blendmode_names[blendmode], alpha);
+ isolated, knockout, fz_blendmode_name(blendmode), alpha);
}
static void
diff --git a/fitz/fitz.h b/fitz/fitz.h
index 15ac5e28..2ee28f86 100644
--- a/fitz/fitz.h
+++ b/fitz/fitz.h
@@ -579,30 +579,8 @@ fz_stream *fz_open_jbig2d(fz_stream *chain, fz_buffer *global);
enum { FZ_MAX_COLORS = 32 };
-typedef enum fz_blendmode_e
-{
- /* 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,
-} fz_blendmode;
-
-extern const char *fz_blendmode_names[];
+int fz_find_blendmode(char *name);
+char *fz_blendmode_name(int blendmode);
/*
* Pixmaps have n components per pixel. the last is always alpha.
@@ -1017,7 +995,7 @@ struct fz_device_s
void (*begin_mask)(void *, fz_rect, int luminosity, fz_colorspace *, float *bc);
void (*end_mask)(void *);
- void (*begin_group)(void *, fz_rect, int isolated, int knockout, fz_blendmode blendmode, float alpha);
+ void (*begin_group)(void *, fz_rect, int isolated, int knockout, int blendmode, float alpha);
void (*end_group)(void *);
void (*begin_tile)(void *, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm);
@@ -1040,7 +1018,7 @@ void fz_fill_image_mask(fz_device *dev, fz_pixmap *image, fz_matrix ctm, fz_colo
void fz_clip_image_mask(fz_device *dev, fz_pixmap *image, fz_matrix ctm);
void fz_begin_mask(fz_device *dev, fz_rect area, int luminosity, fz_colorspace *colorspace, float *bc);
void fz_end_mask(fz_device *dev);
-void fz_begin_group(fz_device *dev, fz_rect area, int isolated, int knockout, fz_blendmode blendmode, float alpha);
+void fz_begin_group(fz_device *dev, fz_rect area, int isolated, int knockout, int blendmode, float alpha);
void fz_end_group(fz_device *dev);
void fz_begin_tile(fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm);
void fz_end_tile(fz_device *dev);
@@ -1124,7 +1102,7 @@ struct fz_display_node_s
fz_text *text;
fz_shade *shade;
fz_pixmap *image;
- fz_blendmode blendmode;
+ int blendmode;
} item;
fz_stroke_state *stroke;
int flag; /* even_odd, accumulate, isolated/knockout... */
@@ -1169,6 +1147,6 @@ 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, fz_blendmode blendmode);
+void fz_blend_pixmap(fz_pixmap *dst, fz_pixmap *src, int alpha, int blendmode);
#endif