diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/fitz/draw-affine.c | 801 | ||||
-rw-r--r-- | source/fitz/draw-device.c | 168 | ||||
-rw-r--r-- | source/fitz/draw-edge.c | 46 | ||||
-rw-r--r-- | source/fitz/draw-edgebuffer.c | 12 | ||||
-rw-r--r-- | source/fitz/draw-imp.h | 42 | ||||
-rw-r--r-- | source/fitz/draw-paint.c | 521 | ||||
-rw-r--r-- | source/fitz/draw-rasterize.c | 4 | ||||
-rw-r--r-- | source/fitz/paint-glyph.h | 136 |
8 files changed, 1308 insertions, 422 deletions
diff --git a/source/fitz/draw-affine.c b/source/fitz/draw-affine.c index 08a2161c..1af0a553 100644 --- a/source/fitz/draw-affine.c +++ b/source/fitz/draw-affine.c @@ -7,7 +7,7 @@ typedef unsigned char byte; -typedef void (paintfn_t)(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp); +typedef void (paintfn_t)(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop); static inline int lerp(int a, int b, int t) { @@ -56,7 +56,7 @@ template_affine_alpha_N_lerp(byte * restrict dp, int da, const byte * restrict s int x = bilerp(a[k], b[k], c[k], d[k], uf, vf); dp[k] = fz_mul255(x, alpha) + fz_mul255(dp[k], t); } - for (k = sn1; k < dn1; k++) + for (; k < dn1; k++) dp[k] = 0; if (da) dp[dn1] = xa + fz_mul255(dp[dn1], t); @@ -73,6 +73,53 @@ template_affine_alpha_N_lerp(byte * restrict dp, int da, const byte * restrict s while (--w); } +static inline void +template_affine_alpha_N_lerp_op(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, byte * restrict hp, const fz_overprint * restrict eop) +{ + int k; + + do + { + if (u + 32768 >= 0 && u + 65536 < sw && v + 32768 >= 0 && v + 65536 < sh) + { + int ui = u >> 16; + int vi = v >> 16; + int uf = u & 0xffff; + int vf = v & 0xffff; + const byte *a = sample_nearest(sp, sw, sh, ss, sn1+sa, ui, vi); + const byte *b = sample_nearest(sp, sw, sh, ss, sn1+sa, ui+1, vi); + const byte *c = sample_nearest(sp, sw, sh, ss, sn1+sa, ui, vi+1); + const byte *d = sample_nearest(sp, sw, sh, ss, sn1+sa, ui+1, vi+1); + int xa = sa ? fz_mul255(bilerp(a[sn1], b[sn1], c[sn1], d[sn1], uf, vf), alpha) : alpha; + if (xa != 0) + { + int t = 255 - xa; + for (k = 0; k < sn1; k++) + { + if (fz_overprint_component(eop, k)) + { + int x = bilerp(a[k], b[k], c[k], d[k], uf, vf); + dp[k] = fz_mul255(x, alpha) + fz_mul255(dp[k], t); + } + } + for (; k < dn1; k++) + if (fz_overprint_component(eop, k)) + dp[k] = 0; + if (da) + dp[dn1] = xa + fz_mul255(dp[dn1], t); + if (hp) + hp[0] = xa + fz_mul255(hp[0], t); + } + } + dp += dn1+da; + if (hp) + hp++; + u += fa; + v += fb; + } + while (--w); +} + /* Special case code for gray -> rgb */ static inline void template_affine_alpha_g2rgb_lerp(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int alpha, byte * restrict hp) @@ -222,6 +269,43 @@ template_affine_alpha_N_near(byte * restrict dp, int da, const byte * restrict s } static inline void +template_affine_alpha_N_near_op(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, byte * restrict hp, const fz_overprint * restrict eop) +{ + int k; + + do + { + int ui = u >> 16; + int vi = v >> 16; + if (ui >= 0 && ui < sw && vi >= 0 && vi < sh) + { + const byte *sample = sp + (vi * ss) + (ui * (sn1+sa)); + int a = (sa ? fz_mul255(sample[sn1], alpha) : alpha); + if (a != 0) + { + int t = 255 - a; + for (k = 0; k < sn1; k++) + if (fz_overprint_component(eop, k)) + dp[k] = fz_mul255(sample[k], alpha) + fz_mul255(dp[k], t); + for (; k < dn1; k++) + if (fz_overprint_component(eop, k)) + dp[k] = 0; + if (da) + dp[dn1] = a + fz_mul255(dp[dn1], t); + if (hp) + hp[0] = a + fz_mul255(hp[0], t); + } + } + dp += dn1+da; + if (hp) + hp++; + u += fa; + v += fb; + } + while (--w); +} + +static inline void template_affine_alpha_g2rgb_near_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int alpha, byte * restrict hp) { int ui = u >> 16; @@ -351,7 +435,7 @@ template_affine_N_lerp(byte * restrict dp, int da, const byte * restrict sp, int int x = bilerp(a[k], b[k], c[k], d[k], uf, vf); dp[k] = x + fz_mul255(dp[k], t); } - for (k = sn1; k < dn1; k++) + for (; k < dn1; k++) dp[k] = 0; if (da) dp[dn1] = y + fz_mul255(dp[dn1], t); @@ -369,6 +453,51 @@ template_affine_N_lerp(byte * restrict dp, int da, const byte * restrict sp, int } static inline void +template_affine_N_lerp_op(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, byte * restrict hp, const fz_overprint * restrict eop) +{ + int k; + + do + { + if (u + 32768 >= 0 && u + 65536 < sw && v + 32768 >= 0 && v + 65536 < sh) + { + int ui = u >> 16; + int vi = v >> 16; + int uf = u & 0xffff; + int vf = v & 0xffff; + const byte *a = sample_nearest(sp, sw, sh, ss, sn1+sa, ui, vi); + const byte *b = sample_nearest(sp, sw, sh, ss, sn1+sa, ui+1, vi); + const byte *c = sample_nearest(sp, sw, sh, ss, sn1+sa, ui, vi+1); + const byte *d = sample_nearest(sp, sw, sh, ss, sn1+sa, ui+1, vi+1); + int y = sa ? bilerp(a[sn1], b[sn1], c[sn1], d[sn1], uf, vf) : 255; + if (y != 0) + { + int t = 255 - y; + for (k = 0; k < sn1; k++) + if (fz_overprint_component(eop, k)) + { + int x = bilerp(a[k], b[k], c[k], d[k], uf, vf); + dp[k] = x + fz_mul255(dp[k], t); + } + for (; k < dn1; k++) + if (fz_overprint_component(eop, k)) + dp[k] = 0; + if (da) + dp[dn1] = y + fz_mul255(dp[dn1], t); + if (hp) + hp[0] = y + fz_mul255(hp[0], t); + } + } + dp += dn1 + da; + if (hp) + hp++; + u += fa; + v += fb; + } + while (--w); +} + +static inline void template_affine_solid_g2rgb_lerp(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, byte * restrict hp) { do @@ -536,6 +665,7 @@ static inline void template_affine_N_near(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, byte * restrict hp) { int k; + do { int ui = u >> 16; @@ -563,7 +693,7 @@ template_affine_N_near(byte * restrict dp, int da, const byte * restrict sp, int dp[2] = sample[2]; for (k = 3; k < sn1; k++) dp[k] = sample[k]; - for (k = sn1; k < dn1; k++) + for (; k < dn1; k++) dp[k] = 0; if (da) dp[dn1] = a; @@ -594,6 +724,68 @@ template_affine_N_near(byte * restrict dp, int da, const byte * restrict sp, int } static inline void +template_affine_N_near_op(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, byte * restrict hp, const fz_overprint * restrict eop) +{ + int k; + + do + { + int ui = u >> 16; + int vi = v >> 16; + if (ui >= 0 && ui < sw && vi >= 0 && vi < sh) + { + const byte *sample = sp + (vi * ss) + (ui * (sn1+sa)); + int a = sa ? sample[sn1] : 255; + /* If a is 0, then sample[k] = 0 for all k, as premultiplied */ + if (a != 0) + { + int t = 255 - a; + if (t == 0) + { + if (fz_overprint_component(eop, 0)) + dp[0] = sample[0]; + if (sn1 > 1) + if (fz_overprint_component(eop, 1)) + dp[1] = sample[1]; + if (sn1 > 2) + if (fz_overprint_component(eop, 2)) + dp[2] = sample[2]; + for (k = 3; k < sn1; k++) + if (fz_overprint_component(eop, k)) + dp[k] = sample[k]; + for (; k < dn1; k++) + if (fz_overprint_component(eop, k)) + dp[k] = 0; + if (da) + dp[dn1] = a; + if (hp) + hp[0] = a; + } + else + { + for (k = 0; k < sn1; k++) + if (fz_overprint_component(eop, k)) + dp[k] = sample[k] + fz_mul255(dp[k], t); + for (; k < dn1; k++) + if (fz_overprint_component(eop, k)) + dp[k] = 0; + if (da) + dp[dn1] = a + fz_mul255(dp[dn1], t); + if (hp) + hp[0] = a + fz_mul255(hp[0], t); + } + } + } + dp += dn1+da; + if (hp) + hp++; + u += fa; + v += fb; + } + while (--w); +} + +static inline void template_affine_solid_g2rgb_near_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, byte * restrict hp) { int ui = u >> 16; @@ -777,6 +969,46 @@ template_affine_color_N_lerp(byte * restrict dp, int da, const byte * restrict s } static inline void +template_affine_color_N_lerp_op(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int u, int v, int fa, int fb, int w, int dn1, int sn1, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) +{ + int sa = color[dn1]; + int k; + + do + { + if (u + 32768 >= 0 && u + 65536 < sw && v + 32768 >= 0 && v + 65536 < sh) + { + int ui = u >> 16; + int vi = v >> 16; + int uf = u & 0xffff; + int vf = v & 0xffff; + const byte *a = sample_nearest(sp, sw, sh, ss, 1, ui, vi); + const byte *b = sample_nearest(sp, sw, sh, ss, 1, ui+1, vi); + const byte *c = sample_nearest(sp, sw, sh, ss, 1, ui, vi+1); + const byte *d = sample_nearest(sp, sw, sh, ss, 1, ui+1, vi+1); + int ma = bilerp(a[0], b[0], c[0], d[0], uf, vf); + int masa = FZ_COMBINE(FZ_EXPAND(ma), sa); + if (masa != 0) + { + for (k = 0; k < dn1; k++) + if (fz_overprint_component(eop, k)) + dp[k] = FZ_BLEND(color[k], dp[k], masa); + if (da) + dp[dn1] = FZ_BLEND(255, dp[dn1], masa); + if (hp) + hp[0] = FZ_BLEND(255, hp[0], masa); + } + } + dp += dn1 + da; + if (hp) + hp++; + u += fa; + v += fb; + } + while (--w); +} + +static inline void template_affine_color_N_near(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int u, int v, int fa, int fb, int w, int dn1, int sn1, const byte * restrict color, byte * restrict hp) { int sa = color[dn1]; @@ -809,57 +1041,91 @@ template_affine_color_N_near(byte * restrict dp, int da, const byte * restrict s while (--w); } +static inline void +template_affine_color_N_near_op(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int u, int v, int fa, int fb, int w, int dn1, int sn1, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) +{ + int sa = color[dn1]; + int k; + + do + { + int ui = u >> 16; + int vi = v >> 16; + if (ui >= 0 && ui < sw && vi >= 0 && vi < sh) + { + int ma = sp[vi * ss + ui]; + int masa = FZ_COMBINE(FZ_EXPAND(ma), sa); + if (masa) + { + for (k = 0; k < dn1; k++) + if (fz_overprint_component(eop, k)) + dp[k] = FZ_BLEND(color[k], dp[k], masa); + if (da) + dp[dn1] = FZ_BLEND(255, dp[dn1], masa); + if (hp) + hp[0] = FZ_BLEND(255, hp[0], masa); + } + } + dp += dn1+da; + if (hp) + hp++; + u += fa; + v += fb; + } + while (--w); +} + static void -paint_affine_lerp_da_sa_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_sa_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 0, 0, hp); } static void -paint_affine_lerp_da_sa_alpha_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_sa_alpha_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 0, 0, alpha, hp); } static void -paint_affine_lerp_da_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 0, 0, hp); } static void -paint_affine_lerp_da_alpha_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_alpha_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 0, 0, alpha, hp); } static void -paint_affine_lerp_da_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 1, 1, hp); } static void -paint_affine_lerp_da_alpha_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_alpha_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 1, 1, alpha, hp); } static void -paint_affine_lerp_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 1, 1, hp); } static void -paint_affine_lerp_alpha_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_alpha_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 1, 1, alpha, hp); @@ -867,28 +1133,28 @@ paint_affine_lerp_alpha_1(byte * restrict dp, int da, const byte * restrict sp, #if FZ_PLOTTERS_G static void -paint_affine_lerp_da_sa_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_sa_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 1, 1, hp); } static void -paint_affine_lerp_da_sa_alpha_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_sa_alpha_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 1, 1, alpha, hp); } static void -paint_affine_lerp_sa_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_sa_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 1, 1, hp); } static void -paint_affine_lerp_sa_alpha_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_sa_alpha_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 1, 1, alpha, hp); @@ -897,56 +1163,56 @@ paint_affine_lerp_sa_alpha_1(byte * restrict dp, int da, const byte * restrict s #if FZ_PLOTTERS_RGB static void -paint_affine_lerp_da_sa_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_sa_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 3, 3, hp); } static void -paint_affine_lerp_da_sa_alpha_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_sa_alpha_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 3, 3, alpha, hp); } static void -paint_affine_lerp_da_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 3, 3, hp); } static void -paint_affine_lerp_da_alpha_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_alpha_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 3, 3, alpha, hp); } static void -paint_affine_lerp_sa_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_sa_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 3, 3, hp); } static void -paint_affine_lerp_sa_alpha_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_sa_alpha_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 3, 3, alpha, hp); } static void -paint_affine_lerp_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 3, 3, hp); } static void -paint_affine_lerp_alpha_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_alpha_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 3, 3, alpha, hp); @@ -955,56 +1221,56 @@ paint_affine_lerp_alpha_3(byte * restrict dp, int da, const byte * restrict sp, #if FZ_PLOTTERS_CMYK static void -paint_affine_lerp_da_sa_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_sa_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 4, 4, hp); } static void -paint_affine_lerp_da_sa_alpha_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_sa_alpha_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 4, 4, alpha, hp); } static void -paint_affine_lerp_da_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 4, 4, hp); } static void -paint_affine_lerp_da_alpha_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_alpha_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 4, 4, alpha, hp); } static void -paint_affine_lerp_sa_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_sa_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 4, 4, hp); } static void -paint_affine_lerp_sa_alpha_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_sa_alpha_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 4, 4, alpha, hp); } static void -paint_affine_lerp_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 4, 4, hp); } static void -paint_affine_lerp_alpha_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_alpha_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 4, 4, alpha, hp); @@ -1013,65 +1279,88 @@ paint_affine_lerp_alpha_4(byte * restrict dp, int da, const byte * restrict sp, #if FZ_PLOTTERS_N static void -paint_affine_lerp_da_sa_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_sa_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, dn, sn, hp); } static void -paint_affine_lerp_da_sa_alpha_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_sa_alpha_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, dn, sn, alpha, hp); } static void -paint_affine_lerp_da_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, dn, sn, hp); } static void -paint_affine_lerp_da_alpha_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_alpha_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, dn, sn, alpha, hp); } static void -paint_affine_lerp_sa_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_sa_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, dn, sn, hp); } static void -paint_affine_lerp_sa_alpha_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_sa_alpha_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, dn, sn, alpha, hp); } static void -paint_affine_lerp_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_lerp(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, dn, sn, hp); } static void -paint_affine_lerp_alpha_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_alpha_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_lerp(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, dn, sn, alpha, hp); } + +static void +paint_affine_lerp_N_op(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) +{ + TRACK_FN(); + template_affine_N_lerp_op(dp, da, sp, sw, sh, ss, sa, u, v, fa, fb, w, dn, sn, hp, eop); +} + +static void +paint_affine_lerp_alpha_N_op(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) +{ + TRACK_FN(); + template_affine_alpha_N_lerp_op(dp, da, sp, sw, sh, ss, sa, u, v, fa, fb, w, dn, sn, alpha, hp, eop); +} #endif /* FZ_PLOTTERS_N */ static paintfn_t * -fz_paint_affine_lerp(int da, int sa, int fa, int fb, int n, int alpha) +fz_paint_affine_lerp(int da, int sa, int fa, int fb, int n, int alpha, const fz_overprint * restrict eop) { + if (eop != NULL) + { + if (alpha == 255) + return paint_affine_lerp_N_op; + else if (alpha > 0) + return paint_affine_lerp_alpha_N_op; + else + return NULL; + } switch(n) { case 0: @@ -1259,9 +1548,16 @@ fallback: } static paintfn_t * -fz_paint_affine_lerp_spots(int da, int sa, int fa, int fb, int dn, int sn, int alpha) +fz_paint_affine_lerp_spots(int da, int sa, int fa, int fb, int dn, int sn, int alpha, const fz_overprint * restrict eop) { - if (da) + if (eop != NULL) + { + if (alpha == 255) + return paint_affine_lerp_N_op; + else if (alpha > 0) + return paint_affine_lerp_alpha_N_op; + } + else if (da) { if (sa) { @@ -1300,56 +1596,56 @@ fz_paint_affine_lerp_spots(int da, int sa, int fa, int fb, int dn, int sn, int a #if FZ_PLOTTERS_RGB static void -paint_affine_lerp_da_sa_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_sa_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_solid_g2rgb_lerp(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, hp); } static void -paint_affine_lerp_da_sa_g2rgb_alpha(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_sa_g2rgb_alpha(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_g2rgb_lerp(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, alpha, hp); } static void -paint_affine_lerp_da_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_solid_g2rgb_lerp(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, hp); } static void -paint_affine_lerp_da_g2rgb_alpha(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_da_g2rgb_alpha(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_g2rgb_lerp(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, alpha, hp); } static void -paint_affine_lerp_sa_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_sa_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_solid_g2rgb_lerp(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, hp); } static void -paint_affine_lerp_sa_g2rgb_alpha(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_sa_g2rgb_alpha(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_g2rgb_lerp(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, alpha, hp); } static void -paint_affine_lerp_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_solid_g2rgb_lerp(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, hp); } static void -paint_affine_lerp_g2rgb_alpha(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_lerp_g2rgb_alpha(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_g2rgb_lerp(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, alpha, hp); @@ -1397,168 +1693,168 @@ fz_paint_affine_g2rgb_lerp(int da, int sa, int fa, int fb, int n, int alpha) #endif /* FZ_PLOTTERS_RGB */ static void -paint_affine_near_da_sa_0_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_0_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 0, 0, hp); } static void -paint_affine_near_da_sa_alpha_0_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_0_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 0, 0, alpha, hp); } static void -paint_affine_near_da_0_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_0_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 0, 0, hp); } static void -paint_affine_near_da_alpha_0_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_0_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 0, 0, alpha, hp); } static void -paint_affine_near_da_sa_0_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_0_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 0, 0, hp); } static void -paint_affine_near_da_sa_alpha_0_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_0_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 0, 0, alpha, hp); } static void -paint_affine_near_da_0_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_0_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 0, 0, hp); } static void -paint_affine_near_da_alpha_0_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_0_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 0, 0, alpha, hp); } static void -paint_affine_near_da_sa_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 0, 0, hp); } static void -paint_affine_near_da_sa_alpha_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 0, 0, alpha, hp); } static void -paint_affine_near_da_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 0, 0, hp); } static void -paint_affine_near_da_alpha_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 0, 0, alpha, hp); } static void -paint_affine_near_1_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int snn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_1_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int snn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 1, 1, hp); } static void -paint_affine_near_1_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_1_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 1, 1, hp); } static void -paint_affine_near_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 1, 1, hp); } static void -paint_affine_near_alpha_1_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_alpha_1_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 1, 1, alpha, hp); } static void -paint_affine_near_alpha_1_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_alpha_1_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 1, 1, alpha, hp); } static void -paint_affine_near_alpha_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_alpha_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 1, 1, alpha, hp); } static void -paint_affine_near_da_1_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_1_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 1, 1, hp); } static void -paint_affine_near_da_alpha_1_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_1_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 1, 1, alpha, hp); } static void -paint_affine_near_da_1_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_1_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 1, 1, hp); } static void -paint_affine_near_da_alpha_1_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_1_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 1, 1, alpha, hp); } static void -paint_affine_near_da_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 1, 1, hp); } static void -paint_affine_near_da_alpha_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 1, 1, alpha, hp); @@ -1566,84 +1862,84 @@ paint_affine_near_da_alpha_1(byte * restrict dp, int da, const byte * restrict s #if FZ_PLOTTERS_G static void -paint_affine_near_da_sa_1_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_1_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 1, 1, hp); } static void -paint_affine_near_da_sa_alpha_1_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_1_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 1, 1, alpha, hp); } static void -paint_affine_near_sa_1_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_1_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 1, 1, hp); } static void -paint_affine_near_sa_alpha_1_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_alpha_1_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 1, 1, alpha, hp); } static void -paint_affine_near_da_sa_1_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_1_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 1, 1, hp); } static void -paint_affine_near_da_sa_alpha_1_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_1_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 1, 1, alpha, hp); } static void -paint_affine_near_sa_alpha_1_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_alpha_1_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 1, 1, alpha, hp); } static void -paint_affine_near_da_sa_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 1, 1, hp); } static void -paint_affine_near_sa_1_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_1_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 1, 1, hp); } static void -paint_affine_near_da_sa_alpha_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 1, 1, alpha, hp); } static void -paint_affine_near_sa_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 1, 1, hp); } static void -paint_affine_near_sa_alpha_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_alpha_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 1, 1, alpha, hp); @@ -1652,168 +1948,168 @@ paint_affine_near_sa_alpha_1(byte * restrict dp, int da, const byte * restrict s #if FZ_PLOTTERS_RGB static void -paint_affine_near_da_sa_3_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_3_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 3, 3, hp); } static void -paint_affine_near_da_sa_alpha_3_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_3_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 3, 3, alpha, hp); } static void -paint_affine_near_da_3_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_3_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 3, 3, hp); } static void -paint_affine_near_da_alpha_3_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_3_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 3, 3, alpha, hp); } static void -paint_affine_near_sa_3_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_3_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 3, 3, hp); } static void -paint_affine_near_sa_alpha_3_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_alpha_3_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 3, 3, alpha, hp); } static void -paint_affine_near_3_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_3_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 3, 3, hp); } static void -paint_affine_near_alpha_3_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_alpha_3_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 3, 3, alpha, hp); } static void -paint_affine_near_da_sa_3_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_3_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 3, 3, hp); } static void -paint_affine_near_da_sa_alpha_3_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_3_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 3, 3, alpha, hp); } static void -paint_affine_near_da_3_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_3_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 3, 3, hp); } static void -paint_affine_near_da_alpha_3_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_3_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 3, 3, alpha, hp); } static void -paint_affine_near_sa_alpha_3_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_alpha_3_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 3, 3, alpha, hp); } static void -paint_affine_near_da_sa_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 3, 3, hp); } static void -paint_affine_near_alpha_3_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_alpha_3_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 3, 3, alpha, hp); } static void -paint_affine_near_3_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_3_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 3, 3, hp); } static void -paint_affine_near_sa_3_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_3_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 3, 3, hp); } static void -paint_affine_near_da_sa_alpha_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 3, 3, alpha, hp); } static void -paint_affine_near_da_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 3, 3, hp); } static void -paint_affine_near_sa_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 3, 3, hp); } static void -paint_affine_near_da_alpha_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 3, 3, alpha, hp); } static void -paint_affine_near_sa_alpha_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_alpha_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 3, 3, alpha, hp); } static void -paint_affine_near_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 3, 3, hp); } static void -paint_affine_near_alpha_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_alpha_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 3, 3, alpha, hp); @@ -1822,168 +2118,168 @@ paint_affine_near_alpha_3(byte * restrict dp, int da, const byte * restrict sp, #if FZ_PLOTTERS_CMYK static void -paint_affine_near_da_sa_4_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_4_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 4, 4, hp); } static void -paint_affine_near_da_sa_alpha_4_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_4_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 4, 4, alpha, hp); } static void -paint_affine_near_da_4_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_4_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 4, 4, hp); } static void -paint_affine_near_da_alpha_4_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_4_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 4, 4, alpha, hp); } static void -paint_affine_near_sa_4_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_4_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 4, 4, hp); } static void -paint_affine_near_sa_alpha_4_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_alpha_4_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 4, 4, alpha, hp); } static void -paint_affine_near_4_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_4_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 4, 4, hp); } static void -paint_affine_near_alpha_4_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_alpha_4_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 4, 4, alpha, hp); } static void -paint_affine_near_da_sa_4_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_4_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 4, 4, hp); } static void -paint_affine_near_da_sa_alpha_4_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_4_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 4, 4, alpha, hp); } static void -paint_affine_near_da_4_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_4_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 4, 4, hp); } static void -paint_affine_near_da_alpha_4_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_4_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 4, 4, alpha, hp); } static void -paint_affine_near_sa_4_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_4_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 4, 4, hp); } static void -paint_affine_near_sa_alpha_4_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_alpha_4_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 4, 4, alpha, hp); } static void -paint_affine_near_4_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_4_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 4, 4, hp); } static void -paint_affine_near_alpha_4_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_alpha_4_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 4, 4, alpha, hp); } static void -paint_affine_near_da_sa_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 4, 4, hp); } static void -paint_affine_near_da_sa_alpha_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, 4, 4, alpha, hp); } static void -paint_affine_near_da_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 4, 4, hp); } static void -paint_affine_near_da_alpha_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, 4, 4, alpha, hp); } static void -paint_affine_near_sa_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 4, 4, hp); } static void -paint_affine_near_sa_alpha_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_alpha_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, 4, 4, alpha, hp); } static void -paint_affine_near_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 4, 4, hp); } static void -paint_affine_near_alpha_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_alpha_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, 4, 4, alpha, hp); @@ -1992,177 +2288,200 @@ paint_affine_near_alpha_4(byte * restrict dp, int da, const byte * restrict sp, #if FZ_PLOTTERS_N static void -paint_affine_near_da_sa_N_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_N_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, dn, sn, hp); } static void -paint_affine_near_da_sa_alpha_N_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_N_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, dn, sn, alpha, hp); } static void -paint_affine_near_da_N_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_N_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, dn, sn, hp); } static void -paint_affine_near_da_alpha_N_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_N_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, dn, sn, alpha, hp); } static void -paint_affine_near_sa_N_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_N_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, dn, sn, hp); } static void -paint_affine_near_sa_alpha_N_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_alpha_N_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, dn, sn, alpha, hp); } static void -paint_affine_near_N_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_N_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fa0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, dn, sn, hp); } static void -paint_affine_near_alpha_N_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_alpha_N_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fa0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, dn, sn, alpha, hp); } static void -paint_affine_near_da_sa_N_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_N_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, dn, sn, hp); } static void -paint_affine_near_da_sa_alpha_N_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_N_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, dn, sn, alpha, hp); } static void -paint_affine_near_da_N_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_N_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, dn, sn, hp); } static void -paint_affine_near_da_alpha_N_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_N_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, dn, sn, alpha, hp); } static void -paint_affine_near_sa_N_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_N_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, dn, sn, hp); } static void -paint_affine_near_sa_alpha_N_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_alpha_N_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, dn, sn, alpha, hp); } static void -paint_affine_near_N_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_N_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near_fb0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, dn, sn, hp); } static void -paint_affine_near_alpha_N_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_alpha_N_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near_fb0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, dn, sn, alpha, hp); } static void -paint_affine_near_da_sa_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, dn, sn, hp); } static void -paint_affine_near_da_sa_alpha_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, dn, sn, alpha, hp); } static void -paint_affine_near_da_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, dn, sn, hp); } static void -paint_affine_near_da_alpha_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, dn, sn, alpha, hp); } static void -paint_affine_near_sa_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, dn, sn, hp); } static void -paint_affine_near_sa_alpha_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_alpha_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, dn, sn, alpha, hp); } static void -paint_affine_near_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_N_near(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, dn, sn, hp); } static void -paint_affine_near_alpha_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_alpha_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_N_near(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, dn, sn, alpha, hp); } + +static void +paint_affine_near_N_op(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) +{ + TRACK_FN(); + template_affine_N_near_op(dp, da, sp, sw, sh, ss, sa, u, v, fa, fb, w, dn, sn, hp, eop); +} + +static void +paint_affine_near_alpha_N_op(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) +{ + TRACK_FN(); + template_affine_alpha_N_near_op(dp, da, sp, sw, sh, ss, sa, u, v, fa, fb, w, dn, sn, alpha, hp, eop); +} #endif static paintfn_t * -fz_paint_affine_near(int da, int sa, int fa, int fb, int n, int alpha) +fz_paint_affine_near(int da, int sa, int fa, int fb, int n, int alpha, const fz_overprint * restrict eop) { + if (eop != NULL) + { + if (alpha == 255) + return paint_affine_near_N_op; + else if (alpha > 0) + return paint_affine_near_alpha_N_op; + else + return NULL; + } switch(n) { case 0: @@ -2602,9 +2921,16 @@ fallback: } static paintfn_t * -fz_paint_affine_near_spots(int da, int sa, int fa, int fb, int dn, int sn, int alpha) +fz_paint_affine_near_spots(int da, int sa, int fa, int fb, int dn, int sn, int alpha, const fz_overprint * restrict eop) { - if (da) + if (eop != NULL) + { + if (alpha == 255) + return paint_affine_near_N_op; + else if (alpha > 0) + return paint_affine_near_alpha_N_op; + } + else if (da) { if (sa) { @@ -2699,168 +3025,168 @@ fz_paint_affine_near_spots(int da, int sa, int fa, int fb, int dn, int sn, int a #if FZ_PLOTTERS_RGB static void -paint_affine_near_da_sa_g2rgb_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_g2rgb_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_solid_g2rgb_near_fa0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, hp); } static void -paint_affine_near_da_sa_alpha_g2rgb_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_g2rgb_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_g2rgb_near_fa0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, alpha, hp); } static void -paint_affine_near_da_g2rgb_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_g2rgb_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_solid_g2rgb_near_fa0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, hp); } static void -paint_affine_near_da_alpha_g2rgb_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_g2rgb_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_g2rgb_near_fa0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, alpha, hp); } static void -paint_affine_near_sa_g2rgb_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_g2rgb_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_solid_g2rgb_near_fa0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, hp); } static void -paint_affine_near_sa_alpha_g2rgb_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_alpha_g2rgb_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_g2rgb_near_fa0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, alpha, hp); } static void -paint_affine_near_g2rgb_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_g2rgb_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_solid_g2rgb_near_fa0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, hp); } static void -paint_affine_near_alpha_g2rgb_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_alpha_g2rgb_fa0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_g2rgb_near_fa0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, alpha, hp); } static void -paint_affine_near_da_sa_g2rgb_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_g2rgb_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_solid_g2rgb_near_fb0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, hp); } static void -paint_affine_near_da_sa_alpha_g2rgb_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_g2rgb_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_g2rgb_near_fb0(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, alpha, hp); } static void -paint_affine_near_da_g2rgb_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_g2rgb_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_solid_g2rgb_near_fb0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, hp); } static void -paint_affine_near_da_alpha_g2rgb_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_g2rgb_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_g2rgb_near_fb0(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, alpha, hp); } static void -paint_affine_near_sa_g2rgb_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_g2rgb_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_solid_g2rgb_near_fb0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, hp); } static void -paint_affine_near_sa_alpha_g2rgb_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_alpha_g2rgb_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_g2rgb_near_fb0(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, alpha, hp); } static void -paint_affine_near_g2rgb_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_g2rgb_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_solid_g2rgb_near_fb0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, hp); } static void -paint_affine_near_alpha_g2rgb_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_alpha_g2rgb_fb0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_g2rgb_near_fb0(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, alpha, hp); } static void -paint_affine_near_da_sa_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_solid_g2rgb_near(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, hp); } static void -paint_affine_near_da_sa_alpha_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_sa_alpha_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_g2rgb_near(dp, 1, sp, sw, sh, ss, 1, u, v, fa, fb, w, alpha, hp); } static void -paint_affine_near_da_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_solid_g2rgb_near(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, hp); } static void -paint_affine_near_da_alpha_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_da_alpha_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_g2rgb_near(dp, 1, sp, sw, sh, ss, 0, u, v, fa, fb, w, alpha, hp); } static void -paint_affine_near_sa_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_solid_g2rgb_near(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, hp); } static void -paint_affine_near_sa_alpha_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_sa_alpha_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_g2rgb_near(dp, 0, sp, sw, sh, ss, 1, u, v, fa, fb, w, alpha, hp); } static void -paint_affine_near_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_solid_g2rgb_near(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, hp); } static void -paint_affine_near_alpha_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_near_alpha_g2rgb(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn1, int sn1, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_alpha_g2rgb_near(dp, 0, sp, sw, sh, ss, 0, u, v, fa, fb, w, alpha, hp); @@ -2976,7 +3302,7 @@ fz_paint_affine_g2rgb_near(int da, int sa, int fa, int fb, int n, int alpha) #endif /* FZ_PLOTTERS_RGB */ static void -paint_affine_color_lerp_da_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_lerp_da_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_lerp(dp, 1, sp, sw, sh, ss, u, v, fa, fb, w, 0, 0, color, hp); @@ -2984,14 +3310,14 @@ paint_affine_color_lerp_da_0(byte * restrict dp, int da, const byte * restrict s #if FZ_PLOTTERS_G static void -paint_affine_color_lerp_da_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_lerp_da_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_lerp(dp, 1, sp, sw, sh, ss, u, v, fa, fb, w, 1, 1, color, hp); } static void -paint_affine_color_lerp_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_lerp_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_lerp(dp, 0, sp, sw, sh, ss, u, v, fa, fb, w, 1, 1, color, hp); @@ -3000,14 +3326,14 @@ paint_affine_color_lerp_1(byte * restrict dp, int da, const byte * restrict sp, #if FZ_PLOTTERS_RGB static void -paint_affine_color_lerp_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_lerp_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_lerp(dp, 0, sp, sw, sh, ss, u, v, fa, fb, w, 3, 3, color, hp); } static void -paint_affine_color_lerp_da_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_lerp_da_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_lerp(dp, 1, sp, sw, sh, ss, u, v, fa, fb, w, 3, 3, color, hp); @@ -3016,14 +3342,14 @@ paint_affine_color_lerp_da_3(byte * restrict dp, int da, const byte * restrict s #if FZ_PLOTTERS_CMYK static void -paint_affine_color_lerp_da_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_lerp_da_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_lerp(dp, 1, sp, sw, sh, ss, u, v, fa, fb, w, 4, 4, color, hp); } static void -paint_affine_color_lerp_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_lerp_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_lerp(dp, 0, sp, sw, sh, ss, u, v, fa, fb, w, 4, 4, color, hp); @@ -3032,23 +3358,32 @@ paint_affine_color_lerp_4(byte * restrict dp, int da, const byte * restrict sp, #if FZ_PLOTTERS_N static void -paint_affine_color_lerp_da_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_lerp_da_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_lerp(dp, 1, sp, sw, sh, ss, u, v, fa, fb, w, dn, sn, color, hp); } static void -paint_affine_color_lerp_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_lerp_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_lerp(dp, 0, sp, sw, sh, ss, u, v, fa, fb, w, dn, sn, color, hp); } + +static void +paint_affine_color_lerp_N_op(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) +{ + TRACK_FN(); + template_affine_color_N_lerp_op(dp, da, sp, sw, sh, ss, u, v, fa, fb, w, dn, sn, color, hp, eop); +} #endif /* FZ_PLOTTERS_CMYK */ static paintfn_t * -fz_paint_affine_color_lerp(int da, int sa, int fa, int fb, int n, int alpha) +fz_paint_affine_color_lerp(int da, int sa, int fa, int fb, int n, int alpha, const fz_overprint * restrict eop) { + if (eop != NULL) + return paint_affine_color_lerp_N_op; switch (n) { case 0: return da ? paint_affine_color_lerp_da_0 : NULL; @@ -3069,9 +3404,11 @@ fz_paint_affine_color_lerp(int da, int sa, int fa, int fb, int n, int alpha) } static paintfn_t * -fz_paint_affine_color_lerp_spots(int da, int sa, int fa, int fb, int dn, int sn, int alpha) +fz_paint_affine_color_lerp_spots(int da, int sa, int fa, int fb, int dn, int sn, int alpha, const fz_overprint * restrict eop) { #if FZ_PLOTTERS_N + if (eop != NULL) + return paint_affine_color_lerp_N_op; return da ? paint_affine_color_lerp_da_N : paint_affine_color_lerp_N; #else return NULL; @@ -3079,7 +3416,7 @@ fz_paint_affine_color_lerp_spots(int da, int sa, int fa, int fb, int dn, int sn, } static void -paint_affine_color_near_da_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_near_da_0(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_near(dp, 1, sp, sw, sh, ss, u, v, fa, fb, w, 0, 0, color, hp); @@ -3087,14 +3424,14 @@ paint_affine_color_near_da_0(byte * restrict dp, int da, const byte * restrict s #if FZ_PLOTTERS_G static void -paint_affine_color_near_da_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_near_da_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_near(dp, 1, sp, sw, sh, ss, u, v, fa, fb, w, 1, 1, color, hp); } static void -paint_affine_color_near_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_near_1(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_near(dp, 0, sp, sw, sh, ss, u, v, fa, fb, w, 1, 1, color, hp); @@ -3103,14 +3440,14 @@ paint_affine_color_near_1(byte * restrict dp, int da, const byte * restrict sp, #if FZ_PLOTTERS_RGB static void -paint_affine_color_near_da_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_near_da_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_near(dp, 1, sp, sw, sh, ss, u, v, fa, fb, w, 3, 3, color, hp); } static void -paint_affine_color_near_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_near_3(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_near(dp, 0, sp, sw, sh, ss, u, v, fa, fb, w, 3, 3, color, hp); @@ -3119,14 +3456,14 @@ paint_affine_color_near_3(byte * restrict dp, int da, const byte * restrict sp, #if FZ_PLOTTERS_CMYK static void -paint_affine_color_near_da_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_near_da_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_near(dp, 1, sp, sw, sh, ss, u, v, fa, fb, w, 4, 4, color, hp); } static void -paint_affine_color_near_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_near_4(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_near(dp, 0, sp, sw, sh, ss, u, v, fa, fb, w, 4, 4, color, hp); @@ -3135,23 +3472,39 @@ paint_affine_color_near_4(byte * restrict dp, int da, const byte * restrict sp, #if FZ_PLOTTERS_N static void -paint_affine_color_near_da_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_near_da_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_near(dp, 1, sp, sw, sh, ss, u, v, fa, fb, w, dn, sn, color, hp); } static void -paint_affine_color_near_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp) +paint_affine_color_near_N(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) { TRACK_FN(); template_affine_color_N_near(dp, 0, sp, sw, sh, ss, u, v, fa, fb, w, dn, sn, color, hp); } + +static void +paint_affine_color_near_da_N_op(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) +{ + TRACK_FN(); + template_affine_color_N_near_op(dp, 1, sp, sw, sh, ss, u, v, fa, fb, w, dn, sn, color, hp, eop); +} + +static void +paint_affine_color_near_N_op(byte * restrict dp, int da, const byte * restrict sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * restrict color, byte * restrict hp, const fz_overprint * restrict eop) +{ + TRACK_FN(); + template_affine_color_N_near_op(dp, 0, sp, sw, sh, ss, u, v, fa, fb, w, dn, sn, color, hp, eop); +} #endif /* FZ_PLOTTERS_N */ static paintfn_t * -fz_paint_affine_color_near(int da, int sa, int fa, int fb, int n, int alpha) +fz_paint_affine_color_near(int da, int sa, int fa, int fb, int n, int alpha, const fz_overprint * restrict eop) { + if (eop != NULL) + return da ? paint_affine_color_near_da_N_op : paint_affine_color_near_N_op; switch (n) { case 0: return da ? paint_affine_color_near_da_0 : NULL; @@ -3173,9 +3526,11 @@ fz_paint_affine_color_near(int da, int sa, int fa, int fb, int n, int alpha) } static paintfn_t * -fz_paint_affine_color_near_spots(int da, int sa, int fa, int fb, int dn, int sn, int alpha) +fz_paint_affine_color_near_spots(int da, int sa, int fa, int fb, int dn, int sn, int alpha, const fz_overprint * restrict eop) { #if FZ_PLOTTERS_N + if (eop != NULL) + return paint_affine_color_near_N_op; return da ? paint_affine_color_near_da_N : paint_affine_color_near_N; #else return NULL; @@ -3374,7 +3729,7 @@ fz_gridfit_matrix(int as_tiled, fz_matrix *m) /* Draw an image with an affine transform on destination */ static void -fz_paint_image_imp(fz_pixmap * restrict dst, const fz_irect *scissor, const fz_pixmap * restrict shape, const fz_pixmap * restrict img, const fz_matrix * restrict ctm, const byte * restrict color, int alpha, int lerp_allowed, int as_tiled) +fz_paint_image_imp(fz_pixmap * restrict dst, const fz_irect *scissor, const fz_pixmap * restrict shape, const fz_pixmap * restrict img, const fz_matrix * restrict ctm, const byte * restrict color, int alpha, int lerp_allowed, int as_tiled, const fz_overprint * restrict eop) { byte *dp, *sp, *hp; int u, v, fa, fb, fc, fd; @@ -3482,7 +3837,7 @@ fz_paint_image_imp(fz_pixmap * restrict dst, const fz_irect *scissor, const fz_p } #if FZ_PLOTTERS_RGB - if (dn == 3 && img->n == 1 + sa && !color) + if (dn == 3 && img->n == 1 + sa && !color && eop == NULL) { if (dolerp) paintfn = fz_paint_affine_g2rgb_lerp(da, sa, fa, fb, dn, alpha); @@ -3496,16 +3851,16 @@ fz_paint_image_imp(fz_pixmap * restrict dst, const fz_irect *scissor, const fz_p if (dolerp) { if (color) - paintfn = fz_paint_affine_color_lerp_spots(da, sa, fa, fb, dn, sn, alpha); + paintfn = fz_paint_affine_color_lerp_spots(da, sa, fa, fb, dn, sn, alpha, eop); else - paintfn = fz_paint_affine_lerp_spots(da, sa, fa, fb, dn, sn, alpha); + paintfn = fz_paint_affine_lerp_spots(da, sa, fa, fb, dn, sn, alpha, eop); } else { if (color) - paintfn = fz_paint_affine_color_near_spots(da, sa, fa, fb, dn, sn, alpha); + paintfn = fz_paint_affine_color_near_spots(da, sa, fa, fb, dn, sn, alpha, eop); else - paintfn = fz_paint_affine_near_spots(da, sa, fa, fb, dn, sn, alpha); + paintfn = fz_paint_affine_near_spots(da, sa, fa, fb, dn, sn, alpha, eop); } } else @@ -3514,16 +3869,16 @@ fz_paint_image_imp(fz_pixmap * restrict dst, const fz_irect *scissor, const fz_p if (dolerp) { if (color) - paintfn = fz_paint_affine_color_lerp(da, sa, fa, fb, dn, alpha); + paintfn = fz_paint_affine_color_lerp(da, sa, fa, fb, dn, alpha, eop); else - paintfn = fz_paint_affine_lerp(da, sa, fa, fb, dn, alpha); + paintfn = fz_paint_affine_lerp(da, sa, fa, fb, dn, alpha, eop); } else { if (color) - paintfn = fz_paint_affine_color_near(da, sa, fa, fb, dn, alpha); + paintfn = fz_paint_affine_color_near(da, sa, fa, fb, dn, alpha, eop); else - paintfn = fz_paint_affine_near(da, sa, fa, fb, dn, alpha); + paintfn = fz_paint_affine_near(da, sa, fa, fb, dn, alpha, eop); } } @@ -3541,7 +3896,7 @@ fz_paint_image_imp(fz_pixmap * restrict dst, const fz_irect *scissor, const fz_p while (h--) { - paintfn(dp, da, sp, sw, sh, ss, sa, u, v, fa, fb, w, dn, sn, alpha, color, hp); + paintfn(dp, da, sp, sw, sh, ss, sa, u, v, fa, fb, w, dn, sn, alpha, color, hp, eop); dp += dst->stride; hp += hs; u += fc; @@ -3550,14 +3905,14 @@ fz_paint_image_imp(fz_pixmap * restrict dst, const fz_irect *scissor, const fz_p } void -fz_paint_image_with_color(fz_pixmap * restrict dst, const fz_irect * restrict scissor, fz_pixmap * restrict shape, const fz_pixmap * restrict img, const fz_matrix * restrict ctm, const byte * restrict color, int lerp_allowed, int as_tiled) +fz_paint_image_with_color(fz_pixmap * restrict dst, const fz_irect * restrict scissor, fz_pixmap * restrict shape, const fz_pixmap * restrict img, const fz_matrix * restrict ctm, const byte * restrict color, int lerp_allowed, int as_tiled, const fz_overprint * restrict eop) { assert(img->n == 1); - fz_paint_image_imp(dst, scissor, shape, img, ctm, color, 255, lerp_allowed, as_tiled); + fz_paint_image_imp(dst, scissor, shape, img, ctm, color, 255, lerp_allowed, as_tiled, eop); } void -fz_paint_image(fz_pixmap * restrict dst, const fz_irect * restrict scissor, fz_pixmap * restrict shape, const fz_pixmap * restrict img, const fz_matrix * restrict ctm, int alpha, int lerp_allowed, int as_tiled) +fz_paint_image(fz_pixmap * restrict dst, const fz_irect * restrict scissor, fz_pixmap * restrict shape, const fz_pixmap * restrict img, const fz_matrix * restrict ctm, int alpha, int lerp_allowed, int as_tiled, const fz_overprint * restrict eop) { - fz_paint_image_imp(dst, scissor, shape, img, ctm, NULL, alpha, lerp_allowed, as_tiled); + fz_paint_image_imp(dst, scissor, shape, img, ctm, NULL, alpha, lerp_allowed, as_tiled, eop); } diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c index d8f5c911..9ff734ec 100644 --- a/source/fitz/draw-device.c +++ b/source/fitz/draw-device.c @@ -349,7 +349,55 @@ colors_supported(fz_context *ctx, fz_colorspace *cs, fz_pixmap *dest) } static void -resolve_color(fz_context *ctx, const float *color, fz_colorspace *colorspace, float alpha, const fz_color_params *color_params, unsigned char *colorbv, fz_pixmap *dest, fz_colorspace *prf) +set_op_from_spaces(fz_context *ctx, fz_overprint *op, const fz_pixmap *dest, const fz_colorspace *src, int opm) +{ + int dn, sn, i, j, dc; + + if (!op) + return; + + sn = fz_colorspace_n(ctx, src); + dn = dest->n - dest->alpha; + dc = dn - dest->s; + + for (i = 0; i < dc; i++) + { + const char *name = fz_colorspace_colorant(ctx, dest->colorspace, i); + + for (j = 0; j < sn; j++) + { + const char *sname = fz_colorspace_colorant(ctx, src, j); + if (!name || !sname) + continue; + if (!strcmp(name, sname)) + break; + if (!strcmp(sname, "All")) + break; + } + if (j == sn) + fz_set_overprint(op, i); + } + for (i = dc; i < dn; i++) + { + const char *name = fz_separation_name(ctx, dest->seps, i - dc); + + for (j = 0; j < sn; j++) + { + const char *sname = fz_colorspace_colorant(ctx, src, j); + if (!name || !sname) + continue; + if (!strcmp(name, sname)) + break; + if (!strcmp(sname, "All")) + break; + } + if (j == sn) + fz_set_overprint(op, i); + } +} + +static fz_overprint * +resolve_color(fz_context *ctx, fz_overprint *op, const float *color, fz_colorspace *colorspace, float alpha, const fz_color_params *color_params, unsigned char *colorbv, fz_pixmap *dest, fz_colorspace *prf) { float colorfv[FZ_MAX_COLORS]; int i; @@ -362,6 +410,9 @@ resolve_color(fz_context *ctx, const float *color, fz_colorspace *colorspace, fl if (color_params == NULL) color_params = fz_default_color_params(ctx); + if (!color_params || color_params->op == 0 || !fz_colorspace_is_subtractive(ctx, dest->colorspace)) + op = NULL; + if (n == 0) i = 0; else if (fz_colorspace_is_device_n(ctx, colorspace) && colors_supported(ctx, colorspace, dest)) @@ -369,6 +420,7 @@ resolve_color(fz_context *ctx, const float *color, fz_colorspace *colorspace, fl fz_convert_separation_colors(ctx, color_params, dest->colorspace, dest->seps, colorfv, colorspace, color); for (i = 0; i < n; i++) colorbv[i] = colorfv[i] * 255; + set_op_from_spaces(ctx, op, dest, colorspace, color_params->opm); } else { @@ -378,8 +430,25 @@ resolve_color(fz_context *ctx, const float *color, fz_colorspace *colorspace, fl colorbv[i] = colorfv[i] * 255; for (; i < n; i++) colorbv[i] = 0; + } colorbv[i] = alpha * 255; + + /* If we are overprinting, and we're plotting in cmyk and a given + * color component is zero, then protect that component from being + * written to. */ + if (op) + { + if (!fz_colorspace_is_device_n(ctx, colorspace)) + for (i = 4; i < n; i++) + fz_set_overprint(op, i); + if (color_params->opm == 1 && fz_colorspace_n(ctx, colorspace) == 4) + for (i = 0; i < n; i++) + if (colorfv[i] == 0) + fz_set_overprint(op, i); + } + + return op; } static fz_draw_state * @@ -424,6 +493,8 @@ fz_draw_fill_path(fz_context *ctx, fz_device *devp, const fz_path *path, int eve unsigned char colorbv[FZ_MAX_COLORS + 1]; fz_irect bbox; fz_draw_state *state = &dev->stack[dev->top]; + fz_overprint op = { { 0 } }; + fz_overprint *eop; if (dev->top == 0 && dev->resolve_spots) state = push_group_for_separations(ctx, dev, color_params, prf, dev->default_cs); @@ -438,16 +509,16 @@ fz_draw_fill_path(fz_context *ctx, fz_device *devp, const fz_path *path, int eve if (state->blendmode & FZ_BLEND_KNOCKOUT) state = fz_knockout_begin(ctx, dev); - resolve_color(ctx, color, colorspace, alpha, color_params, colorbv, state->dest, prf); + eop = resolve_color(ctx, &op, color, colorspace, alpha, color_params, colorbv, state->dest, prf); - fz_convert_rasterizer(ctx, rast, even_odd, state->dest, colorbv); + fz_convert_rasterizer(ctx, rast, even_odd, state->dest, colorbv, eop); if (state->shape) { if (!rast->fns.reusable) fz_flatten_fill_path(ctx, rast, path, &ctm, flatness, &bbox, NULL); colorbv[0] = alpha * 255; - fz_convert_rasterizer(ctx, rast, even_odd, state->shape, colorbv); + fz_convert_rasterizer(ctx, rast, even_odd, state->shape, colorbv, 0); } if (state->blendmode & FZ_BLEND_KNOCKOUT) @@ -471,6 +542,8 @@ fz_draw_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, const float aa_level = 2.0f/(fz_rasterizer_graphics_aa_level(rast)+2); fz_draw_state *state = &dev->stack[dev->top]; float mlw = fz_rasterizer_graphics_min_line_width(rast); + fz_overprint op = { { 0 } }; + fz_overprint *eop; if (dev->top == 0 && dev->resolve_spots) state = push_group_for_separations(ctx, dev, color_params, prf, dev->default_cs); @@ -489,7 +562,7 @@ fz_draw_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, const if (state->blendmode & FZ_BLEND_KNOCKOUT) state = fz_knockout_begin(ctx, dev); - resolve_color(ctx, color, colorspace, alpha, color_params, colorbv, state->dest, prf); + eop = resolve_color(ctx, &op, color, colorspace, alpha, color_params, colorbv, state->dest, prf); #ifdef DUMP_GROUP_BLENDS dump_spaces(dev->top, ""); @@ -498,14 +571,14 @@ fz_draw_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, const fz_dump_blend(ctx, "/", state->shape); printf("\n"); #endif - fz_convert_rasterizer(ctx, rast, 0, state->dest, colorbv); + fz_convert_rasterizer(ctx, rast, 0, state->dest, colorbv, eop); if (state->shape) { if (!rast->fns.reusable) (void)fz_flatten_stroke_path(ctx, rast, path, stroke, &ctm, flatness, linewidth, &bbox, NULL); colorbv[0] = 255; - fz_convert_rasterizer(ctx, rast, 0, state->shape, colorbv); + fz_convert_rasterizer(ctx, rast, 0, state->shape, colorbv, 0); } #ifdef DUMP_GROUP_BLENDS dump_spaces(dev->top, ""); @@ -574,7 +647,7 @@ fz_draw_clip_path(fz_context *ctx, fz_device *devp, const fz_path *path, int eve fz_clear_pixmap(ctx, state[1].shape); } - fz_convert_rasterizer(ctx, rast, even_odd, state[1].mask, NULL); + fz_convert_rasterizer(ctx, rast, even_odd, state[1].mask, NULL, 0); state[1].scissor = bbox; #ifdef DUMP_GROUP_BLENDS @@ -656,7 +729,7 @@ fz_draw_clip_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, fz_clear_pixmap(ctx, state[1].shape); } - fz_convert_rasterizer(ctx, rast, 0, state[1].mask, NULL); + fz_convert_rasterizer(ctx, rast, 0, state[1].mask, NULL, 0); state[1].blendmode |= FZ_BLEND_ISOLATED; state[1].scissor = bbox; @@ -672,7 +745,7 @@ fz_draw_clip_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, static void draw_glyph(unsigned char *colorbv, fz_pixmap *dst, fz_glyph *glyph, - int xorig, int yorig, const fz_irect *scissor) + int xorig, int yorig, const fz_irect *scissor, fz_overprint *eop) { unsigned char *dp; fz_irect bbox, bbox2; @@ -699,7 +772,7 @@ draw_glyph(unsigned char *colorbv, fz_pixmap *dst, fz_glyph *glyph, dp = dst->samples + (unsigned int)((y - dst->y) * dst->stride + (x - dst->x) * dst->n); if (msk == NULL) { - fz_paint_glyph(colorbv, dst, dp, glyph, w, h, skip_x, skip_y); + fz_paint_glyph(colorbv, dst, dp, glyph, w, h, skip_x, skip_y, eop); } else { @@ -710,13 +783,13 @@ draw_glyph(unsigned char *colorbv, fz_pixmap *dst, fz_glyph *glyph, { fz_span_color_painter_t *fn; - fn = fz_get_span_color_painter(dst->n, da, colorbv); + fn = fz_get_span_color_painter(dst->n, da, colorbv, eop); assert(fn); if (fn == NULL) return; while (h--) { - (*fn)(dp, mp, dst->n, w, colorbv, da); + (*fn)(dp, mp, dst->n, w, colorbv, da, eop); dp += dst->stride; mp += msk->stride; } @@ -725,13 +798,13 @@ draw_glyph(unsigned char *colorbv, fz_pixmap *dst, fz_glyph *glyph, { fz_span_painter_t *fn; - fn = fz_get_span_painter(da, 1, 0, 255); + fn = fz_get_span_painter(da, 1, 0, 255, eop); assert(fn); if (fn == NULL) return; while (h--) { - (*fn)(dp, da, mp, 1, 0, w, 255); + (*fn)(dp, da, mp, 1, 0, w, 255, eop); dp += dst->stride; mp += msk->stride; } @@ -754,6 +827,8 @@ fz_draw_fill_text(fz_context *ctx, fz_device *devp, const fz_text *text, const f fz_colorspace *colorspace = NULL; fz_colorspace *prf = fz_proof_cs(ctx, dev); fz_rasterizer *rast = dev->rast; + fz_overprint op = { { 0 } }; + fz_overprint *eop; if (dev->top == 0 && dev->resolve_spots) state = push_group_for_separations(ctx, dev, color_params, prf, dev->default_cs); @@ -770,7 +845,7 @@ fz_draw_fill_text(fz_context *ctx, fz_device *devp, const fz_text *text, const f if (state->blendmode & FZ_BLEND_KNOCKOUT) state = fz_knockout_begin(ctx, dev); - resolve_color(ctx, color, colorspace, alpha, color_params, colorbv, state->dest, prf); + eop = resolve_color(ctx, &op, color, colorspace, alpha, color_params, colorbv, state->dest, prf); shapebv = 255; for (span = text->head; span; span = span->next) @@ -799,16 +874,16 @@ fz_draw_fill_text(fz_context *ctx, fz_device *devp, const fz_text *text, const f int y = floorf(trm.f); if (pixmap == NULL || pixmap->n == 1) { - draw_glyph(colorbv, state->dest, glyph, x, y, &state->scissor); + draw_glyph(colorbv, state->dest, glyph, x, y, &state->scissor, eop); if (state->shape) - draw_glyph(&shapebv, state->shape, glyph, x, y, &state->scissor); + draw_glyph(&shapebv, state->shape, glyph, x, y, &state->scissor, 0); } else { fz_matrix mat; mat.a = pixmap->w; mat.b = mat.c = 0; mat.d = pixmap->h; mat.e = x + pixmap->x; mat.f = y + pixmap->y; - fz_paint_image(state->dest, &state->scissor, state->shape, pixmap, &mat, alpha * 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES), devp->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED); + fz_paint_image(state->dest, &state->scissor, state->shape, pixmap, &mat, alpha * 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES), devp->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED, eop); } fz_drop_glyph(ctx, glyph); } @@ -845,6 +920,8 @@ fz_draw_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, const fz_colorspace *colorspace = NULL; fz_colorspace *prf = fz_proof_cs(ctx, dev); int aa = fz_rasterizer_text_aa_level(dev->rast); + fz_overprint op = { { 0 } }; + fz_overprint *eop; if (dev->top == 0 && dev->resolve_spots) state = push_group_for_separations(ctx, dev, color_params, prf, dev->default_cs); @@ -855,7 +932,7 @@ fz_draw_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, const if (state->blendmode & FZ_BLEND_KNOCKOUT) state = fz_knockout_begin(ctx, dev); - resolve_color(ctx, color, colorspace, alpha, color_params, colorbv, state->dest, prf); + eop = resolve_color(ctx, &op, color, colorspace, alpha, color_params, colorbv, state->dest, prf); for (span = text->head; span; span = span->next) { @@ -880,9 +957,9 @@ fz_draw_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, const { int x = (int)trm.e; int y = (int)trm.f; - draw_glyph(colorbv, state->dest, glyph, x, y, &state->scissor); + draw_glyph(colorbv, state->dest, glyph, x, y, &state->scissor, eop); if (state->shape) - draw_glyph(colorbv, state->shape, glyph, x, y, &state->scissor); + draw_glyph(colorbv, state->shape, glyph, x, y, &state->scissor, 0); fz_drop_glyph(ctx, glyph); } else @@ -990,9 +1067,9 @@ fz_draw_clip_text(fz_context *ctx, fz_device *devp, const fz_text *text, const f { int x = (int)trm.e; int y = (int)trm.f; - draw_glyph(NULL, mask, glyph, x, y, &bbox); + draw_glyph(NULL, mask, glyph, x, y, &bbox, 0); if (state[1].shape) - draw_glyph(NULL, state[1].shape, glyph, x, y, &bbox); + draw_glyph(NULL, state[1].shape, glyph, x, y, &bbox, 0); fz_drop_glyph(ctx, glyph); } else @@ -1116,9 +1193,9 @@ fz_draw_clip_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, { int x = (int)trm.e; int y = (int)trm.f; - draw_glyph(NULL, mask, glyph, x, y, &bbox); + draw_glyph(NULL, mask, glyph, x, y, &bbox, 0); if (shape) - draw_glyph(NULL, shape, glyph, x, y, &bbox); + draw_glyph(NULL, shape, glyph, x, y, &bbox, 0); fz_drop_glyph(ctx, glyph); } else @@ -1179,6 +1256,8 @@ fz_draw_fill_shade(fz_context *ctx, fz_device *devp, fz_shade *shade, const fz_m unsigned char colorbv[FZ_MAX_COLORS + 1]; fz_draw_state *state = &dev->stack[dev->top]; fz_colorspace *prf = fz_proof_cs(ctx, dev); + fz_overprint op = { { 0 } }; + fz_overprint *eop; if (dev->top == 0 && dev->resolve_spots) state = push_group_for_separations(ctx, dev, color_params, prf, dev->default_cs); @@ -1218,7 +1297,7 @@ fz_draw_fill_shade(fz_context *ctx, fz_device *devp, fz_shade *shade, const fz_m unsigned char *s; int x, y, n, i; - resolve_color(ctx, shade->background, fz_default_colorspace(ctx, dev->default_cs, shade->colorspace), alpha, color_params, colorbv, state->dest, prf); + eop = resolve_color(ctx, &op, shade->background, fz_default_colorspace(ctx, dev->default_cs, shade->colorspace), alpha, color_params, colorbv, state->dest, prf); n = dest->n; for (y = scissor.y0; y < scissor.y1; y++) @@ -1257,6 +1336,7 @@ fz_draw_fill_shade(fz_context *ctx, fz_device *devp, fz_shade *shade, const fz_m if (alpha < 1) { + /* FIXME: eop */ fz_paint_pixmap(state->dest, dest, alpha * 255); fz_drop_pixmap(ctx, dest); if (shape) @@ -1349,6 +1429,8 @@ fz_draw_fill_image(fz_context *ctx, fz_device *devp, fz_image *image, const fz_m fz_irect src_area; fz_colorspace *src_cs; fz_colorspace *prf = fz_proof_cs(ctx, dev); + fz_overprint op = { { 0 } }; + fz_overprint *eop = &op; if (alpha == 0) return; @@ -1363,6 +1445,9 @@ fz_draw_fill_image(fz_context *ctx, fz_device *devp, fz_image *image, const fz_m if (image->w == 0 || image->h == 0) return; + if (!color_params || color_params->op == 0) + eop = NULL; + /* ctm maps the image (expressed as the unit square) onto the * destination device. Reverse that to get a mapping from * the destination device to the source pixels. */ @@ -1417,6 +1502,10 @@ fz_draw_fill_image(fz_context *ctx, fz_device *devp, fz_image *image, const fz_m after = 0; if (src_cs == fz_device_gray(ctx)) after = 1; + else if (fz_colorspace_is_indexed(ctx, src_cs)) + {} + else if (fz_colorspace_n(ctx, src_cs) <= fz_colorspace_n(ctx, model)) + after = 1; if (conversion_required && !after) { @@ -1424,7 +1513,10 @@ fz_draw_fill_image(fz_context *ctx, fz_device *devp, fz_image *image, const fz_m /* If we have a spotty image, and we are going to spotty output, * then we can't lose the spots during color conversion. */ if (fz_colorspace_is_device_n(ctx, src_cs) && state->dest->seps) + { converted = fz_clone_pixmap_area_with_different_seps(ctx, pixmap, NULL, model, state->dest->seps, color_params, prf, dev->default_cs); + set_op_from_spaces(ctx, eop, state->dest, src_cs, color_params->opm); + } else converted = fz_convert_pixmap(ctx, pixmap, model, prf, dev->default_cs, color_params, 1); fz_drop_pixmap(ctx, pixmap); @@ -1464,15 +1556,27 @@ fz_draw_fill_image(fz_context *ctx, fz_device *devp, fz_image *image, const fz_m { fz_pixmap *converted; if (fz_colorspace_is_device_n(ctx, src_cs) && state->dest->seps) + { converted = fz_clone_pixmap_area_with_different_seps(ctx, pixmap, NULL, model, state->dest->seps, color_params, prf, dev->default_cs); + set_op_from_spaces(ctx, eop, state->dest, src_cs, color_params->opm); + } else + { converted = fz_convert_pixmap(ctx, pixmap, model, prf, dev->default_cs, color_params, 1); + if (eop && !fz_colorspace_is_device_n(ctx, pixmap->colorspace) && fz_colorspace_n(ctx, model) == 4) + { + int i; + int n = state->dest->n - state->dest->alpha; + for (i = 4; i < n; i++) + fz_set_overprint(eop, i); + } + } fz_drop_pixmap(ctx, pixmap); pixmap = converted; } } - fz_paint_image(state->dest, &state->scissor, state->shape, pixmap, &local_ctm, alpha * 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES), devp->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED); + fz_paint_image(state->dest, &state->scissor, state->shape, pixmap, &local_ctm, alpha * 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES), devp->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED, eop); if (state->blendmode & FZ_BLEND_KNOCKOUT) fz_knockout_end(ctx, dev); @@ -1499,6 +1603,8 @@ fz_draw_fill_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const fz_irect src_area; fz_colorspace *colorspace = NULL; fz_colorspace *prf = fz_proof_cs(ctx, dev); + fz_overprint op = { { 0 } }; + fz_overprint *eop; if (alpha == 0) return; @@ -1578,9 +1684,9 @@ fz_draw_fill_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const } } - resolve_color(ctx, color, colorspace, alpha, color_params, colorbv, state->dest, prf); + eop = resolve_color(ctx, &op, color, colorspace, alpha, color_params, colorbv, state->dest, prf); - fz_paint_image_with_color(state->dest, &state->scissor, state->shape, pixmap, &local_ctm, colorbv, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES), devp->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED); + fz_paint_image_with_color(state->dest, &state->scissor, state->shape, pixmap, &local_ctm, colorbv, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES), devp->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED, eop); if (state->blendmode & FZ_BLEND_KNOCKOUT) fz_knockout_end(ctx, dev); @@ -1687,7 +1793,7 @@ fz_draw_clip_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const if (state[1].shape) fz_dump_blend(ctx, "/", state[1].shape); #endif - fz_paint_image(state[1].mask, &bbox, state[1].shape, pixmap, &local_ctm, 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES), devp->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED); + fz_paint_image(state[1].mask, &bbox, state[1].shape, pixmap, &local_ctm, 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES), devp->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED, 0); #ifdef DUMP_GROUP_BLENDS fz_dump_blend(ctx, " to get ", state[1].mask); if (state[1].shape) diff --git a/source/fitz/draw-edge.c b/source/fitz/draw-edge.c index cb3fb84b..8510f216 100644 --- a/source/fitz/draw-edge.c +++ b/source/fitz/draw-edge.c @@ -523,18 +523,18 @@ undelta_aa(fz_context *ctx, unsigned char * restrict out, int * restrict in, int } static inline void -blit_aa(fz_pixmap *dst, int x, int y, unsigned char *mp, int w, unsigned char *color, void *fn) +blit_aa(fz_pixmap *dst, int x, int y, unsigned char *mp, int w, unsigned char *color, void *fn, fz_overprint *eop) { unsigned char *dp; dp = dst->samples + (unsigned int)((y - dst->y) * dst->stride + (x - dst->x) * dst->n); if (color) - (*(fz_span_color_painter_t *)fn)(dp, mp, dst->n, w, color, dst->alpha); + (*(fz_span_color_painter_t *)fn)(dp, mp, dst->n, w, color, dst->alpha, eop); else - (*(fz_span_painter_t *)fn)(dp, dst->alpha, mp, 1, 0, w, 255); + (*(fz_span_painter_t *)fn)(dp, dst->alpha, mp, 1, 0, w, 255, eop); } static void -fz_scan_convert_aa(fz_context *ctx, fz_gel *gel, int eofill, const fz_irect *clip, fz_pixmap *dst, unsigned char *color, void *painter) +fz_scan_convert_aa(fz_context *ctx, fz_gel *gel, int eofill, const fz_irect *clip, fz_pixmap *dst, unsigned char *color, void *painter, fz_overprint *eop) { unsigned char *alphas; int *deltas; @@ -634,7 +634,7 @@ fz_scan_convert_aa(fz_context *ctx, fz_gel *gel, int eofill, const fz_irect *cli if (yc != yd) { undelta_aa(ctx, alphas, deltas, skipx + clipn); - blit_aa(dst, xmin + skipx, yd, alphas + skipx, clipn, color, painter); + blit_aa(dst, xmin + skipx, yd, alphas + skipx, clipn, color, painter, eop); memset(deltas, 0, (skipx + clipn) * sizeof(int)); } yd = yc; @@ -657,7 +657,7 @@ fz_scan_convert_aa(fz_context *ctx, fz_gel *gel, int eofill, const fz_irect *cli else non_zero_winding_aa(ctx, gel, deltas, xofs, rh); undelta_aa(ctx, alphas, deltas, skipx + clipn); - blit_aa(dst, xmin + skipx, yd, alphas + skipx, clipn, color, painter); + blit_aa(dst, xmin + skipx, yd, alphas + skipx, clipn, color, painter, eop); memset(deltas, 0, (skipx + clipn) * sizeof(int)); yd++; if (yd >= clip->y1) @@ -678,7 +678,7 @@ fz_scan_convert_aa(fz_context *ctx, fz_gel *gel, int eofill, const fz_irect *cli { /* Do any successive whole scanlines - no need * to recalculate deltas here. */ - blit_aa(dst, xmin + skipx, yd, alphas + skipx, clipn, color, painter); + blit_aa(dst, xmin + skipx, yd, alphas + skipx, clipn, color, painter, eop); yd++; if (yd >= clip->y1) goto clip_ended; @@ -707,7 +707,7 @@ advance: if (yd < clip->y1) { undelta_aa(ctx, alphas, deltas, skipx + clipn); - blit_aa(dst, xmin + skipx, yd, alphas + skipx, clipn, color, painter); + blit_aa(dst, xmin + skipx, yd, alphas + skipx, clipn, color, painter, eop); } clip_ended: fz_free(ctx, deltas); @@ -719,7 +719,7 @@ clip_ended: */ static inline void -blit_sharp(int x0, int x1, int y, const fz_irect *clip, fz_pixmap *dst, unsigned char *color, fz_solid_color_painter_t *fn) +blit_sharp(int x0, int x1, int y, const fz_irect *clip, fz_pixmap *dst, unsigned char *color, fz_solid_color_painter_t *fn, fz_overprint *eop) { unsigned char *dp; int da = dst->alpha; @@ -729,14 +729,14 @@ blit_sharp(int x0, int x1, int y, const fz_irect *clip, fz_pixmap *dst, unsigned { dp = dst->samples + (unsigned int)((y - dst->y) * dst->stride + (x0 - dst->x) * dst->n); if (color) - (*fn)(dp, dst->n, x1 - x0, color, da); + (*fn)(dp, dst->n, x1 - x0, color, da, eop); else memset(dp, 255, x1-x0); } } static inline void -non_zero_winding_sharp(fz_context *ctx, fz_gel *gel, int y, const fz_irect *clip, fz_pixmap *dst, unsigned char *color, fz_solid_color_painter_t *fn) +non_zero_winding_sharp(fz_context *ctx, fz_gel *gel, int y, const fz_irect *clip, fz_pixmap *dst, unsigned char *color, fz_solid_color_painter_t *fn, fz_overprint *eop) { int winding = 0; int x = 0; @@ -746,13 +746,13 @@ non_zero_winding_sharp(fz_context *ctx, fz_gel *gel, int y, const fz_irect *clip if (!winding && (winding + gel->active[i]->ydir)) x = gel->active[i]->x; if (winding && !(winding + gel->active[i]->ydir)) - blit_sharp(x, gel->active[i]->x, y, clip, dst, color, fn); + blit_sharp(x, gel->active[i]->x, y, clip, dst, color, fn, eop); winding += gel->active[i]->ydir; } } static inline void -even_odd_sharp(fz_context *ctx, fz_gel *gel, int y, const fz_irect *clip, fz_pixmap *dst, unsigned char *color, fz_solid_color_painter_t *fn) +even_odd_sharp(fz_context *ctx, fz_gel *gel, int y, const fz_irect *clip, fz_pixmap *dst, unsigned char *color, fz_solid_color_painter_t *fn, fz_overprint *eop) { int even = 0; int x = 0; @@ -762,7 +762,7 @@ even_odd_sharp(fz_context *ctx, fz_gel *gel, int y, const fz_irect *clip, fz_pix if (!even) x = gel->active[i]->x; else - blit_sharp(x, gel->active[i]->x, y, clip, dst, color, fn); + blit_sharp(x, gel->active[i]->x, y, clip, dst, color, fn, eop); even = !even; } } @@ -770,7 +770,7 @@ even_odd_sharp(fz_context *ctx, fz_gel *gel, int y, const fz_irect *clip, fz_pix static void fz_scan_convert_sharp(fz_context *ctx, fz_gel *gel, int eofill, const fz_irect *clip, - fz_pixmap *dst, unsigned char *color, fz_solid_color_painter_t *fn) + fz_pixmap *dst, unsigned char *color, fz_solid_color_painter_t *fn, fz_overprint *eop) { int e = 0; int y = gel->edges[0].y; @@ -810,9 +810,9 @@ fz_scan_convert_sharp(fz_context *ctx, while (h--) { if (eofill) - even_odd_sharp(ctx, gel, y, clip, dst, color, fn); + even_odd_sharp(ctx, gel, y, clip, dst, color, fn, eop); else - non_zero_winding_sharp(ctx, gel, y, clip, dst, color, fn); + non_zero_winding_sharp(ctx, gel, y, clip, dst, color, fn, eop); y++; } } @@ -824,7 +824,7 @@ fz_scan_convert_sharp(fz_context *ctx, } static void -fz_convert_gel(fz_context *ctx, fz_rasterizer *rast, int eofill, const fz_irect *clip, fz_pixmap *dst, unsigned char *color) +fz_convert_gel(fz_context *ctx, fz_rasterizer *rast, int eofill, const fz_irect *clip, fz_pixmap *dst, unsigned char *color, fz_overprint *eop) { fz_gel *gel = (fz_gel *)rast; @@ -834,21 +834,21 @@ fz_convert_gel(fz_context *ctx, fz_rasterizer *rast, int eofill, const fz_irect { void *fn; if (color) - fn = (void *)fz_get_span_color_painter(dst->n, dst->alpha, color); + fn = (void *)fz_get_span_color_painter(dst->n, dst->alpha, color, eop); else - fn = (void *)fz_get_span_painter(dst->alpha, 1, 0, 255); + fn = (void *)fz_get_span_painter(dst->alpha, 1, 0, 255, eop); assert(fn); if (fn == NULL) return; - fz_scan_convert_aa(ctx, gel, eofill, clip, dst, color, fn); + fz_scan_convert_aa(ctx, gel, eofill, clip, dst, color, fn, eop); } else { - fz_solid_color_painter_t *fn = fz_get_solid_color_painter(dst->n, color, dst->alpha); + fz_solid_color_painter_t *fn = fz_get_solid_color_painter(dst->n, color, dst->alpha, eop); assert(fn); if (fn == NULL) return; - fz_scan_convert_sharp(ctx, gel, eofill, clip, dst, color, (fz_solid_color_painter_t *)fn); + fz_scan_convert_sharp(ctx, gel, eofill, clip, dst, color, (fz_solid_color_painter_t *)fn, eop); } } diff --git a/source/fitz/draw-edgebuffer.c b/source/fitz/draw-edgebuffer.c index 60c28a6d..db2bbe3a 100644 --- a/source/fitz/draw-edgebuffer.c +++ b/source/fitz/draw-edgebuffer.c @@ -1471,7 +1471,7 @@ static int intcmp(const void *a, const void *b) return *((int*)a) - *((int *)b); } -static void fz_convert_edgebuffer(fz_context *ctx, fz_rasterizer *ras, int eofill, const fz_irect *clip, fz_pixmap *pix, unsigned char *color) +static void fz_convert_edgebuffer(fz_context *ctx, fz_rasterizer *ras, int eofill, const fz_irect *clip, fz_pixmap *pix, unsigned char *color, fz_overprint *eop) { fz_edgebuffer *eb = (fz_edgebuffer *)ras; int scanlines = ras->clip.y1 - ras->clip.y0; @@ -1481,7 +1481,7 @@ static void fz_convert_edgebuffer(fz_context *ctx, fz_rasterizer *ras, int eofil uint8_t *out; fz_solid_color_painter_t *fn; - fn = fz_get_solid_color_painter(pix->n, color, pix->alpha); + fn = fz_get_solid_color_painter(pix->n, color, pix->alpha, eop); assert(fn); if (fn == NULL) return; @@ -1609,7 +1609,7 @@ static void fz_convert_edgebuffer(fz_context *ctx, fz_rasterizer *ras, int eofil left = 0; right -= left; if (right > 0) { - (*fn)(out + left*n, n, right, color, a); + (*fn)(out + left*n, n, right, color, a, eop); } } out += pix->stride; @@ -1626,7 +1626,7 @@ static int edgecmp(const void *a, const void *b) return ((int*)a)[1] - ((int*)b)[1]; } -static void fz_convert_edgebuffer_app(fz_context *ctx, fz_rasterizer *ras, int eofill, const fz_irect *clip, fz_pixmap *pix, unsigned char *color) +static void fz_convert_edgebuffer_app(fz_context *ctx, fz_rasterizer *ras, int eofill, const fz_irect *clip, fz_pixmap *pix, unsigned char *color, fz_overprint *eop) { fz_edgebuffer *eb = (fz_edgebuffer *)ras; int scanlines = ras->clip.y1 - ras->clip.y0; @@ -1636,7 +1636,7 @@ static void fz_convert_edgebuffer_app(fz_context *ctx, fz_rasterizer *ras, int e uint8_t *out; fz_solid_color_painter_t *fn; - fn = fz_get_solid_color_painter(pix->n, color, pix->alpha); + fn = fz_get_solid_color_painter(pix->n, color, pix->alpha, eop); assert(fn); if (fn == NULL) return; @@ -1801,7 +1801,7 @@ static void fz_convert_edgebuffer_app(fz_context *ctx, fz_rasterizer *ras, int e left = 0; right -= left; if (right > 0) { - (*fn)(out + left*n, n, right, color, a); + (*fn)(out + left*n, n, right, color, a, eop); } } out += pix->stride; diff --git a/source/fitz/draw-imp.h b/source/fitz/draw-imp.h index 5c6fc7b8..8d1c3ef6 100644 --- a/source/fitz/draw-imp.h +++ b/source/fitz/draw-imp.h @@ -108,6 +108,24 @@ struct fz_aa_context_s float min_line_width; }; +/* Overprint bitmap */ + +typedef struct +{ + /* Bit i set -> never alter this color */ + uint32_t mask[(FZ_MAX_COLORS+31)/32]; +} fz_overprint; + +static void inline fz_set_overprint(fz_overprint *op, int i) +{ + op->mask[i>>5] |= 1<<(i&31); +} + +static int inline fz_overprint_component(const fz_overprint *op, int i) +{ + return ((op->mask[i>>5]>>(i & 31)) & 1) == 0; +} + /* * Scan converter */ @@ -121,7 +139,7 @@ typedef void (fz_rasterizer_insert_fn)(fz_context *ctx, fz_rasterizer *r, float typedef void (fz_rasterizer_insert_rect_fn)(fz_context *ctx, fz_rasterizer *r, float fx0, float fy0, float fx1, float fy1); typedef void (fz_rasterizer_gap_fn)(fz_context *ctx, fz_rasterizer *r); typedef fz_irect *(fz_rasterizer_bound_fn)(fz_context *ctx, const fz_rasterizer *r, fz_irect *bbox); -typedef void (fz_rasterizer_fn)(fz_context *ctx, fz_rasterizer *r, int eofill, const fz_irect *clip, fz_pixmap *pix, unsigned char *colorbv); +typedef void (fz_rasterizer_fn)(fz_context *ctx, fz_rasterizer *r, int eofill, const fz_irect *clip, fz_pixmap *pix, unsigned char *colorbv, fz_overprint *eop); typedef int (fz_rasterizer_is_rect_fn)(fz_context *ctx, fz_rasterizer *r); typedef struct @@ -325,8 +343,10 @@ fz_rect *fz_scissor_rasterizer(fz_context *ctx, const fz_rasterizer *rast, fz_re pix: The pixmap to fill into. colorbv: The color components corresponding to the pixmap. + + eop: effective overprint. */ -void fz_convert_rasterizer(fz_context *ctx, fz_rasterizer *r, int eofill, fz_pixmap *pix, unsigned char *colorbv); +void fz_convert_rasterizer(fz_context *ctx, fz_rasterizer *r, int eofill, fz_pixmap *pix, unsigned char *colorbv, fz_overprint *eop); /* fz_is_rect_rasterizer: Detect if the edges fed into a @@ -411,17 +431,17 @@ fz_irect *fz_bound_path_accurate(fz_context *ctx, fz_irect *bbox, const fz_irect * Plotting functions. */ -typedef void (fz_solid_color_painter_t)(unsigned char * restrict dp, int n, int w, const unsigned char * restrict color, int da); +typedef void (fz_solid_color_painter_t)(unsigned char * restrict dp, int n, int w, const unsigned char * restrict color, int da, const fz_overprint * restrict eop); -typedef void (fz_span_painter_t)(unsigned char * restrict dp, int da, const unsigned char * restrict sp, int sa, int n, int w, int alpha); -typedef void (fz_span_color_painter_t)(unsigned char * restrict dp, const unsigned char * restrict mp, int n, int w, const unsigned char * restrict color, int da); +typedef void (fz_span_painter_t)(unsigned char * restrict dp, int da, const unsigned char * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop); +typedef void (fz_span_color_painter_t)(unsigned char * restrict dp, const unsigned char * restrict mp, int n, int w, const unsigned char * restrict color, int da, const fz_overprint * restrict eop); -fz_solid_color_painter_t *fz_get_solid_color_painter(int n, const unsigned char * restrict color, int da); -fz_span_painter_t *fz_get_span_painter(int da, int sa, int n, int alpha); -fz_span_color_painter_t *fz_get_span_color_painter(int n, int da, const unsigned char * restrict color); +fz_solid_color_painter_t *fz_get_solid_color_painter(int n, const unsigned char * restrict color, int da, const fz_overprint * restrict eop); +fz_span_painter_t *fz_get_span_painter(int da, int sa, int n, int alpha, const fz_overprint * restrict eop); +fz_span_color_painter_t *fz_get_span_color_painter(int n, int da, const unsigned char * restrict color, const fz_overprint * restrict eop); -void fz_paint_image(fz_pixmap * restrict dst, const fz_irect * restrict scissor, fz_pixmap * restrict shape, const fz_pixmap * restrict img, const fz_matrix * restrict ctm, int alpha, int lerp_allowed, int gridfit_as_tiled); -void fz_paint_image_with_color(fz_pixmap * restrict dst, const fz_irect * restrict scissor, fz_pixmap *restrict shape, const fz_pixmap * restrict img, const fz_matrix * restrict ctm, const unsigned char * restrict colorbv, int lerp_allowed, int gridfit_as_tiled); +void fz_paint_image(fz_pixmap * restrict dst, const fz_irect * restrict scissor, fz_pixmap * restrict shape, const fz_pixmap * restrict img, const fz_matrix * restrict ctm, int alpha, int lerp_allowed, int gridfit_as_tiled, const fz_overprint * restrict eop); +void fz_paint_image_with_color(fz_pixmap * restrict dst, const fz_irect * restrict scissor, fz_pixmap *restrict shape, const fz_pixmap * restrict img, const fz_matrix * restrict ctm, const unsigned char * restrict colorbv, int lerp_allowed, int gridfit_as_tiled, const fz_overprint * restrict eop); void fz_paint_pixmap(fz_pixmap * restrict dst, const fz_pixmap * restrict src, int alpha); void fz_paint_pixmap_with_mask(fz_pixmap * restrict dst, const fz_pixmap * restrict src, const fz_pixmap * restrict msk); @@ -429,6 +449,6 @@ void fz_paint_pixmap_with_bbox(fz_pixmap * restrict dst, const fz_pixmap * restr void fz_blend_pixmap(fz_context *ctx, fz_pixmap * restrict dst, fz_pixmap * restrict src, int alpha, int blendmode, int isolated, const fz_pixmap * restrict shape); -void fz_paint_glyph(const unsigned char * restrict colorbv, fz_pixmap * restrict dst, unsigned char * restrict dp, const fz_glyph * restrict glyph, int w, int h, int skip_x, int skip_y); +void fz_paint_glyph(const unsigned char * restrict colorbv, fz_pixmap * restrict dst, unsigned char * restrict dp, const fz_glyph * restrict glyph, int w, int h, int skip_x, int skip_y, const fz_overprint * restrict eop); #endif diff --git a/source/fitz/draw-paint.c b/source/fitz/draw-paint.c index ac3a6629..a12f043a 100644 --- a/source/fitz/draw-paint.c +++ b/source/fitz/draw-paint.c @@ -308,6 +308,31 @@ template_solid_color_N_256(byte * restrict dp, int n, int w, const byte * restri } static inline void +template_solid_color_N_256_op(byte * restrict dp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) +{ + int k; + int n1 = n - da; + do + { + if (fz_overprint_component(eop, 0)) + dp[0] = color[0]; + if (n1 > 1) + if (fz_overprint_component(eop, 1)) + dp[1] = color[1]; + if (n1 > 2) + if (fz_overprint_component(eop, 2)) + dp[2] = color[2]; + for (k = 3; k < n1; k++) + if (fz_overprint_component(eop, k)) + dp[k] = color[k]; + if (da) + dp[n1] = 255; + dp += n; + } + while (--w); +} + +static inline void template_solid_color_N_sa(byte * restrict dp, int n, int w, const byte * restrict color, int da, int sa) { int k; @@ -323,6 +348,23 @@ template_solid_color_N_sa(byte * restrict dp, int n, int w, const byte * restric while (--w); } +static inline void +template_solid_color_N_sa_op(byte * restrict dp, int n, int w, const byte * restrict color, int da, int sa, const fz_overprint * restrict eop) +{ + int k; + int n1 = n - da; + do + { + for (k = 0; k < n1; k++) + if (fz_overprint_component(eop, k)) + dp[k] = FZ_BLEND(color[k], dp[k], sa); + if (da) + dp[k] = FZ_BLEND(255, dp[k], sa); + dp += n; + } + while (--w); +} + #if FZ_PLOTTERS_N static inline void template_solid_color_N_general(byte * restrict dp, int n, int w, const byte * restrict color, int da, int sa) @@ -359,6 +401,47 @@ template_solid_color_N_general(byte * restrict dp, int n, int w, const byte * re while (--w); } } + +static inline void +template_solid_color_N_general_op(byte * restrict dp, int n, int w, const byte * restrict color, int da, int sa, const fz_overprint * restrict eop) +{ + int k; + int n1 = n - da; + if (sa == 256) + { + do + { + if (fz_overprint_component(eop, 0)) + dp[0] = color[0]; + if (n1 > 1) + if (fz_overprint_component(eop, 1)) + dp[1] = color[1]; + if (n1 > 2) + if (fz_overprint_component(eop, 2)) + dp[2] = color[2]; + for (k = 3; k < n1; k++) + if (fz_overprint_component(eop, k)) + dp[k] = color[k]; + if (da) + dp[n1] = 255; + dp += n; + } + while (--w); + } + else + { + do + { + for (k = 0; k < n1; k++) + if (fz_overprint_component(eop, k)) + dp[k] = FZ_BLEND(color[k], dp[k], sa); + if (da) + dp[k] = FZ_BLEND(255, dp[k], sa); + dp += n; + } + while (--w); + } +} #endif static inline void @@ -380,45 +463,45 @@ template_solid_color_0_da(byte * restrict dp, int w, int sa) } #if FZ_PLOTTERS_G -static void paint_solid_color_1_alpha(byte * restrict dp, int n, int w, const byte * restrict color, int da) +static void paint_solid_color_1_alpha(byte * restrict dp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_solid_color_N_sa(dp, 1, w, color, 0, FZ_EXPAND(color[1])); } -static void paint_solid_color_1(byte * restrict dp, int n, int w, const byte * restrict color, int da) +static void paint_solid_color_1(byte * restrict dp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_solid_color_N_256(dp, 1, w, color, 0); } -static void paint_solid_color_1_da(byte * restrict dp, int n, int w, const byte * restrict color, int da) +static void paint_solid_color_1_da(byte * restrict dp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_solid_color_1_da(dp, 2, w, color, 1); } #endif /* FZ_PLOTTERS_G */ -static void paint_solid_color_0_da(byte * restrict dp, int n, int w, const byte * restrict color, int da) +static void paint_solid_color_0_da(byte * restrict dp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_solid_color_0_da(dp, w, 256); } #if FZ_PLOTTERS_RGB -static void paint_solid_color_3_alpha(byte * restrict dp, int n, int w, const byte * restrict color, int da) +static void paint_solid_color_3_alpha(byte * restrict dp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_solid_color_N_sa(dp, 3, w, color, 0, FZ_EXPAND(color[3])); } -static void paint_solid_color_3(byte * restrict dp, int n, int w, const byte * restrict color, int da) +static void paint_solid_color_3(byte * restrict dp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_solid_color_N_256(dp, 3, w, color, 0); } -static void paint_solid_color_3_da(byte * restrict dp, int n, int w, const byte * restrict color, int da) +static void paint_solid_color_3_da(byte * restrict dp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_solid_color_3_da(dp, 4, w, color, 1); @@ -426,19 +509,19 @@ static void paint_solid_color_3_da(byte * restrict dp, int n, int w, const byte #endif /* FZ_PLOTTERS_RGB */ #if FZ_PLOTTERS_CMYK -static void paint_solid_color_4_alpha(byte * restrict dp, int n, int w, const byte * restrict color, int da) +static void paint_solid_color_4_alpha(byte * restrict dp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_solid_color_N_sa(dp, 4, w, color, 0, FZ_EXPAND(color[4])); } -static void paint_solid_color_4(byte * restrict dp, int n, int w, const byte * restrict color, int da) +static void paint_solid_color_4(byte * restrict dp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_solid_color_N_256(dp, 4, w, color, 0); } -static void paint_solid_color_4_da(byte * restrict dp, int n, int w, const byte * restrict color, int da) +static void paint_solid_color_4_da(byte * restrict dp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_solid_color_4_da(dp, 5, w, color, 1); @@ -446,28 +529,55 @@ static void paint_solid_color_4_da(byte * restrict dp, int n, int w, const byte #endif /* FZ_PLOTTERS_CMYK */ #if FZ_PLOTTERS_N -static void paint_solid_color_N_alpha(byte * restrict dp, int n, int w, const byte * restrict color, int da) +static void paint_solid_color_N_alpha(byte * restrict dp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_solid_color_N_sa(dp, n, w, color, 0, FZ_EXPAND(color[n])); } -static void paint_solid_color_N(byte * restrict dp, int n, int w, const byte * restrict color, int da) +static void paint_solid_color_N(byte * restrict dp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_solid_color_N_256(dp, n, w, color, 0); } -static void paint_solid_color_N_da(byte * restrict dp, int n, int w, const byte * restrict color, int da) +static void paint_solid_color_N_da(byte * restrict dp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_solid_color_N_general(dp, n, w, color, 1, FZ_EXPAND(color[n-1])); } + +static void paint_solid_color_N_alpha_op(byte * restrict dp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) +{ + TRACK_FN(); + template_solid_color_N_sa_op(dp, n, w, color, 0, FZ_EXPAND(color[n]), eop); +} + +static void paint_solid_color_N_op(byte * restrict dp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) +{ + TRACK_FN(); + template_solid_color_N_256_op(dp, n, w, color, 0, eop); +} + +static void paint_solid_color_N_da_op(byte * restrict dp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) +{ + TRACK_FN(); + template_solid_color_N_general_op(dp, n, w, color, 1, FZ_EXPAND(color[n-1]), eop); +} #endif /* FZ_PLOTTERS_N */ fz_solid_color_painter_t * -fz_get_solid_color_painter(int n, const byte * restrict color, int da) +fz_get_solid_color_painter(int n, const byte * restrict color, int da, const fz_overprint * restrict eop) { + if (eop != NULL) + { + if (da) + return paint_solid_color_N_da_op; + else if (color[n] == 255) + return paint_solid_color_N_op; + else + return paint_solid_color_N_alpha_op; + } switch (n-da) { case 0: @@ -749,22 +859,85 @@ template_span_with_color_N_general(byte * restrict dp, const byte * restrict mp, } } +static inline void +template_span_with_color_N_general_op(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) +{ + int k; + int n1 = n - da; + int sa = FZ_EXPAND(color[n1]); + if (sa == 0) + return; + if (sa == 256) + { + do + { + int ma = *mp++; + ma = FZ_EXPAND(ma); + if (ma == 0) + { + } + else if (ma == 256) + { + if (n1 > 0) + if (fz_overprint_component(eop, 0)) + dp[0] = color[0]; + if (n1 > 1) + if (fz_overprint_component(eop, 1)) + dp[1] = color[1]; + if (n1 > 2) + if (fz_overprint_component(eop, 2)) + dp[2] = color[2]; + for (k = 3; k < n1; k++) + if (fz_overprint_component(eop, k)) + dp[k] = color[k]; + if (da) + dp[n1] = 255; + } + else + { + for (k = 0; k < n1; k++) + if (fz_overprint_component(eop, k)) + dp[k] = FZ_BLEND(color[k], dp[k], ma); + if (da) + dp[n1] = FZ_BLEND(255, dp[k], ma); + } + dp += n; + } + while (--w); + } + else + { + do + { + int ma = *mp++; + ma = FZ_COMBINE(FZ_EXPAND(ma), sa); + for (k = 0; k < n1; k++) + if (fz_overprint_component(eop, k)) + dp[k] = FZ_BLEND(color[k], dp[k], ma); + if (da) + dp[k] = FZ_BLEND(255, dp[k], ma); + dp += n; + } + while (--w); + } +} + static void -paint_span_with_color_0_da(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da) +paint_span_with_color_0_da(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_color_N_general(dp, mp, 1, w, color, 1); } static void -paint_span_with_color_1(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da) +paint_span_with_color_1(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_color_N_general(dp, mp, 1, w, color, 0); } static void -paint_span_with_color_1_da(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da) +paint_span_with_color_1_da(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_color_1_da(dp, mp, 2, w, color, 1); @@ -772,14 +945,14 @@ paint_span_with_color_1_da(byte * restrict dp, const byte * restrict mp, int n, #if FZ_PLOTTERS_RGB static void -paint_span_with_color_3(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da) +paint_span_with_color_3(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_color_N_general(dp, mp, 3, w, color, 0); } static void -paint_span_with_color_3_da(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da) +paint_span_with_color_3_da(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_color_3_da(dp, mp, 4, w, color, 1); @@ -788,14 +961,14 @@ paint_span_with_color_3_da(byte * restrict dp, const byte * restrict mp, int n, #if FZ_PLOTTERS_CMYK static void -paint_span_with_color_4(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da) +paint_span_with_color_4(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_color_N_general(dp, mp, 4, w, color, 0); } static void -paint_span_with_color_4_da(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da) +paint_span_with_color_4_da(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_color_4_da(dp, mp, 5, w, color, 1); @@ -804,23 +977,41 @@ paint_span_with_color_4_da(byte * restrict dp, const byte * restrict mp, int n, #if FZ_PLOTTERS_N static void -paint_span_with_color_N(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da) +paint_span_with_color_N(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_color_N_general(dp, mp, n, w, color, 0); } static void -paint_span_with_color_N_da(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da) +paint_span_with_color_N_da(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_color_N_general(dp, mp, n, w, color, 1); } + +static void +paint_span_with_color_N_op(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) +{ + TRACK_FN(); + template_span_with_color_N_general_op(dp, mp, n, w, color, 0, eop); +} + +static void +paint_span_with_color_N_da_op(byte * restrict dp, const byte * restrict mp, int n, int w, const byte * restrict color, int da, const fz_overprint * restrict eop) +{ + TRACK_FN(); + template_span_with_color_N_general_op(dp, mp, n, w, color, 1, eop); +} #endif /* FZ_PLOTTERS_N */ fz_span_color_painter_t * -fz_get_span_color_painter(int n, int da, const byte * restrict color) +fz_get_span_color_painter(int n, int da, const byte * restrict color, const fz_overprint * restrict eop) { + if (eop != NULL) + { + return da ? paint_span_with_color_N_da_op : paint_span_with_color_N_op; + } switch(n-da) { case 0: return da ? paint_span_with_color_0_da : NULL; @@ -1012,16 +1203,21 @@ template_span_with_mask_N_general(byte * restrict dp, const byte * restrict sp, } else if (ma == 256) { - int k = n+a; - while (k--) - { + int k; + for (k = 0; k < n; k++) + *dp++ = *sp++; + if (a) *dp++ = *sp++; - } } else { - int k = n+a; - while (k--) + int k; + for (k = 0; k < n; k++) + { + *dp = FZ_BLEND(*sp, *dp, ma); + sp++; dp++; + } + if (a) { *dp = FZ_BLEND(*sp, *dp, ma); sp++; dp++; @@ -1032,21 +1228,21 @@ template_span_with_mask_N_general(byte * restrict dp, const byte * restrict sp, } static void -paint_span_with_mask_0_a(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a) +paint_span_with_mask_0_a(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_mask_N_general(dp, sp, 1, mp, 0, w); } static void -paint_span_with_mask_1_a(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a) +paint_span_with_mask_1_a(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_mask_1_general(dp, sp, 1, mp, w); } static void -paint_span_with_mask_1(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a) +paint_span_with_mask_1(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_mask_1_general(dp, sp, 0, mp, w); @@ -1054,14 +1250,14 @@ paint_span_with_mask_1(byte * restrict dp, const byte * restrict sp, const byte #if FZ_PLOTTERS_RGB static void -paint_span_with_mask_3_a(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a) +paint_span_with_mask_3_a(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_mask_3_general(dp, sp, 1, mp, w); } static void -paint_span_with_mask_3(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a) +paint_span_with_mask_3(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_mask_3_general(dp, sp, 0, mp, w); @@ -1070,14 +1266,14 @@ paint_span_with_mask_3(byte * restrict dp, const byte * restrict sp, const byte #if FZ_PLOTTERS_CMYK static void -paint_span_with_mask_4_a(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a) +paint_span_with_mask_4_a(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_mask_4_general(dp, sp, 1, mp, w); } static void -paint_span_with_mask_4(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a) +paint_span_with_mask_4(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_mask_4_general(dp, sp, 0, mp, w); @@ -1086,21 +1282,21 @@ paint_span_with_mask_4(byte * restrict dp, const byte * restrict sp, const byte #if FZ_PLOTTERS_N static void -paint_span_with_mask_N_a(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a) +paint_span_with_mask_N_a(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_mask_N_general(dp, sp, 1, mp, n, w); } static void -paint_span_with_mask_N(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a) +paint_span_with_mask_N(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a, const fz_overprint * restrict eop) { TRACK_FN(); template_span_with_mask_N_general(dp, sp, 0, mp, n, w); } #endif /* FZ_PLOTTERS_N */ -typedef void (fz_span_mask_painter_t)(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a); +typedef void (fz_span_mask_painter_t)(byte * restrict dp, const byte * restrict sp, const byte * restrict mp, int w, int n, int a, const fz_overprint * restrict eop); static fz_span_mask_painter_t * fz_get_span_mask_painter(int a, int n) @@ -1227,10 +1423,37 @@ template_span_N_with_alpha_general(byte * restrict dp, int da, const byte * rest do { int masa = (sa ? FZ_COMBINE(sp[n1], alpha) : alpha); - int k = n1; - while (k--) + int k; + for (k = 0; k < n1; k++) { - *dp = FZ_BLEND(*sp++, *dp, masa); + *dp = FZ_BLEND(*sp, *dp, masa); + sp++; dp++; + } + if (da) + { + *dp = FZ_BLEND((sa ? *sp : 255), *dp, masa); + dp++; + } + if (sa) + sp++; + } + while (--w); +} + +static inline void +template_span_N_with_alpha_general_op(byte * restrict dp, int da, const byte * restrict sp, int sa, int n1, int w, int alpha, const fz_overprint * restrict eop) +{ + if (sa) + alpha = FZ_EXPAND(alpha); + do + { + int masa = (sa ? FZ_COMBINE(sp[n1], alpha) : alpha); + int k; + for (k = 0; k < n1; k++) + { + if (fz_overprint_component(eop, k)) + *dp = FZ_BLEND(*sp, *dp, masa); + sp++; dp++; } if (da) @@ -1270,7 +1493,8 @@ template_span_1_general(byte * restrict dp, int da, const byte * restrict sp, in } else { - *dp = *sp++ + FZ_COMBINE(*dp, t); + *dp = *sp + FZ_COMBINE(*dp, t); + sp++; dp++; if (da) { @@ -1395,10 +1619,58 @@ template_span_N_general(byte * restrict dp, int da, const byte * restrict sp, in t = 256 - t; if (t == 0) { - int k = n1; - while (k--) - { + int k; + for (k = 0; k < n1; k++) *dp++ = *sp++; + if (da) + *dp++ = (sa ? *sp : 255); + if (sa) + sp++; + } + else + { + int k; + for (k = 0; k < n1; k++) + { + *dp = *sp + FZ_COMBINE(*dp, t); + sp++; + dp++; + } + if (da) + { + *dp = (sa ? *sp + FZ_COMBINE(*dp, t) : 255); + dp++; + } + if (sa) + sp++; + } + } + } + while (--w); +} + +static inline void +template_span_N_general_op(byte * restrict dp, int da, const byte * restrict sp, int sa, int n1, int w, const fz_overprint * restrict eop) +{ + do + { + int t = (sa ? FZ_EXPAND(sp[n1]) : 256); + if (t == 0) + { + dp += n1 + da; sp += n1 + sa; + } + else + { + t = 256 - t; + if (t == 0) + { + int k; + for (k = 0; k < n1; k++) + { + if (fz_overprint_component(eop, k)) + *dp = *sp; + dp++; + sp++; } if (da) *dp++ = (sa ? *sp : 255); @@ -1407,10 +1679,12 @@ template_span_N_general(byte * restrict dp, int da, const byte * restrict sp, in } else { - int k = n1; - while (k--) + int k; + for (k = 0; k < n1; k++) { - *dp = *sp++ + FZ_COMBINE(*dp, t); + if (fz_overprint_component(eop, k)) + *dp = *sp + FZ_COMBINE(*dp, t); + sp++; dp++; } if (da) @@ -1428,7 +1702,7 @@ template_span_N_general(byte * restrict dp, int da, const byte * restrict sp, in #endif static void -paint_span_0_da_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_0_da_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); do @@ -1442,7 +1716,7 @@ paint_span_0_da_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, } static void -paint_span_0_da_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_0_da_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); alpha = FZ_EXPAND(alpha); @@ -1457,28 +1731,28 @@ paint_span_0_da_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, i } static void -paint_span_1_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_1_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_1_general(dp, 0, sp, 1, w); } static void -paint_span_1_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_1_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_1_with_alpha_general(dp, 0, sp, 1, w, alpha); } static void -paint_span_1_da_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_1_da_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_1_general(dp, 1, sp, 1, w); } static void -paint_span_1_da_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_1_da_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_1_with_alpha_general(dp, 1, sp, 1, w, alpha); @@ -1486,28 +1760,28 @@ paint_span_1_da_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, i #if FZ_PLOTTERS_G static void -paint_span_1_da(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_1_da(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_1_general(dp, 1, sp, 0, w); } static void -paint_span_1_da_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_1_da_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_1_with_alpha_general(dp, 1, sp, 0, w, alpha); } static void -paint_span_1(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_1(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_1_general(dp, 0, sp, 0, w); } static void -paint_span_1_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_1_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_1_with_alpha_general(dp, 0, sp, 0, w, alpha); @@ -1516,56 +1790,56 @@ paint_span_1_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, #if FZ_PLOTTERS_RGB static void -paint_span_3_da_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_3_da_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_3_general(dp, 1, sp, 1, w); } static void -paint_span_3_da_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_3_da_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_3_with_alpha_general(dp, 1, sp, 1, w, alpha); } static void -paint_span_3_da(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_3_da(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_3_general(dp, 1, sp, 0, w); } static void -paint_span_3_da_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_3_da_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_3_with_alpha_general(dp, 1, sp, 0, w, alpha); } static void -paint_span_3_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_3_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_3_general(dp, 0, sp, 1, w); } static void -paint_span_3_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_3_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_3_with_alpha_general(dp, 0, sp, 1, w, alpha); } static void -paint_span_3(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_3(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_3_general(dp, 0, sp, 0, w); } static void -paint_span_3_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_3_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_3_with_alpha_general(dp, 0, sp, 0, w, alpha); @@ -1574,56 +1848,56 @@ paint_span_3_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, #if FZ_PLOTTERS_CMYK static void -paint_span_4_da_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_4_da_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_4_general(dp, 1, sp, 1, w); } static void -paint_span_4_da_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_4_da_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_4_with_alpha_general(dp, 1, sp, 1, w, alpha); } static void -paint_span_4_da(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_4_da(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_4_general(dp, 1, sp, 0, w); } static void -paint_span_4_da_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_4_da_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_4_with_alpha_general(dp, 1, sp, 0, w, alpha); } static void -paint_span_4_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_4_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_4_general(dp, 0, sp, 1, w); } static void -paint_span_4_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_4_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_4_with_alpha_general(dp, 0, sp, 1, w, alpha); } static void -paint_span_4(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_4(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_4_general(dp, 0, sp, 0, w); } static void -paint_span_4_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_4_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_4_with_alpha_general(dp, 0, sp, 0, w, alpha); @@ -1632,65 +1906,88 @@ paint_span_4_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, #if FZ_PLOTTERS_N static void -paint_span_N_da_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_N_da_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_N_general(dp, 1, sp, 1, n, w); } static void -paint_span_N_da_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_N_da_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_N_with_alpha_general(dp, 1, sp, 1, n, w, alpha); } static void -paint_span_N_da(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_N_da(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_N_general(dp, 1, sp, 0, n, w); } static void -paint_span_N_da_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_N_da_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_N_with_alpha_general(dp, 1, sp, 0, n, w, alpha); } static void -paint_span_N_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_N_sa(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_N_general(dp, 0, sp, 1, n, w); } static void -paint_span_N_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_N_sa_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_N_with_alpha_general(dp, 0, sp, 1, n, w, alpha); } static void -paint_span_N(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_N(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_N_general(dp, 0, sp, 0, n, w); } static void -paint_span_N_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha) +paint_span_N_alpha(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) { TRACK_FN(); template_span_N_with_alpha_general(dp, 0, sp, 0, n, w, alpha); } + +static void +paint_span_N_general_op(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) +{ + TRACK_FN(); + template_span_N_general_op(dp, da, sp, sa, n, w, eop); +} + +static void +paint_span_N_general_alpha_op(byte * restrict dp, int da, const byte * restrict sp, int sa, int n, int w, int alpha, const fz_overprint * restrict eop) +{ + TRACK_FN(); + template_span_N_with_alpha_general_op(dp, da, sp, sa, n, w, alpha, eop); +} #endif /* FZ_PLOTTERS_N */ fz_span_painter_t * -fz_get_span_painter(int da, int sa, int n, int alpha) +fz_get_span_painter(int da, int sa, int n, int alpha, const fz_overprint * restrict eop) { + if (eop != NULL) + { + if (alpha == 255) + return paint_span_N_general_op; + else if (alpha > 0) + return paint_span_N_general_alpha_op; + else + return NULL; + } switch (n) { case 0: @@ -1883,14 +2180,14 @@ fz_paint_pixmap_with_bbox(fz_pixmap * restrict dst, const fz_pixmap * restrict s da = dst->alpha; n -= sa; - fn = fz_get_span_painter(da, sa, n, alpha); + fn = fz_get_span_painter(da, sa, n, alpha, 0); assert(fn); if (fn == NULL) return; while (h--) { - (*fn)(dp, da, sp, sa, n, w, alpha); + (*fn)(dp, da, sp, sa, n, w, alpha, 0); sp += src->stride; dp += dst->stride; } @@ -1934,14 +2231,14 @@ fz_paint_pixmap(fz_pixmap * restrict dst, const fz_pixmap * restrict src, int al da = dst->alpha; n -= sa; - fn = fz_get_span_painter(da, sa, n, alpha); + fn = fz_get_span_painter(da, sa, n, alpha, 0); assert(fn); if (fn == NULL) return; while (h--) { - (*fn)(dp, da, sp, sa, n, w, alpha); + (*fn)(dp, da, sp, sa, n, w, alpha, 0); sp += src->stride; dp += dst->stride; } @@ -1989,7 +2286,7 @@ fz_paint_pixmap_with_mask(fz_pixmap * restrict dst, const fz_pixmap * restrict s while (h--) { - (*fn)(dp, sp, mp, w, n, sa); + (*fn)(dp, sp, mp, w, n, sa, NULL); sp += src->stride; dp += dst->stride; mp += msk->stride; @@ -2191,11 +2488,35 @@ intermediate_run: #include "paint-glyph.h" #include "paint-glyph.h" + +#define ALPHA +#define EOP +#include "paint-glyph.h" + +#define DA +#define EOP +#include "paint-glyph.h" + +#define DA +#define ALPHA +#define EOP +#include "paint-glyph.h" + +#define EOP +#include "paint-glyph.h" #endif /* FZ_PLOTTERS_N */ static inline void -fz_paint_glyph_alpha(const unsigned char * restrict colorbv, int n, int span, unsigned char * restrict dp, int da, const fz_glyph *glyph, int w, int h, int skip_x, int skip_y) +fz_paint_glyph_alpha(const unsigned char * restrict colorbv, int n, int span, unsigned char * restrict dp, int da, const fz_glyph *glyph, int w, int h, int skip_x, int skip_y, const fz_overprint * restrict eop) { + if (eop != NULL) + { + if (da) + fz_paint_glyph_alpha_N_da_op(colorbv, n, span, dp, glyph, w, h, skip_x, skip_y, eop); + else + fz_paint_glyph_alpha_N_op(colorbv, n, span, dp, glyph, w, h, skip_x, skip_y, eop); + return; + } switch (n) { case 1: @@ -2241,8 +2562,16 @@ fallback:{} } static inline void -fz_paint_glyph_solid(const unsigned char * restrict colorbv, int n, int span, unsigned char * restrict dp, int da, const fz_glyph * restrict glyph, int w, int h, int skip_x, int skip_y) +fz_paint_glyph_solid(const unsigned char * restrict colorbv, int n, int span, unsigned char * restrict dp, int da, const fz_glyph * restrict glyph, int w, int h, int skip_x, int skip_y, const fz_overprint * restrict eop) { + if (eop != NULL) + { + if (da) + fz_paint_glyph_solid_N_da_op(colorbv, n, span, dp, glyph, w, h, skip_x, skip_y, eop); + else + fz_paint_glyph_solid_N_op(colorbv, n, span, dp, glyph, w, h, skip_x, skip_y, eop); + return; + } switch (n) { case 1: @@ -2288,20 +2617,20 @@ fallback:{} } void -fz_paint_glyph(const unsigned char * restrict colorbv, fz_pixmap * restrict dst, unsigned char * restrict dp, const fz_glyph * restrict glyph, int w, int h, int skip_x, int skip_y) +fz_paint_glyph(const unsigned char * restrict colorbv, fz_pixmap * restrict dst, unsigned char * restrict dp, const fz_glyph * restrict glyph, int w, int h, int skip_x, int skip_y, const fz_overprint * restrict eop) { int n = dst->n - dst->alpha; if (dst->colorspace) { assert(n > 0); if (colorbv[n] == 255) - fz_paint_glyph_solid(colorbv, n, dst->stride, dp, dst->alpha, glyph, w, h, skip_x, skip_y); + fz_paint_glyph_solid(colorbv, n, dst->stride, dp, dst->alpha, glyph, w, h, skip_x, skip_y, eop); else if (colorbv[n] != 0) - fz_paint_glyph_alpha(colorbv, n, dst->stride, dp, dst->alpha, glyph, w, h, skip_x, skip_y); + fz_paint_glyph_alpha(colorbv, n, dst->stride, dp, dst->alpha, glyph, w, h, skip_x, skip_y, eop); } else { - assert(dst->alpha && dst->n == 1 && dst->colorspace == NULL); + assert(dst->alpha && dst->n == 1 && dst->colorspace == NULL && eop == 0); fz_paint_glyph_mask(dst->stride, dp, dst->alpha, glyph, w, h, skip_x, skip_y); } } diff --git a/source/fitz/draw-rasterize.c b/source/fitz/draw-rasterize.c index 63a9d0b2..2e399834 100644 --- a/source/fitz/draw-rasterize.c +++ b/source/fitz/draw-rasterize.c @@ -293,7 +293,7 @@ fz_rasterizer *fz_new_rasterizer(fz_context *ctx, const fz_aa_context *aa) return r; } -void fz_convert_rasterizer(fz_context *ctx, fz_rasterizer *r, int eofill, fz_pixmap *pix, unsigned char *colorbv) +void fz_convert_rasterizer(fz_context *ctx, fz_rasterizer *r, int eofill, fz_pixmap *pix, unsigned char *colorbv, fz_overprint *eop) { fz_irect clip, scissor; fz_irect pixmap_clip; @@ -302,5 +302,5 @@ void fz_convert_rasterizer(fz_context *ctx, fz_rasterizer *r, int eofill, fz_pix return; if (fz_is_empty_irect(fz_intersect_irect(&clip, fz_clip_rasterizer(ctx, r, &scissor)))) return; - r->fns.convert(ctx, r, eofill, &clip, pix, colorbv); + r->fns.convert(ctx, r, eofill, &clip, pix, colorbv, eop); } diff --git a/source/fitz/paint-glyph.h b/source/fitz/paint-glyph.h index 748e6b19..81a3a558 100644 --- a/source/fitz/paint-glyph.h +++ b/source/fitz/paint-glyph.h @@ -15,15 +15,31 @@ #define NAME2 #endif -#define FUNCTION_NAMER(NAME,N,NAME2) fz_paint_glyph_##NAME##_##N##NAME2 -#define FUNCTION_NAME(NAME,N,NAME2) FUNCTION_NAMER(NAME,N,NAME2) +#ifdef EOP +#define NAME3 _op +#else +#define NAME3 +#endif + +#define FUNCTION_NAMER(NAME,N,NAME2,NAME3) fz_paint_glyph_##NAME##_##N##NAME2##NAME3 +#define FUNCTION_NAME(NAME,N,NAME2,NAME3) FUNCTION_NAMER(NAME,N,NAME2,NAME3) + +#ifdef EOP +#define IF_OVERPRINT_COMPONENT(k) if (fz_overprint_component(eop, k)) +#else +#define IF_OVERPRINT_COMPONENT(k) if (1) +#endif static inline void -FUNCTION_NAME(NAME,N,NAME2)(const unsigned char * restrict colorbv, +FUNCTION_NAME(NAME,N,NAME2,NAME3)(const unsigned char * restrict colorbv, #ifndef N const int n1, #endif - int span, unsigned char * restrict dp, const fz_glyph * restrict glyph, int w, int h, int skip_x, int skip_y) + int span, unsigned char * restrict dp, const fz_glyph * restrict glyph, int w, int h, int skip_x, int skip_y +#ifdef EOP + , const fz_overprint * restrict eop +#endif + ) { #ifdef N const int n1 = N; @@ -135,7 +151,8 @@ solid_run: { #ifdef ALPHA #if defined(N) && N == 1 - ddp[0] = FZ_BLEND(colorbv[0], ddp[0], sa); + IF_OVERPRINT_COMPONENT(0) + ddp[0] = FZ_BLEND(colorbv[0], ddp[0], sa); #ifdef DA ddp[1] = FZ_BLEND(0xFF, ddp[1], sa); ddp += 2; @@ -143,9 +160,12 @@ solid_run: ddp++; #endif #elif defined(N) && N == 3 - ddp[0] = FZ_BLEND(colorbv[0], ddp[0], sa); - ddp[1] = FZ_BLEND(colorbv[1], ddp[1], sa); - ddp[2] = FZ_BLEND(colorbv[2], ddp[2], sa); + IF_OVERPRINT_COMPONENT(0) + ddp[0] = FZ_BLEND(colorbv[0], ddp[0], sa); + IF_OVERPRINT_COMPONENT(1) + ddp[1] = FZ_BLEND(colorbv[1], ddp[1], sa); + IF_OVERPRINT_COMPONENT(2) + ddp[2] = FZ_BLEND(colorbv[2], ddp[2], sa); #ifdef DA ddp[3] = FZ_BLEND(0xFF, ddp[3], sa); ddp += 4; @@ -153,10 +173,14 @@ solid_run: ddp += 3; #endif #elif defined(N) && N == 4 - ddp[0] = FZ_BLEND(colorbv[0], ddp[0], sa); - ddp[1] = FZ_BLEND(colorbv[1], ddp[1], sa); - ddp[2] = FZ_BLEND(colorbv[2], ddp[2], sa); - ddp[3] = FZ_BLEND(colorbv[3], ddp[3], sa); + IF_OVERPRINT_COMPONENT(0) + ddp[0] = FZ_BLEND(colorbv[0], ddp[0], sa); + IF_OVERPRINT_COMPONENT(1) + ddp[1] = FZ_BLEND(colorbv[1], ddp[1], sa); + IF_OVERPRINT_COMPONENT(2) + ddp[2] = FZ_BLEND(colorbv[2], ddp[2], sa); + IF_OVERPRINT_COMPONENT(3) + ddp[3] = FZ_BLEND(colorbv[3], ddp[3], sa); #ifdef DA ddp[4] = FZ_BLEND(0xFF, ddp[4], sa); ddp += 5; @@ -167,7 +191,9 @@ solid_run: int k = 0; do { - *ddp = FZ_BLEND(colorbv[k++], *ddp, sa); + IF_OVERPRINT_COMPONENT(k) + *ddp = FZ_BLEND(colorbv[k], *ddp, sa); + k++; ddp++; } while (k != n1); @@ -179,38 +205,75 @@ solid_run: #else #if defined(N) && N == 1 #ifdef DA +#ifdef EOP + IF_OVERPRINT_COMPONENT(0) + ddp[0] = colorbv[0]; + IF_OVERPRINT_COMPONENT(1) + *ddp[1] = colorbv[1]; +#else *(uint16_t *)ddp = color; +#endif ddp += 2; #else *ddp++ = colorbv[0]; #endif #elif defined(N) && N == 3 #ifdef DA +#ifdef EOP + IF_OVERPRINT_COMPONENT(0) + ddp[0] = colorbv[0]; + IF_OVERPRINT_COMPONENT(1) + ddp[1] = colorbv[1]; + IF_OVERPRINT_COMPONENT(2) + ddp[2] = colorbv[2]; + IF_OVERPRINT_COMPONENT(3) +#else *(uint32_t *)ddp = color; +#endif ddp += 4; #else - ddp[0] = colorbv[0]; - ddp[1] = colorbv[1]; - ddp[2] = colorbv[2]; + IF_OVERPRINT_COMPONENT(0) + ddp[0] = colorbv[0]; + IF_OVERPRINT_COMPONENT(1) + ddp[1] = colorbv[1]; + IF_OVERPRINT_COMPONENT(2) + ddp[2] = colorbv[2]; ddp += 3; #endif #elif defined(N) && N == 4 #ifdef DA - ddp[0] = colorbv[0]; - ddp[1] = colorbv[1]; - ddp[2] = colorbv[2]; - ddp[3] = colorbv[3]; + IF_OVERPRINT_COMPONENT(0) + ddp[0] = colorbv[0]; + IF_OVERPRINT_COMPONENT(1) + ddp[1] = colorbv[1]; + IF_OVERPRINT_COMPONENT(2) + ddp[2] = colorbv[2]; + IF_OVERPRINT_COMPONENT(3) + ddp[3] = colorbv[3]; ddp[4] = colorbv[4]; ddp += 5; #else +#ifdef EOP + IF_OVERPRINT_COMPONENT(0) + ddp[0] = colorbv[0]; + IF_OVERPRINT_COMPONENT(1) + ddp[1] = colorbv[1]; + IF_OVERPRINT_COMPONENT(2) + ddp[2] = colorbv[2]; + ddp[3] = colorbv[3]; +#else *(uint32_t *)ddp = color; +#endif ddp += 4; #endif #else int k = 0; do { - *ddp++ = colorbv[k++]; + IF_OVERPRINT_COMPONENT(k) + *ddp = colorbv[k]; + k++; + ddp++; } while (k != n); #endif @@ -237,7 +300,8 @@ intermediate_run: #endif (void)k; #if defined(N) && N == 1 - ddp[0] = FZ_BLEND(colorbv[0], ddp[0], a); + IF_OVERPRINT_COMPONENT(0) + ddp[0] = FZ_BLEND(colorbv[0], ddp[0], a); #ifdef DA ddp[1] = FZ_BLEND(0xFF, ddp[1], a); ddp += 2; @@ -245,9 +309,12 @@ intermediate_run: ddp++; #endif #elif defined(N) && N == 3 - ddp[0] = FZ_BLEND(colorbv[0], ddp[0], a); - ddp[1] = FZ_BLEND(colorbv[1], ddp[1], a); - ddp[2] = FZ_BLEND(colorbv[2], ddp[2], a); + IF_OVERPRINT_COMPONENT(0) + ddp[0] = FZ_BLEND(colorbv[0], ddp[0], a); + IF_OVERPRINT_COMPONENT(1) + ddp[1] = FZ_BLEND(colorbv[1], ddp[1], a); + IF_OVERPRINT_COMPONENT(2) + ddp[2] = FZ_BLEND(colorbv[2], ddp[2], a); #ifdef DA ddp[3] = FZ_BLEND(0xFF, ddp[3], a); ddp += 4; @@ -255,10 +322,14 @@ intermediate_run: ddp += 3; #endif #elif defined(N) && N == 4 - ddp[0] = FZ_BLEND(colorbv[0], ddp[0], a); - ddp[1] = FZ_BLEND(colorbv[1], ddp[1], a); - ddp[2] = FZ_BLEND(colorbv[2], ddp[2], a); - ddp[3] = FZ_BLEND(colorbv[3], ddp[3], a); + IF_OVERPRINT_COMPONENT(0) + ddp[0] = FZ_BLEND(colorbv[0], ddp[0], a); + IF_OVERPRINT_COMPONENT(1) + ddp[1] = FZ_BLEND(colorbv[1], ddp[1], a); + IF_OVERPRINT_COMPONENT(2) + ddp[2] = FZ_BLEND(colorbv[2], ddp[2], a); + IF_OVERPRINT_COMPONENT(3) + ddp[3] = FZ_BLEND(colorbv[3], ddp[3], a); #ifdef DA ddp[4] = FZ_BLEND(0xFF, ddp[4], a); ddp += 5; @@ -268,7 +339,9 @@ intermediate_run: #else do { - *ddp = FZ_BLEND(colorbv[k++], *ddp, a); + IF_OVERPRINT_COMPONENT(k) + *ddp = FZ_BLEND(colorbv[k], *ddp, a); + k++; ddp++; } while (k != n1); @@ -292,7 +365,10 @@ intermediate_run: #undef NAME #undef ALPHA #undef NAME2 +#undef NAME3 +#undef EOP #undef DA #undef N #undef FUNCTION_NAMER #undef FUNCTION_NAME +#undef IF_OVERPRINT_COMPONENT |