1 /* -*- Mode: c; c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t; -*- */
3 * Copyright © 2010, 2012 Soren Sandmann Pedersen
4 * Copyright © 2010, 2012 Red Hat, Inc.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
25 * Author: Soren Sandmann Pedersen (sandmann@cs.au.dk)
36 #include "pixman-private.h"
38 /* Workaround for http://gcc.gnu.org/PR54965 */
39 /* GCC 4.6 has problems with force_inline, so just use normal inline instead */
40 #if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 6)
42 #define force_inline __inline__
45 typedef float (* combine_channel_t) (float sa, float s, float da, float d);
47 static force_inline void
48 combine_inner (pixman_bool_t component,
49 float *dest, const float *src, const float *mask, int n_pixels,
50 combine_channel_t combine_a, combine_channel_t combine_c)
56 for (i = 0; i < 4 * n_pixels; i += 4)
58 float sa = src[i + 0];
59 float sr = src[i + 1];
60 float sg = src[i + 2];
61 float sb = src[i + 3];
63 float da = dest[i + 0];
64 float dr = dest[i + 1];
65 float dg = dest[i + 2];
66 float db = dest[i + 3];
68 dest[i + 0] = combine_a (sa, sa, da, da);
69 dest[i + 1] = combine_c (sa, sr, da, dr);
70 dest[i + 2] = combine_c (sa, sg, da, dg);
71 dest[i + 3] = combine_c (sa, sb, da, db);
76 for (i = 0; i < 4 * n_pixels; i += 4)
114 ma = mr = mg = mb = sa;
122 dest[i + 0] = combine_a (ma, sa, da, da);
123 dest[i + 1] = combine_c (mr, sr, da, dr);
124 dest[i + 2] = combine_c (mg, sg, da, dg);
125 dest[i + 3] = combine_c (mb, sb, da, db);
130 #define MAKE_COMBINER(name, component, combine_a, combine_c) \
132 combine_ ## name ## _float (pixman_implementation_t *imp, \
139 combine_inner (component, dest, src, mask, n_pixels, \
140 combine_a, combine_c); \
143 #define MAKE_COMBINERS(name, combine_a, combine_c) \
144 MAKE_COMBINER(name ## _ca, TRUE, combine_a, combine_c) \
145 MAKE_COMBINER(name ## _u, FALSE, combine_a, combine_c)
149 * Porter/Duff operators
163 ONE_MINUS_SA_OVER_DA,
164 ONE_MINUS_DA_OVER_SA,
165 ONE_MINUS_INV_DA_OVER_SA,
166 ONE_MINUS_INV_SA_OVER_DA
170 (((f) < 0)? 0 : (((f) > 1.0) ? 1.0 : (f)))
172 static force_inline float
173 get_factor (combine_factor_t factor, float sa, float da)
204 if (FLOAT_IS_ZERO (da))
211 if (FLOAT_IS_ZERO (sa))
218 if (FLOAT_IS_ZERO (da))
221 f = CLAMP ((1.0f - sa) / da);
225 if (FLOAT_IS_ZERO (sa))
228 f = CLAMP ((1.0f - da) / sa);
231 case ONE_MINUS_SA_OVER_DA:
232 if (FLOAT_IS_ZERO (da))
235 f = CLAMP (1.0f - sa / da);
238 case ONE_MINUS_DA_OVER_SA:
239 if (FLOAT_IS_ZERO (sa))
242 f = CLAMP (1.0f - da / sa);
245 case ONE_MINUS_INV_DA_OVER_SA:
246 if (FLOAT_IS_ZERO (sa))
249 f = CLAMP (1.0f - (1.0f - da) / sa);
252 case ONE_MINUS_INV_SA_OVER_DA:
253 if (FLOAT_IS_ZERO (da))
256 f = CLAMP (1.0f - (1.0f - sa) / da);
263 #define MAKE_PD_COMBINERS(name, a, b) \
264 static float force_inline \
265 pd_combine_ ## name (float sa, float s, float da, float d) \
267 const float fa = get_factor (a, sa, da); \
268 const float fb = get_factor (b, sa, da); \
270 return MIN (1.0f, s * fa + d * fb); \
273 MAKE_COMBINERS(name, pd_combine_ ## name, pd_combine_ ## name)
275 MAKE_PD_COMBINERS (clear, ZERO, ZERO)
276 MAKE_PD_COMBINERS (src, ONE, ZERO)
277 MAKE_PD_COMBINERS (dst, ZERO, ONE)
278 MAKE_PD_COMBINERS (over, ONE, INV_SA)
279 MAKE_PD_COMBINERS (over_reverse, INV_DA, ONE)
280 MAKE_PD_COMBINERS (in, DEST_ALPHA, ZERO)
281 MAKE_PD_COMBINERS (in_reverse, ZERO, SRC_ALPHA)
282 MAKE_PD_COMBINERS (out, INV_DA, ZERO)
283 MAKE_PD_COMBINERS (out_reverse, ZERO, INV_SA)
284 MAKE_PD_COMBINERS (atop, DEST_ALPHA, INV_SA)
285 MAKE_PD_COMBINERS (atop_reverse, INV_DA, SRC_ALPHA)
286 MAKE_PD_COMBINERS (xor, INV_DA, INV_SA)
287 MAKE_PD_COMBINERS (add, ONE, ONE)
289 MAKE_PD_COMBINERS (saturate, INV_DA_OVER_SA, ONE)
291 MAKE_PD_COMBINERS (disjoint_clear, ZERO, ZERO)
292 MAKE_PD_COMBINERS (disjoint_src, ONE, ZERO)
293 MAKE_PD_COMBINERS (disjoint_dst, ZERO, ONE)
294 MAKE_PD_COMBINERS (disjoint_over, ONE, INV_SA_OVER_DA)
295 MAKE_PD_COMBINERS (disjoint_over_reverse, INV_DA_OVER_SA, ONE)
296 MAKE_PD_COMBINERS (disjoint_in, ONE_MINUS_INV_DA_OVER_SA, ZERO)
297 MAKE_PD_COMBINERS (disjoint_in_reverse, ZERO, ONE_MINUS_INV_SA_OVER_DA)
298 MAKE_PD_COMBINERS (disjoint_out, INV_DA_OVER_SA, ZERO)
299 MAKE_PD_COMBINERS (disjoint_out_reverse, ZERO, INV_SA_OVER_DA)
300 MAKE_PD_COMBINERS (disjoint_atop, ONE_MINUS_INV_DA_OVER_SA, INV_SA_OVER_DA)
301 MAKE_PD_COMBINERS (disjoint_atop_reverse, INV_DA_OVER_SA, ONE_MINUS_INV_SA_OVER_DA)
302 MAKE_PD_COMBINERS (disjoint_xor, INV_DA_OVER_SA, INV_SA_OVER_DA)
304 MAKE_PD_COMBINERS (conjoint_clear, ZERO, ZERO)
305 MAKE_PD_COMBINERS (conjoint_src, ONE, ZERO)
306 MAKE_PD_COMBINERS (conjoint_dst, ZERO, ONE)
307 MAKE_PD_COMBINERS (conjoint_over, ONE, ONE_MINUS_SA_OVER_DA)
308 MAKE_PD_COMBINERS (conjoint_over_reverse, ONE_MINUS_DA_OVER_SA, ONE)
309 MAKE_PD_COMBINERS (conjoint_in, DA_OVER_SA, ZERO)
310 MAKE_PD_COMBINERS (conjoint_in_reverse, ZERO, SA_OVER_DA)
311 MAKE_PD_COMBINERS (conjoint_out, ONE_MINUS_DA_OVER_SA, ZERO)
312 MAKE_PD_COMBINERS (conjoint_out_reverse, ZERO, ONE_MINUS_SA_OVER_DA)
313 MAKE_PD_COMBINERS (conjoint_atop, DA_OVER_SA, ONE_MINUS_SA_OVER_DA)
314 MAKE_PD_COMBINERS (conjoint_atop_reverse, ONE_MINUS_DA_OVER_SA, SA_OVER_DA)
315 MAKE_PD_COMBINERS (conjoint_xor, ONE_MINUS_DA_OVER_SA, ONE_MINUS_SA_OVER_DA)
320 * The following blend modes have been taken from the PDF ISO 32000
321 * specification, which at this point in time is available from
322 * http://www.adobe.com/devnet/acrobat/pdfs/PDF32000_2008.pdf
323 * The relevant chapters are 11.3.5 and 11.3.6.
324 * The formula for computing the final pixel color given in 11.3.6 is:
325 * αr × Cr = (1 – αs) × αb × Cb + (1 – αb) × αs × Cs + αb × αs × B(Cb, Cs)
326 * with B() being the blend function.
327 * Note that OVER is a special case of this operation, using B(Cb, Cs) = Cs
329 * These blend modes should match the SVG filter draft specification, as
330 * it has been designed to mirror ISO 32000. Note that at the current point
331 * no released draft exists that shows this, as the formulas have not been
332 * updated yet after the release of ISO 32000.
334 * The default implementation here uses the PDF_SEPARABLE_BLEND_MODE and
335 * PDF_NON_SEPARABLE_BLEND_MODE macros, which take the blend function as an
336 * argument. Note that this implementation operates on premultiplied colors,
337 * while the PDF specification does not. Therefore the code uses the formula
338 * ar.Cra = (1 – as) . Dca + (1 – ad) . Sca + B(Dca, ad, Sca, as)
341 #define MAKE_SEPARABLE_PDF_COMBINERS(name) \
342 static force_inline float \
343 combine_ ## name ## _a (float sa, float s, float da, float d) \
345 return da + sa - da * sa; \
348 static force_inline float \
349 combine_ ## name ## _c (float sa, float s, float da, float d) \
351 float f = (1 - sa) * d + (1 - da) * s; \
353 return f + blend_ ## name (sa, s, da, d); \
356 MAKE_COMBINERS (name, combine_ ## name ## _a, combine_ ## name ## _c)
358 static force_inline float
359 blend_multiply (float sa, float s, float da, float d)
364 static force_inline float
365 blend_screen (float sa, float s, float da, float d)
367 return d * sa + s * da - s * d;
370 static force_inline float
371 blend_overlay (float sa, float s, float da, float d)
376 return sa * da - 2 * (da - d) * (sa - s);
379 static force_inline float
380 blend_darken (float sa, float s, float da, float d)
391 static force_inline float
392 blend_lighten (float sa, float s, float da, float d)
403 static force_inline float
404 blend_color_dodge (float sa, float s, float da, float d)
406 if (FLOAT_IS_ZERO (d))
408 else if (d * sa >= sa * da - s * da)
410 else if (FLOAT_IS_ZERO (sa - s))
413 return sa * sa * d / (sa - s);
416 static force_inline float
417 blend_color_burn (float sa, float s, float da, float d)
421 else if (sa * (da - d) >= s * da)
423 else if (FLOAT_IS_ZERO (s))
426 return sa * (da - sa * (da - d) / s);
429 static force_inline float
430 blend_hard_light (float sa, float s, float da, float d)
435 return sa * da - 2 * (da - d) * (sa - s);
438 static force_inline float
439 blend_soft_light (float sa, float s, float da, float d)
443 if (FLOAT_IS_ZERO (da))
446 return d * sa - d * (da - d) * (sa - 2 * s) / da;
450 if (FLOAT_IS_ZERO (da))
457 return d * sa + (2 * s - sa) * d * ((16 * d / da - 12) * d / da + 3);
459 return d * sa + (sqrtf (d * da) - d) * (2 * s - sa);
464 static force_inline float
465 blend_difference (float sa, float s, float da, float d)
476 static force_inline float
477 blend_exclusion (float sa, float s, float da, float d)
479 return s * da + d * sa - 2 * d * s;
482 MAKE_SEPARABLE_PDF_COMBINERS (multiply)
483 MAKE_SEPARABLE_PDF_COMBINERS (screen)
484 MAKE_SEPARABLE_PDF_COMBINERS (overlay)
485 MAKE_SEPARABLE_PDF_COMBINERS (darken)
486 MAKE_SEPARABLE_PDF_COMBINERS (lighten)
487 MAKE_SEPARABLE_PDF_COMBINERS (color_dodge)
488 MAKE_SEPARABLE_PDF_COMBINERS (color_burn)
489 MAKE_SEPARABLE_PDF_COMBINERS (hard_light)
490 MAKE_SEPARABLE_PDF_COMBINERS (soft_light)
491 MAKE_SEPARABLE_PDF_COMBINERS (difference)
492 MAKE_SEPARABLE_PDF_COMBINERS (exclusion)
495 * PDF nonseperable blend modes.
497 * These are implemented using the following functions to operate in Hsl
498 * space, with Cmax, Cmid, Cmin referring to the max, mid and min value
499 * of the red, green and blue components.
501 * LUM (C) = 0.3 × Cred + 0.59 × Cgreen + 0.11 × Cblue
508 * C = l + (((C – l) × l) ⁄ (l – min))
510 * C = l + (((C – l) × (1 – l)) (max – l))
516 * return clip_color (C)
518 * SAT (C) = CH_MAX (C) - CH_MIN (C)
522 * Cmid = ( ( ( Cmid – Cmin ) × s ) ⁄ ( Cmax – Cmin ) )
530 /* For premultiplied colors, we need to know what happens when C is
531 * multiplied by a real number. LUM and SAT are linear:
533 * LUM (r × C) = r × LUM (C) SAT (r × C) = r × SAT (C)
535 * If we extend clip_color with an extra argument a and change
543 * then clip_color is also linear:
545 * r * clip_color (C, a) = clip_color (r_c, ra);
549 * Similarly, we can extend set_lum with an extra argument that is just passed
552 * r × set_lum ( C, l, a)
554 * = r × clip_color ( C + l - LUM (C), a)
556 * = clip_color ( r * C + r × l - LUM (r × C), r * a)
558 * = set_lum ( r * C, r * l, r * a)
562 * r * set_sat (C, s) = set_sat (x * C, r * s)
564 * The above holds for all non-zero x because they x'es in the fraction for
565 * C_mid cancel out. Specifically, it holds for x = r:
567 * r * set_sat (C, s) = set_sat (r_c, rs)
572 * So, for the non-separable PDF blend modes, we have (using s, d for
573 * non-premultiplied colors, and S, D for premultiplied:
577 * a_s * a_d * B(s, d)
578 * = a_s * a_d * set_lum (S/a_s, LUM (D/a_d), 1)
579 * = set_lum (S * a_d, a_s * LUM (D), a_s * a_d)
584 * a_s * a_d * B(s, d)
585 * = a_s * a_d * set_lum (D/a_d, LUM(S/a_s), 1)
586 * = set_lum (a_s * D, a_d * LUM(S), a_s * a_d)
591 * a_s * a_d * B(s, d)
592 * = a_s * a_d * set_lum (set_sat (D/a_d, SAT (S/a_s)), LUM (D/a_d), 1)
593 * = set_lum (a_s * a_d * set_sat (D/a_d, SAT (S/a_s)),
594 * a_s * LUM (D), a_s * a_d)
595 * = set_lum (set_sat (a_s * D, a_d * SAT (S), a_s * LUM (D), a_s * a_d))
599 * a_s * a_d * B(s, d)
600 * = a_s * a_d * set_lum (set_sat (S/a_s, SAT (D/a_d)), LUM (D/a_d), 1)
601 * = set_lum (set_sat (a_d * S, a_s * SAT (D)), a_s * LUM (D), a_s * a_d)
612 static force_inline float
613 minf (float a, float b)
618 static force_inline float
619 maxf (float a, float b)
624 static force_inline float
625 channel_min (const rgb_t *c)
627 return minf (minf (c->r, c->g), c->b);
630 static force_inline float
631 channel_max (const rgb_t *c)
633 return maxf (maxf (c->r, c->g), c->b);
636 static force_inline float
637 get_lum (const rgb_t *c)
639 return c->r * 0.3f + c->g * 0.59f + c->b * 0.11f;
642 static force_inline float
643 get_sat (const rgb_t *c)
645 return channel_max (c) - channel_min (c);
649 clip_color (rgb_t *color, float a)
651 float l = get_lum (color);
652 float n = channel_min (color);
653 float x = channel_max (color);
659 if (FLOAT_IS_ZERO (t))
667 color->r = l + (((color->r - l) * l) / t);
668 color->g = l + (((color->g - l) * l) / t);
669 color->b = l + (((color->b - l) * l) / t);
675 if (FLOAT_IS_ZERO (t))
683 color->r = l + (((color->r - l) * (a - l) / t));
684 color->g = l + (((color->g - l) * (a - l) / t));
685 color->b = l + (((color->b - l) * (a - l) / t));
691 set_lum (rgb_t *color, float sa, float l)
693 float d = l - get_lum (color);
695 color->r = color->r + d;
696 color->g = color->g + d;
697 color->b = color->b + d;
699 clip_color (color, sa);
703 set_sat (rgb_t *src, float sat)
705 float *max, *mid, *min;
759 if (FLOAT_IS_ZERO (t))
765 *mid = ((*mid - *min) * sat) / t;
774 * B(Cb, Cs) = set_lum (set_sat (Cs, SAT (Cb)), LUM (Cb))
776 static force_inline void
777 blend_hsl_hue (rgb_t *res,
778 const rgb_t *dest, float da,
779 const rgb_t *src, float sa)
781 res->r = src->r * da;
782 res->g = src->g * da;
783 res->b = src->b * da;
785 set_sat (res, get_sat (dest) * sa);
786 set_lum (res, sa * da, get_lum (dest) * sa);
791 * B(Cb, Cs) = set_lum (set_sat (Cb, SAT (Cs)), LUM (Cb))
793 static force_inline void
794 blend_hsl_saturation (rgb_t *res,
795 const rgb_t *dest, float da,
796 const rgb_t *src, float sa)
798 res->r = dest->r * sa;
799 res->g = dest->g * sa;
800 res->b = dest->b * sa;
802 set_sat (res, get_sat (src) * da);
803 set_lum (res, sa * da, get_lum (dest) * sa);
808 * B(Cb, Cs) = set_lum (Cs, LUM (Cb))
810 static force_inline void
811 blend_hsl_color (rgb_t *res,
812 const rgb_t *dest, float da,
813 const rgb_t *src, float sa)
815 res->r = src->r * da;
816 res->g = src->g * da;
817 res->b = src->b * da;
819 set_lum (res, sa * da, get_lum (dest) * sa);
824 * B(Cb, Cs) = set_lum (Cb, LUM (Cs))
826 static force_inline void
827 blend_hsl_luminosity (rgb_t *res,
828 const rgb_t *dest, float da,
829 const rgb_t *src, float sa)
831 res->r = dest->r * sa;
832 res->g = dest->g * sa;
833 res->b = dest->b * sa;
835 set_lum (res, sa * da, get_lum (src) * da);
838 #define MAKE_NON_SEPARABLE_PDF_COMBINERS(name) \
840 combine_ ## name ## _u_float (pixman_implementation_t *imp, \
849 for (i = 0; i < 4 * n_pixels; i += 4) \
860 dc.r = dest[i + 1]; \
861 dc.g = dest[i + 2]; \
862 dc.b = dest[i + 3]; \
866 float ma = mask[i + 0]; \
868 /* Component alpha is not supported for HSL modes */ \
875 blend_ ## name (&rc, &dc, da, &sc, sa); \
877 dest[i + 0] = sa + da - sa * da; \
878 dest[i + 1] = (1 - sa) * dc.r + (1 - da) * sc.r + rc.r; \
879 dest[i + 2] = (1 - sa) * dc.g + (1 - da) * sc.g + rc.g; \
880 dest[i + 3] = (1 - sa) * dc.b + (1 - da) * sc.b + rc.b; \
884 MAKE_NON_SEPARABLE_PDF_COMBINERS(hsl_hue)
885 MAKE_NON_SEPARABLE_PDF_COMBINERS(hsl_saturation)
886 MAKE_NON_SEPARABLE_PDF_COMBINERS(hsl_color)
887 MAKE_NON_SEPARABLE_PDF_COMBINERS(hsl_luminosity)
890 _pixman_setup_combiner_functions_float (pixman_implementation_t *imp)
893 imp->combine_float[PIXMAN_OP_CLEAR] = combine_clear_u_float;
894 imp->combine_float[PIXMAN_OP_SRC] = combine_src_u_float;
895 imp->combine_float[PIXMAN_OP_DST] = combine_dst_u_float;
896 imp->combine_float[PIXMAN_OP_OVER] = combine_over_u_float;
897 imp->combine_float[PIXMAN_OP_OVER_REVERSE] = combine_over_reverse_u_float;
898 imp->combine_float[PIXMAN_OP_IN] = combine_in_u_float;
899 imp->combine_float[PIXMAN_OP_IN_REVERSE] = combine_in_reverse_u_float;
900 imp->combine_float[PIXMAN_OP_OUT] = combine_out_u_float;
901 imp->combine_float[PIXMAN_OP_OUT_REVERSE] = combine_out_reverse_u_float;
902 imp->combine_float[PIXMAN_OP_ATOP] = combine_atop_u_float;
903 imp->combine_float[PIXMAN_OP_ATOP_REVERSE] = combine_atop_reverse_u_float;
904 imp->combine_float[PIXMAN_OP_XOR] = combine_xor_u_float;
905 imp->combine_float[PIXMAN_OP_ADD] = combine_add_u_float;
906 imp->combine_float[PIXMAN_OP_SATURATE] = combine_saturate_u_float;
908 /* Disjoint, unified */
909 imp->combine_float[PIXMAN_OP_DISJOINT_CLEAR] = combine_disjoint_clear_u_float;
910 imp->combine_float[PIXMAN_OP_DISJOINT_SRC] = combine_disjoint_src_u_float;
911 imp->combine_float[PIXMAN_OP_DISJOINT_DST] = combine_disjoint_dst_u_float;
912 imp->combine_float[PIXMAN_OP_DISJOINT_OVER] = combine_disjoint_over_u_float;
913 imp->combine_float[PIXMAN_OP_DISJOINT_OVER_REVERSE] = combine_disjoint_over_reverse_u_float;
914 imp->combine_float[PIXMAN_OP_DISJOINT_IN] = combine_disjoint_in_u_float;
915 imp->combine_float[PIXMAN_OP_DISJOINT_IN_REVERSE] = combine_disjoint_in_reverse_u_float;
916 imp->combine_float[PIXMAN_OP_DISJOINT_OUT] = combine_disjoint_out_u_float;
917 imp->combine_float[PIXMAN_OP_DISJOINT_OUT_REVERSE] = combine_disjoint_out_reverse_u_float;
918 imp->combine_float[PIXMAN_OP_DISJOINT_ATOP] = combine_disjoint_atop_u_float;
919 imp->combine_float[PIXMAN_OP_DISJOINT_ATOP_REVERSE] = combine_disjoint_atop_reverse_u_float;
920 imp->combine_float[PIXMAN_OP_DISJOINT_XOR] = combine_disjoint_xor_u_float;
922 /* Conjoint, unified */
923 imp->combine_float[PIXMAN_OP_CONJOINT_CLEAR] = combine_conjoint_clear_u_float;
924 imp->combine_float[PIXMAN_OP_CONJOINT_SRC] = combine_conjoint_src_u_float;
925 imp->combine_float[PIXMAN_OP_CONJOINT_DST] = combine_conjoint_dst_u_float;
926 imp->combine_float[PIXMAN_OP_CONJOINT_OVER] = combine_conjoint_over_u_float;
927 imp->combine_float[PIXMAN_OP_CONJOINT_OVER_REVERSE] = combine_conjoint_over_reverse_u_float;
928 imp->combine_float[PIXMAN_OP_CONJOINT_IN] = combine_conjoint_in_u_float;
929 imp->combine_float[PIXMAN_OP_CONJOINT_IN_REVERSE] = combine_conjoint_in_reverse_u_float;
930 imp->combine_float[PIXMAN_OP_CONJOINT_OUT] = combine_conjoint_out_u_float;
931 imp->combine_float[PIXMAN_OP_CONJOINT_OUT_REVERSE] = combine_conjoint_out_reverse_u_float;
932 imp->combine_float[PIXMAN_OP_CONJOINT_ATOP] = combine_conjoint_atop_u_float;
933 imp->combine_float[PIXMAN_OP_CONJOINT_ATOP_REVERSE] = combine_conjoint_atop_reverse_u_float;
934 imp->combine_float[PIXMAN_OP_CONJOINT_XOR] = combine_conjoint_xor_u_float;
936 /* PDF operators, unified */
937 imp->combine_float[PIXMAN_OP_MULTIPLY] = combine_multiply_u_float;
938 imp->combine_float[PIXMAN_OP_SCREEN] = combine_screen_u_float;
939 imp->combine_float[PIXMAN_OP_OVERLAY] = combine_overlay_u_float;
940 imp->combine_float[PIXMAN_OP_DARKEN] = combine_darken_u_float;
941 imp->combine_float[PIXMAN_OP_LIGHTEN] = combine_lighten_u_float;
942 imp->combine_float[PIXMAN_OP_COLOR_DODGE] = combine_color_dodge_u_float;
943 imp->combine_float[PIXMAN_OP_COLOR_BURN] = combine_color_burn_u_float;
944 imp->combine_float[PIXMAN_OP_HARD_LIGHT] = combine_hard_light_u_float;
945 imp->combine_float[PIXMAN_OP_SOFT_LIGHT] = combine_soft_light_u_float;
946 imp->combine_float[PIXMAN_OP_DIFFERENCE] = combine_difference_u_float;
947 imp->combine_float[PIXMAN_OP_EXCLUSION] = combine_exclusion_u_float;
949 imp->combine_float[PIXMAN_OP_HSL_HUE] = combine_hsl_hue_u_float;
950 imp->combine_float[PIXMAN_OP_HSL_SATURATION] = combine_hsl_saturation_u_float;
951 imp->combine_float[PIXMAN_OP_HSL_COLOR] = combine_hsl_color_u_float;
952 imp->combine_float[PIXMAN_OP_HSL_LUMINOSITY] = combine_hsl_luminosity_u_float;
954 /* Component alpha combiners */
955 imp->combine_float_ca[PIXMAN_OP_CLEAR] = combine_clear_ca_float;
956 imp->combine_float_ca[PIXMAN_OP_SRC] = combine_src_ca_float;
957 imp->combine_float_ca[PIXMAN_OP_DST] = combine_dst_ca_float;
958 imp->combine_float_ca[PIXMAN_OP_OVER] = combine_over_ca_float;
959 imp->combine_float_ca[PIXMAN_OP_OVER_REVERSE] = combine_over_reverse_ca_float;
960 imp->combine_float_ca[PIXMAN_OP_IN] = combine_in_ca_float;
961 imp->combine_float_ca[PIXMAN_OP_IN_REVERSE] = combine_in_reverse_ca_float;
962 imp->combine_float_ca[PIXMAN_OP_OUT] = combine_out_ca_float;
963 imp->combine_float_ca[PIXMAN_OP_OUT_REVERSE] = combine_out_reverse_ca_float;
964 imp->combine_float_ca[PIXMAN_OP_ATOP] = combine_atop_ca_float;
965 imp->combine_float_ca[PIXMAN_OP_ATOP_REVERSE] = combine_atop_reverse_ca_float;
966 imp->combine_float_ca[PIXMAN_OP_XOR] = combine_xor_ca_float;
967 imp->combine_float_ca[PIXMAN_OP_ADD] = combine_add_ca_float;
968 imp->combine_float_ca[PIXMAN_OP_SATURATE] = combine_saturate_ca_float;
971 imp->combine_float_ca[PIXMAN_OP_DISJOINT_CLEAR] = combine_disjoint_clear_ca_float;
972 imp->combine_float_ca[PIXMAN_OP_DISJOINT_SRC] = combine_disjoint_src_ca_float;
973 imp->combine_float_ca[PIXMAN_OP_DISJOINT_DST] = combine_disjoint_dst_ca_float;
974 imp->combine_float_ca[PIXMAN_OP_DISJOINT_OVER] = combine_disjoint_over_ca_float;
975 imp->combine_float_ca[PIXMAN_OP_DISJOINT_OVER_REVERSE] = combine_disjoint_over_reverse_ca_float;
976 imp->combine_float_ca[PIXMAN_OP_DISJOINT_IN] = combine_disjoint_in_ca_float;
977 imp->combine_float_ca[PIXMAN_OP_DISJOINT_IN_REVERSE] = combine_disjoint_in_reverse_ca_float;
978 imp->combine_float_ca[PIXMAN_OP_DISJOINT_OUT] = combine_disjoint_out_ca_float;
979 imp->combine_float_ca[PIXMAN_OP_DISJOINT_OUT_REVERSE] = combine_disjoint_out_reverse_ca_float;
980 imp->combine_float_ca[PIXMAN_OP_DISJOINT_ATOP] = combine_disjoint_atop_ca_float;
981 imp->combine_float_ca[PIXMAN_OP_DISJOINT_ATOP_REVERSE] = combine_disjoint_atop_reverse_ca_float;
982 imp->combine_float_ca[PIXMAN_OP_DISJOINT_XOR] = combine_disjoint_xor_ca_float;
985 imp->combine_float_ca[PIXMAN_OP_CONJOINT_CLEAR] = combine_conjoint_clear_ca_float;
986 imp->combine_float_ca[PIXMAN_OP_CONJOINT_SRC] = combine_conjoint_src_ca_float;
987 imp->combine_float_ca[PIXMAN_OP_CONJOINT_DST] = combine_conjoint_dst_ca_float;
988 imp->combine_float_ca[PIXMAN_OP_CONJOINT_OVER] = combine_conjoint_over_ca_float;
989 imp->combine_float_ca[PIXMAN_OP_CONJOINT_OVER_REVERSE] = combine_conjoint_over_reverse_ca_float;
990 imp->combine_float_ca[PIXMAN_OP_CONJOINT_IN] = combine_conjoint_in_ca_float;
991 imp->combine_float_ca[PIXMAN_OP_CONJOINT_IN_REVERSE] = combine_conjoint_in_reverse_ca_float;
992 imp->combine_float_ca[PIXMAN_OP_CONJOINT_OUT] = combine_conjoint_out_ca_float;
993 imp->combine_float_ca[PIXMAN_OP_CONJOINT_OUT_REVERSE] = combine_conjoint_out_reverse_ca_float;
994 imp->combine_float_ca[PIXMAN_OP_CONJOINT_ATOP] = combine_conjoint_atop_ca_float;
995 imp->combine_float_ca[PIXMAN_OP_CONJOINT_ATOP_REVERSE] = combine_conjoint_atop_reverse_ca_float;
996 imp->combine_float_ca[PIXMAN_OP_CONJOINT_XOR] = combine_conjoint_xor_ca_float;
998 /* PDF operators CA */
999 imp->combine_float_ca[PIXMAN_OP_MULTIPLY] = combine_multiply_ca_float;
1000 imp->combine_float_ca[PIXMAN_OP_SCREEN] = combine_screen_ca_float;
1001 imp->combine_float_ca[PIXMAN_OP_OVERLAY] = combine_overlay_ca_float;
1002 imp->combine_float_ca[PIXMAN_OP_DARKEN] = combine_darken_ca_float;
1003 imp->combine_float_ca[PIXMAN_OP_LIGHTEN] = combine_lighten_ca_float;
1004 imp->combine_float_ca[PIXMAN_OP_COLOR_DODGE] = combine_color_dodge_ca_float;
1005 imp->combine_float_ca[PIXMAN_OP_COLOR_BURN] = combine_color_burn_ca_float;
1006 imp->combine_float_ca[PIXMAN_OP_HARD_LIGHT] = combine_hard_light_ca_float;
1007 imp->combine_float_ca[PIXMAN_OP_SOFT_LIGHT] = combine_soft_light_ca_float;
1008 imp->combine_float_ca[PIXMAN_OP_DIFFERENCE] = combine_difference_ca_float;
1009 imp->combine_float_ca[PIXMAN_OP_EXCLUSION] = combine_exclusion_ca_float;
1011 /* It is not clear that these make sense, so make them noops for now */
1012 imp->combine_float_ca[PIXMAN_OP_HSL_HUE] = combine_dst_u_float;
1013 imp->combine_float_ca[PIXMAN_OP_HSL_SATURATION] = combine_dst_u_float;
1014 imp->combine_float_ca[PIXMAN_OP_HSL_COLOR] = combine_dst_u_float;
1015 imp->combine_float_ca[PIXMAN_OP_HSL_LUMINOSITY] = combine_dst_u_float;