9#ifndef GP_MIX_PIXELS_GEN_H
10#define GP_MIX_PIXELS_GEN_H
29#define GP_MIX_PIXELS_LINEAR_RGB101010(pix1, pix2, perc) ({ \
32 R = GP_PIXEL_GET_R_RGB101010(pix1) * (perc); \
33 R += GP_PIXEL_GET_R_RGB101010(pix2) * (255 - (perc)); \
34 R = (R + 128) / 255; \
38 G = GP_PIXEL_GET_G_RGB101010(pix1) * (perc); \
39 G += GP_PIXEL_GET_G_RGB101010(pix2) * (255 - (perc)); \
40 G = (G + 128) / 255; \
44 B = GP_PIXEL_GET_B_RGB101010(pix1) * (perc); \
45 B += GP_PIXEL_GET_B_RGB101010(pix2) * (255 - (perc)); \
46 B = (B + 128) / 255; \
49 GP_PIXEL_CREATE_RGB101010(R, G, B); \
52#define GP_MIX_PIXELS_RGB101010(pix1, pix2, perc) \
53 GP_MIX_PIXELS_LINEAR_RGB101010(pix1, pix2, perc)
60#define GP_MIX_PIXELS_LINEAR_xRGB8888(pix1, pix2, perc) ({ \
63 R = GP_PIXEL_GET_R_xRGB8888(pix1) * (perc); \
64 R += GP_PIXEL_GET_R_xRGB8888(pix2) * (255 - (perc)); \
65 R = (R + 128) / 255; \
69 G = GP_PIXEL_GET_G_xRGB8888(pix1) * (perc); \
70 G += GP_PIXEL_GET_G_xRGB8888(pix2) * (255 - (perc)); \
71 G = (G + 128) / 255; \
75 B = GP_PIXEL_GET_B_xRGB8888(pix1) * (perc); \
76 B += GP_PIXEL_GET_B_xRGB8888(pix2) * (255 - (perc)); \
77 B = (B + 128) / 255; \
80 GP_PIXEL_CREATE_xRGB8888(R, G, B); \
83#define GP_MIX_PIXELS_xRGB8888(pix1, pix2, perc) \
84 GP_MIX_PIXELS_LINEAR_xRGB8888(pix1, pix2, perc)
91#define GP_MIX_PIXELS_LINEAR_RGBA8888(pix1, pix2, perc) ({ \
94 R = GP_PIXEL_GET_R_RGBA8888(pix1) * (perc); \
95 R += GP_PIXEL_GET_R_RGBA8888(pix2) * (255 - (perc)); \
96 R = (R + 128) / 255; \
100 G = GP_PIXEL_GET_G_RGBA8888(pix1) * (perc); \
101 G += GP_PIXEL_GET_G_RGBA8888(pix2) * (255 - (perc)); \
102 G = (G + 128) / 255; \
106 B = GP_PIXEL_GET_B_RGBA8888(pix1) * (perc); \
107 B += GP_PIXEL_GET_B_RGBA8888(pix2) * (255 - (perc)); \
108 B = (B + 128) / 255; \
112 A = GP_PIXEL_GET_A_RGBA8888(pix1) * (perc); \
113 A += GP_PIXEL_GET_A_RGBA8888(pix2) * (255 - (perc)); \
114 A = (A + 128) / 255; \
117 GP_PIXEL_CREATE_RGBA8888(R, G, B, A); \
120#define GP_MIX_PIXELS_RGBA8888(pix1, pix2, perc) \
121 GP_MIX_PIXELS_LINEAR_RGBA8888(pix1, pix2, perc)
128#define GP_MIX_PIXELS_LINEAR_RGB888(pix1, pix2, perc) ({ \
131 R = GP_PIXEL_GET_R_RGB888(pix1) * (perc); \
132 R += GP_PIXEL_GET_R_RGB888(pix2) * (255 - (perc)); \
133 R = (R + 128) / 255; \
137 G = GP_PIXEL_GET_G_RGB888(pix1) * (perc); \
138 G += GP_PIXEL_GET_G_RGB888(pix2) * (255 - (perc)); \
139 G = (G + 128) / 255; \
143 B = GP_PIXEL_GET_B_RGB888(pix1) * (perc); \
144 B += GP_PIXEL_GET_B_RGB888(pix2) * (255 - (perc)); \
145 B = (B + 128) / 255; \
148 GP_PIXEL_CREATE_RGB888(R, G, B); \
151#define GP_MIX_PIXELS_RGB888(pix1, pix2, perc) \
152 GP_MIX_PIXELS_LINEAR_RGB888(pix1, pix2, perc)
159#define GP_MIX_PIXELS_LINEAR_BGR888(pix1, pix2, perc) ({ \
162 B = GP_PIXEL_GET_B_BGR888(pix1) * (perc); \
163 B += GP_PIXEL_GET_B_BGR888(pix2) * (255 - (perc)); \
164 B = (B + 128) / 255; \
168 G = GP_PIXEL_GET_G_BGR888(pix1) * (perc); \
169 G += GP_PIXEL_GET_G_BGR888(pix2) * (255 - (perc)); \
170 G = (G + 128) / 255; \
174 R = GP_PIXEL_GET_R_BGR888(pix1) * (perc); \
175 R += GP_PIXEL_GET_R_BGR888(pix2) * (255 - (perc)); \
176 R = (R + 128) / 255; \
179 GP_PIXEL_CREATE_BGR888(B, G, R); \
182#define GP_MIX_PIXELS_BGR888(pix1, pix2, perc) \
183 GP_MIX_PIXELS_LINEAR_BGR888(pix1, pix2, perc)
190#define GP_MIX_PIXELS_LINEAR_RGB555(pix1, pix2, perc) ({ \
193 R = GP_PIXEL_GET_R_RGB555(pix1) * (perc); \
194 R += GP_PIXEL_GET_R_RGB555(pix2) * (255 - (perc)); \
195 R = (R + 128) / 255; \
199 G = GP_PIXEL_GET_G_RGB555(pix1) * (perc); \
200 G += GP_PIXEL_GET_G_RGB555(pix2) * (255 - (perc)); \
201 G = (G + 128) / 255; \
205 B = GP_PIXEL_GET_B_RGB555(pix1) * (perc); \
206 B += GP_PIXEL_GET_B_RGB555(pix2) * (255 - (perc)); \
207 B = (B + 128) / 255; \
210 GP_PIXEL_CREATE_RGB555(R, G, B); \
213#define GP_MIX_PIXELS_RGB555(pix1, pix2, perc) \
214 GP_MIX_PIXELS_LINEAR_RGB555(pix1, pix2, perc)
221#define GP_MIX_PIXELS_LINEAR_RGB565(pix1, pix2, perc) ({ \
224 R = GP_PIXEL_GET_R_RGB565(pix1) * (perc); \
225 R += GP_PIXEL_GET_R_RGB565(pix2) * (255 - (perc)); \
226 R = (R + 128) / 255; \
230 G = GP_PIXEL_GET_G_RGB565(pix1) * (perc); \
231 G += GP_PIXEL_GET_G_RGB565(pix2) * (255 - (perc)); \
232 G = (G + 128) / 255; \
236 B = GP_PIXEL_GET_B_RGB565(pix1) * (perc); \
237 B += GP_PIXEL_GET_B_RGB565(pix2) * (255 - (perc)); \
238 B = (B + 128) / 255; \
241 GP_PIXEL_CREATE_RGB565(R, G, B); \
244#define GP_MIX_PIXELS_RGB565(pix1, pix2, perc) \
245 GP_MIX_PIXELS_LINEAR_RGB565(pix1, pix2, perc)
252#define GP_MIX_PIXELS_LINEAR_RGB666(pix1, pix2, perc) ({ \
255 R = GP_PIXEL_GET_R_RGB666(pix1) * (perc); \
256 R += GP_PIXEL_GET_R_RGB666(pix2) * (255 - (perc)); \
257 R = (R + 128) / 255; \
261 G = GP_PIXEL_GET_G_RGB666(pix1) * (perc); \
262 G += GP_PIXEL_GET_G_RGB666(pix2) * (255 - (perc)); \
263 G = (G + 128) / 255; \
267 B = GP_PIXEL_GET_B_RGB666(pix1) * (perc); \
268 B += GP_PIXEL_GET_B_RGB666(pix2) * (255 - (perc)); \
269 B = (B + 128) / 255; \
272 GP_PIXEL_CREATE_RGB666(R, G, B); \
275#define GP_MIX_PIXELS_RGB666(pix1, pix2, perc) \
276 GP_MIX_PIXELS_LINEAR_RGB666(pix1, pix2, perc)
283#define GP_MIX_PIXELS_LINEAR_RGB332(pix1, pix2, perc) ({ \
286 R = GP_PIXEL_GET_R_RGB332(pix1) * (perc); \
287 R += GP_PIXEL_GET_R_RGB332(pix2) * (255 - (perc)); \
288 R = (R + 128) / 255; \
292 G = GP_PIXEL_GET_G_RGB332(pix1) * (perc); \
293 G += GP_PIXEL_GET_G_RGB332(pix2) * (255 - (perc)); \
294 G = (G + 128) / 255; \
298 B = GP_PIXEL_GET_B_RGB332(pix1) * (perc); \
299 B += GP_PIXEL_GET_B_RGB332(pix2) * (255 - (perc)); \
300 B = (B + 128) / 255; \
303 GP_PIXEL_CREATE_RGB332(R, G, B); \
306#define GP_MIX_PIXELS_RGB332(pix1, pix2, perc) \
307 GP_MIX_PIXELS_LINEAR_RGB332(pix1, pix2, perc)
314#define GP_MIX_PIXELS_LINEAR_CMYK8888(pix1, pix2, perc) ({ \
317 K = GP_PIXEL_GET_K_CMYK8888(pix1) * (perc); \
318 K += GP_PIXEL_GET_K_CMYK8888(pix2) * (255 - (perc)); \
319 K = (K + 128) / 255; \
323 Y = GP_PIXEL_GET_Y_CMYK8888(pix1) * (perc); \
324 Y += GP_PIXEL_GET_Y_CMYK8888(pix2) * (255 - (perc)); \
325 Y = (Y + 128) / 255; \
329 M = GP_PIXEL_GET_M_CMYK8888(pix1) * (perc); \
330 M += GP_PIXEL_GET_M_CMYK8888(pix2) * (255 - (perc)); \
331 M = (M + 128) / 255; \
335 C = GP_PIXEL_GET_C_CMYK8888(pix1) * (perc); \
336 C += GP_PIXEL_GET_C_CMYK8888(pix2) * (255 - (perc)); \
337 C = (C + 128) / 255; \
340 GP_PIXEL_CREATE_CMYK8888(K, Y, M, C); \
343#define GP_MIX_PIXELS_CMYK8888(pix1, pix2, perc) \
344 GP_MIX_PIXELS_LINEAR_CMYK8888(pix1, pix2, perc)
351#define GP_MIX_PIXELS_LINEAR_P2(pix1, pix2, perc) ({ \
354 P = GP_PIXEL_GET_P_P2(pix1) * (perc); \
355 P += GP_PIXEL_GET_P_P2(pix2) * (255 - (perc)); \
356 P = (P + 128) / 255; \
359 GP_PIXEL_CREATE_P2(P); \
362#define GP_MIX_PIXELS_P2(pix1, pix2, perc) \
363 GP_MIX_PIXELS_LINEAR_P2(pix1, pix2, perc)
370#define GP_MIX_PIXELS_LINEAR_P4(pix1, pix2, perc) ({ \
373 P = GP_PIXEL_GET_P_P4(pix1) * (perc); \
374 P += GP_PIXEL_GET_P_P4(pix2) * (255 - (perc)); \
375 P = (P + 128) / 255; \
378 GP_PIXEL_CREATE_P4(P); \
381#define GP_MIX_PIXELS_P4(pix1, pix2, perc) \
382 GP_MIX_PIXELS_LINEAR_P4(pix1, pix2, perc)
389#define GP_MIX_PIXELS_LINEAR_P8(pix1, pix2, perc) ({ \
392 P = GP_PIXEL_GET_P_P8(pix1) * (perc); \
393 P += GP_PIXEL_GET_P_P8(pix2) * (255 - (perc)); \
394 P = (P + 128) / 255; \
397 GP_PIXEL_CREATE_P8(P); \
400#define GP_MIX_PIXELS_P8(pix1, pix2, perc) \
401 GP_MIX_PIXELS_LINEAR_P8(pix1, pix2, perc)
408#define GP_MIX_PIXELS_LINEAR_G1_DB(pix1, pix2, perc) ({ \
411 V = GP_PIXEL_GET_V_G1_DB(pix1) * (perc); \
412 V += GP_PIXEL_GET_V_G1_DB(pix2) * (255 - (perc)); \
413 V = (V + 128) / 255; \
416 GP_PIXEL_CREATE_G1_DB(V); \
419#define GP_MIX_PIXELS_G1_DB(pix1, pix2, perc) \
420 GP_MIX_PIXELS_LINEAR_G1_DB(pix1, pix2, perc)
427#define GP_MIX_PIXELS_LINEAR_G2_DB(pix1, pix2, perc) ({ \
430 V = GP_PIXEL_GET_V_G2_DB(pix1) * (perc); \
431 V += GP_PIXEL_GET_V_G2_DB(pix2) * (255 - (perc)); \
432 V = (V + 128) / 255; \
435 GP_PIXEL_CREATE_G2_DB(V); \
438#define GP_MIX_PIXELS_G2_DB(pix1, pix2, perc) \
439 GP_MIX_PIXELS_LINEAR_G2_DB(pix1, pix2, perc)
446#define GP_MIX_PIXELS_LINEAR_G4_DB(pix1, pix2, perc) ({ \
449 V = GP_PIXEL_GET_V_G4_DB(pix1) * (perc); \
450 V += GP_PIXEL_GET_V_G4_DB(pix2) * (255 - (perc)); \
451 V = (V + 128) / 255; \
454 GP_PIXEL_CREATE_G4_DB(V); \
457#define GP_MIX_PIXELS_G4_DB(pix1, pix2, perc) \
458 GP_MIX_PIXELS_LINEAR_G4_DB(pix1, pix2, perc)
465#define GP_MIX_PIXELS_LINEAR_G1_UB(pix1, pix2, perc) ({ \
468 V = GP_PIXEL_GET_V_G1_UB(pix1) * (perc); \
469 V += GP_PIXEL_GET_V_G1_UB(pix2) * (255 - (perc)); \
470 V = (V + 128) / 255; \
473 GP_PIXEL_CREATE_G1_UB(V); \
476#define GP_MIX_PIXELS_G1_UB(pix1, pix2, perc) \
477 GP_MIX_PIXELS_LINEAR_G1_UB(pix1, pix2, perc)
484#define GP_MIX_PIXELS_LINEAR_G2_UB(pix1, pix2, perc) ({ \
487 V = GP_PIXEL_GET_V_G2_UB(pix1) * (perc); \
488 V += GP_PIXEL_GET_V_G2_UB(pix2) * (255 - (perc)); \
489 V = (V + 128) / 255; \
492 GP_PIXEL_CREATE_G2_UB(V); \
495#define GP_MIX_PIXELS_G2_UB(pix1, pix2, perc) \
496 GP_MIX_PIXELS_LINEAR_G2_UB(pix1, pix2, perc)
503#define GP_MIX_PIXELS_LINEAR_G4_UB(pix1, pix2, perc) ({ \
506 V = GP_PIXEL_GET_V_G4_UB(pix1) * (perc); \
507 V += GP_PIXEL_GET_V_G4_UB(pix2) * (255 - (perc)); \
508 V = (V + 128) / 255; \
511 GP_PIXEL_CREATE_G4_UB(V); \
514#define GP_MIX_PIXELS_G4_UB(pix1, pix2, perc) \
515 GP_MIX_PIXELS_LINEAR_G4_UB(pix1, pix2, perc)
522#define GP_MIX_PIXELS_LINEAR_G8(pix1, pix2, perc) ({ \
525 V = GP_PIXEL_GET_V_G8(pix1) * (perc); \
526 V += GP_PIXEL_GET_V_G8(pix2) * (255 - (perc)); \
527 V = (V + 128) / 255; \
530 GP_PIXEL_CREATE_G8(V); \
533#define GP_MIX_PIXELS_G8(pix1, pix2, perc) \
534 GP_MIX_PIXELS_LINEAR_G8(pix1, pix2, perc)
541#define GP_MIX_PIXELS_LINEAR_GA88(pix1, pix2, perc) ({ \
544 V = GP_PIXEL_GET_V_GA88(pix1) * (perc); \
545 V += GP_PIXEL_GET_V_GA88(pix2) * (255 - (perc)); \
546 V = (V + 128) / 255; \
550 A = GP_PIXEL_GET_A_GA88(pix1) * (perc); \
551 A += GP_PIXEL_GET_A_GA88(pix2) * (255 - (perc)); \
552 A = (A + 128) / 255; \
555 GP_PIXEL_CREATE_GA88(V, A); \
558#define GP_MIX_PIXELS_GA88(pix1, pix2, perc) \
559 GP_MIX_PIXELS_LINEAR_GA88(pix1, pix2, perc)
566#define GP_MIX_PIXELS_LINEAR_G16(pix1, pix2, perc) ({ \
569 V = GP_PIXEL_GET_V_G16(pix1) * (perc); \
570 V += GP_PIXEL_GET_V_G16(pix2) * (255 - (perc)); \
571 V = (V + 128) / 255; \
574 GP_PIXEL_CREATE_G16(V); \
577#define GP_MIX_PIXELS_G16(pix1, pix2, perc) \
578 GP_MIX_PIXELS_LINEAR_G16(pix1, pix2, perc)
583 switch (pixel_type) {
584 case GP_PIXEL_RGB101010:
585 return GP_MIX_PIXELS_LINEAR_RGB101010(pix1, pix2, perc);
586 case GP_PIXEL_xRGB8888:
587 return GP_MIX_PIXELS_LINEAR_xRGB8888(pix1, pix2, perc);
588 case GP_PIXEL_RGBA8888:
589 return GP_MIX_PIXELS_LINEAR_RGBA8888(pix1, pix2, perc);
590 case GP_PIXEL_RGB888:
591 return GP_MIX_PIXELS_LINEAR_RGB888(pix1, pix2, perc);
592 case GP_PIXEL_BGR888:
593 return GP_MIX_PIXELS_LINEAR_BGR888(pix1, pix2, perc);
594 case GP_PIXEL_RGB555:
595 return GP_MIX_PIXELS_LINEAR_RGB555(pix1, pix2, perc);
596 case GP_PIXEL_RGB565:
597 return GP_MIX_PIXELS_LINEAR_RGB565(pix1, pix2, perc);
598 case GP_PIXEL_RGB666:
599 return GP_MIX_PIXELS_LINEAR_RGB666(pix1, pix2, perc);
600 case GP_PIXEL_RGB332:
601 return GP_MIX_PIXELS_LINEAR_RGB332(pix1, pix2, perc);
602 case GP_PIXEL_CMYK8888:
603 return GP_MIX_PIXELS_LINEAR_CMYK8888(pix1, pix2, perc);
605 return GP_MIX_PIXELS_LINEAR_P2(pix1, pix2, perc);
607 return GP_MIX_PIXELS_LINEAR_P4(pix1, pix2, perc);
609 return GP_MIX_PIXELS_LINEAR_P8(pix1, pix2, perc);
611 return GP_MIX_PIXELS_LINEAR_G1_DB(pix1, pix2, perc);
613 return GP_MIX_PIXELS_LINEAR_G2_DB(pix1, pix2, perc);
615 return GP_MIX_PIXELS_LINEAR_G4_DB(pix1, pix2, perc);
617 return GP_MIX_PIXELS_LINEAR_G1_UB(pix1, pix2, perc);
619 return GP_MIX_PIXELS_LINEAR_G2_UB(pix1, pix2, perc);
621 return GP_MIX_PIXELS_LINEAR_G4_UB(pix1, pix2, perc);
623 return GP_MIX_PIXELS_LINEAR_G8(pix1, pix2, perc);
625 return GP_MIX_PIXELS_LINEAR_GA88(pix1, pix2, perc);
627 return GP_MIX_PIXELS_LINEAR_G16(pix1, pix2, perc);
629 GP_ABORT(
"Unknown pixeltype");
634static inline void gp_mix_pixel_raw_RGB101010(
gp_pixmap *pixmap,
638 pix = GP_MIX_PIXELS_RGB101010(pixel, pix, perc);
642static inline void gp_mix_pixel_raw_xRGB8888(
gp_pixmap *pixmap,
646 pix = GP_MIX_PIXELS_xRGB8888(pixel, pix, perc);
650static inline void gp_mix_pixel_raw_RGBA8888(
gp_pixmap *pixmap,
654 pix = GP_MIX_PIXELS_RGBA8888(pixel, pix, perc);
658static inline void gp_mix_pixel_raw_RGB888(
gp_pixmap *pixmap,
662 pix = GP_MIX_PIXELS_RGB888(pixel, pix, perc);
666static inline void gp_mix_pixel_raw_BGR888(
gp_pixmap *pixmap,
670 pix = GP_MIX_PIXELS_BGR888(pixel, pix, perc);
674static inline void gp_mix_pixel_raw_RGB555(
gp_pixmap *pixmap,
678 pix = GP_MIX_PIXELS_RGB555(pixel, pix, perc);
682static inline void gp_mix_pixel_raw_RGB565(
gp_pixmap *pixmap,
686 pix = GP_MIX_PIXELS_RGB565(pixel, pix, perc);
690static inline void gp_mix_pixel_raw_RGB666(
gp_pixmap *pixmap,
694 pix = GP_MIX_PIXELS_RGB666(pixel, pix, perc);
698static inline void gp_mix_pixel_raw_RGB332(
gp_pixmap *pixmap,
702 pix = GP_MIX_PIXELS_RGB332(pixel, pix, perc);
706static inline void gp_mix_pixel_raw_CMYK8888(
gp_pixmap *pixmap,
710 pix = GP_MIX_PIXELS_CMYK8888(pixel, pix, perc);
714static inline void gp_mix_pixel_raw_P2(
gp_pixmap *pixmap,
718 pix = GP_MIX_PIXELS_P2(pixel, pix, perc);
722static inline void gp_mix_pixel_raw_P4(
gp_pixmap *pixmap,
726 pix = GP_MIX_PIXELS_P4(pixel, pix, perc);
730static inline void gp_mix_pixel_raw_P8(
gp_pixmap *pixmap,
734 pix = GP_MIX_PIXELS_P8(pixel, pix, perc);
738static inline void gp_mix_pixel_raw_G1_DB(
gp_pixmap *pixmap,
742 pix = GP_MIX_PIXELS_G1_DB(pixel, pix, perc);
746static inline void gp_mix_pixel_raw_G2_DB(
gp_pixmap *pixmap,
750 pix = GP_MIX_PIXELS_G2_DB(pixel, pix, perc);
754static inline void gp_mix_pixel_raw_G4_DB(
gp_pixmap *pixmap,
758 pix = GP_MIX_PIXELS_G4_DB(pixel, pix, perc);
762static inline void gp_mix_pixel_raw_G1_UB(
gp_pixmap *pixmap,
766 pix = GP_MIX_PIXELS_G1_UB(pixel, pix, perc);
770static inline void gp_mix_pixel_raw_G2_UB(
gp_pixmap *pixmap,
774 pix = GP_MIX_PIXELS_G2_UB(pixel, pix, perc);
778static inline void gp_mix_pixel_raw_G4_UB(
gp_pixmap *pixmap,
782 pix = GP_MIX_PIXELS_G4_UB(pixel, pix, perc);
786static inline void gp_mix_pixel_raw_G8(
gp_pixmap *pixmap,
790 pix = GP_MIX_PIXELS_G8(pixel, pix, perc);
794static inline void gp_mix_pixel_raw_GA88(
gp_pixmap *pixmap,
798 pix = GP_MIX_PIXELS_GA88(pixel, pix, perc);
802static inline void gp_mix_pixel_raw_G16(
gp_pixmap *pixmap,
806 pix = GP_MIX_PIXELS_G16(pixel, pix, perc);
811static inline void gp_mix_pixel_raw_clipped_RGB101010(
gp_pixmap *pixmap,
817 gp_mix_pixel_raw_RGB101010(pixmap, x, y, pixel, perc);
820static inline void gp_mix_pixel_raw_clipped_xRGB8888(
gp_pixmap *pixmap,
826 gp_mix_pixel_raw_xRGB8888(pixmap, x, y, pixel, perc);
829static inline void gp_mix_pixel_raw_clipped_RGBA8888(
gp_pixmap *pixmap,
835 gp_mix_pixel_raw_RGBA8888(pixmap, x, y, pixel, perc);
838static inline void gp_mix_pixel_raw_clipped_RGB888(
gp_pixmap *pixmap,
844 gp_mix_pixel_raw_RGB888(pixmap, x, y, pixel, perc);
847static inline void gp_mix_pixel_raw_clipped_BGR888(
gp_pixmap *pixmap,
853 gp_mix_pixel_raw_BGR888(pixmap, x, y, pixel, perc);
856static inline void gp_mix_pixel_raw_clipped_RGB555(
gp_pixmap *pixmap,
862 gp_mix_pixel_raw_RGB555(pixmap, x, y, pixel, perc);
865static inline void gp_mix_pixel_raw_clipped_RGB565(
gp_pixmap *pixmap,
871 gp_mix_pixel_raw_RGB565(pixmap, x, y, pixel, perc);
874static inline void gp_mix_pixel_raw_clipped_RGB666(
gp_pixmap *pixmap,
880 gp_mix_pixel_raw_RGB666(pixmap, x, y, pixel, perc);
883static inline void gp_mix_pixel_raw_clipped_RGB332(
gp_pixmap *pixmap,
889 gp_mix_pixel_raw_RGB332(pixmap, x, y, pixel, perc);
892static inline void gp_mix_pixel_raw_clipped_CMYK8888(
gp_pixmap *pixmap,
898 gp_mix_pixel_raw_CMYK8888(pixmap, x, y, pixel, perc);
901static inline void gp_mix_pixel_raw_clipped_P2(
gp_pixmap *pixmap,
907 gp_mix_pixel_raw_P2(pixmap, x, y, pixel, perc);
910static inline void gp_mix_pixel_raw_clipped_P4(
gp_pixmap *pixmap,
916 gp_mix_pixel_raw_P4(pixmap, x, y, pixel, perc);
919static inline void gp_mix_pixel_raw_clipped_P8(
gp_pixmap *pixmap,
925 gp_mix_pixel_raw_P8(pixmap, x, y, pixel, perc);
928static inline void gp_mix_pixel_raw_clipped_G1_DB(
gp_pixmap *pixmap,
934 gp_mix_pixel_raw_G1_DB(pixmap, x, y, pixel, perc);
937static inline void gp_mix_pixel_raw_clipped_G2_DB(
gp_pixmap *pixmap,
943 gp_mix_pixel_raw_G2_DB(pixmap, x, y, pixel, perc);
946static inline void gp_mix_pixel_raw_clipped_G4_DB(
gp_pixmap *pixmap,
952 gp_mix_pixel_raw_G4_DB(pixmap, x, y, pixel, perc);
955static inline void gp_mix_pixel_raw_clipped_G1_UB(
gp_pixmap *pixmap,
961 gp_mix_pixel_raw_G1_UB(pixmap, x, y, pixel, perc);
964static inline void gp_mix_pixel_raw_clipped_G2_UB(
gp_pixmap *pixmap,
970 gp_mix_pixel_raw_G2_UB(pixmap, x, y, pixel, perc);
973static inline void gp_mix_pixel_raw_clipped_G4_UB(
gp_pixmap *pixmap,
979 gp_mix_pixel_raw_G4_UB(pixmap, x, y, pixel, perc);
982static inline void gp_mix_pixel_raw_clipped_G8(
gp_pixmap *pixmap,
988 gp_mix_pixel_raw_G8(pixmap, x, y, pixel, perc);
991static inline void gp_mix_pixel_raw_clipped_GA88(
gp_pixmap *pixmap,
997 gp_mix_pixel_raw_GA88(pixmap, x, y, pixel, perc);
1000static inline void gp_mix_pixel_raw_clipped_G16(
gp_pixmap *pixmap,
1006 gp_mix_pixel_raw_G16(pixmap, x, y, pixel, perc);
1014 case GP_PIXEL_RGB101010:
1015 gp_mix_pixel_raw_RGB101010(pixmap, x, y, pixel, perc);
1017 case GP_PIXEL_xRGB8888:
1018 gp_mix_pixel_raw_xRGB8888(pixmap, x, y, pixel, perc);
1020 case GP_PIXEL_RGBA8888:
1021 gp_mix_pixel_raw_RGBA8888(pixmap, x, y, pixel, perc);
1023 case GP_PIXEL_RGB888:
1024 gp_mix_pixel_raw_RGB888(pixmap, x, y, pixel, perc);
1026 case GP_PIXEL_BGR888:
1027 gp_mix_pixel_raw_BGR888(pixmap, x, y, pixel, perc);
1029 case GP_PIXEL_RGB555:
1030 gp_mix_pixel_raw_RGB555(pixmap, x, y, pixel, perc);
1032 case GP_PIXEL_RGB565:
1033 gp_mix_pixel_raw_RGB565(pixmap, x, y, pixel, perc);
1035 case GP_PIXEL_RGB666:
1036 gp_mix_pixel_raw_RGB666(pixmap, x, y, pixel, perc);
1038 case GP_PIXEL_RGB332:
1039 gp_mix_pixel_raw_RGB332(pixmap, x, y, pixel, perc);
1041 case GP_PIXEL_CMYK8888:
1042 gp_mix_pixel_raw_CMYK8888(pixmap, x, y, pixel, perc);
1045 gp_mix_pixel_raw_P2(pixmap, x, y, pixel, perc);
1048 gp_mix_pixel_raw_P4(pixmap, x, y, pixel, perc);
1051 gp_mix_pixel_raw_P8(pixmap, x, y, pixel, perc);
1053 case GP_PIXEL_G1_DB:
1054 gp_mix_pixel_raw_G1_DB(pixmap, x, y, pixel, perc);
1056 case GP_PIXEL_G2_DB:
1057 gp_mix_pixel_raw_G2_DB(pixmap, x, y, pixel, perc);
1059 case GP_PIXEL_G4_DB:
1060 gp_mix_pixel_raw_G4_DB(pixmap, x, y, pixel, perc);
1062 case GP_PIXEL_G1_UB:
1063 gp_mix_pixel_raw_G1_UB(pixmap, x, y, pixel, perc);
1065 case GP_PIXEL_G2_UB:
1066 gp_mix_pixel_raw_G2_UB(pixmap, x, y, pixel, perc);
1068 case GP_PIXEL_G4_UB:
1069 gp_mix_pixel_raw_G4_UB(pixmap, x, y, pixel, perc);
1072 gp_mix_pixel_raw_G8(pixmap, x, y, pixel, perc);
1075 gp_mix_pixel_raw_GA88(pixmap, x, y, pixel, perc);
1078 gp_mix_pixel_raw_G16(pixmap, x, y, pixel, perc);
1081 GP_ABORT(
"Unknown pixeltype");
1085static inline void gp_mix_pixel_raw_clipped(
gp_pixmap *pixmap,
1090 case GP_PIXEL_RGB101010:
1091 gp_mix_pixel_raw_clipped_RGB101010(pixmap, x, y, pixel, perc);
1093 case GP_PIXEL_xRGB8888:
1094 gp_mix_pixel_raw_clipped_xRGB8888(pixmap, x, y, pixel, perc);
1096 case GP_PIXEL_RGBA8888:
1097 gp_mix_pixel_raw_clipped_RGBA8888(pixmap, x, y, pixel, perc);
1099 case GP_PIXEL_RGB888:
1100 gp_mix_pixel_raw_clipped_RGB888(pixmap, x, y, pixel, perc);
1102 case GP_PIXEL_BGR888:
1103 gp_mix_pixel_raw_clipped_BGR888(pixmap, x, y, pixel, perc);
1105 case GP_PIXEL_RGB555:
1106 gp_mix_pixel_raw_clipped_RGB555(pixmap, x, y, pixel, perc);
1108 case GP_PIXEL_RGB565:
1109 gp_mix_pixel_raw_clipped_RGB565(pixmap, x, y, pixel, perc);
1111 case GP_PIXEL_RGB666:
1112 gp_mix_pixel_raw_clipped_RGB666(pixmap, x, y, pixel, perc);
1114 case GP_PIXEL_RGB332:
1115 gp_mix_pixel_raw_clipped_RGB332(pixmap, x, y, pixel, perc);
1117 case GP_PIXEL_CMYK8888:
1118 gp_mix_pixel_raw_clipped_CMYK8888(pixmap, x, y, pixel, perc);
1121 gp_mix_pixel_raw_clipped_P2(pixmap, x, y, pixel, perc);
1124 gp_mix_pixel_raw_clipped_P4(pixmap, x, y, pixel, perc);
1127 gp_mix_pixel_raw_clipped_P8(pixmap, x, y, pixel, perc);
1129 case GP_PIXEL_G1_DB:
1130 gp_mix_pixel_raw_clipped_G1_DB(pixmap, x, y, pixel, perc);
1132 case GP_PIXEL_G2_DB:
1133 gp_mix_pixel_raw_clipped_G2_DB(pixmap, x, y, pixel, perc);
1135 case GP_PIXEL_G4_DB:
1136 gp_mix_pixel_raw_clipped_G4_DB(pixmap, x, y, pixel, perc);
1138 case GP_PIXEL_G1_UB:
1139 gp_mix_pixel_raw_clipped_G1_UB(pixmap, x, y, pixel, perc);
1141 case GP_PIXEL_G2_UB:
1142 gp_mix_pixel_raw_clipped_G2_UB(pixmap, x, y, pixel, perc);
1144 case GP_PIXEL_G4_UB:
1145 gp_mix_pixel_raw_clipped_G4_UB(pixmap, x, y, pixel, perc);
1148 gp_mix_pixel_raw_clipped_G8(pixmap, x, y, pixel, perc);
1151 gp_mix_pixel_raw_clipped_GA88(pixmap, x, y, pixel, perc);
1154 gp_mix_pixel_raw_clipped_G16(pixmap, x, y, pixel, perc);
1157 GP_ABORT(
"Unknown pixeltype");
uint32_t gp_pixel
Pixel integer value.
int gp_coord
Integer type for coordinates i.e. x, y, ...
Gamma and sRGB corrections.
static void gp_putpixel_raw_18BPP_DB(gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
gp_putpixel for 18BPP_DB
static gp_pixel gp_getpixel_raw_24BPP(const gp_pixmap *c, gp_coord x, gp_coord y)
gp_getpixel for 24BPP
static void gp_putpixel_raw_1BPP_DB(gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
gp_putpixel for 1BPP_DB
static void gp_putpixel_raw_1BPP_UB(gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
gp_putpixel for 1BPP_UB
static gp_pixel gp_getpixel_raw_1BPP_DB(const gp_pixmap *c, gp_coord x, gp_coord y)
gp_getpixel for 1BPP_DB
static void gp_putpixel_raw_16BPP(gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
gp_putpixel for 16BPP
static void gp_putpixel_raw_24BPP(gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
gp_putpixel for 24BPP
static gp_pixel gp_getpixel_raw_1BPP_UB(const gp_pixmap *c, gp_coord x, gp_coord y)
gp_getpixel for 1BPP_UB
static void gp_putpixel_raw_4BPP_DB(gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
gp_putpixel for 4BPP_DB
static void gp_putpixel_raw_32BPP(gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
gp_putpixel for 32BPP
static gp_pixel gp_getpixel_raw_2BPP_UB(const gp_pixmap *c, gp_coord x, gp_coord y)
gp_getpixel for 2BPP_UB
static gp_pixel gp_getpixel_raw_18BPP_DB(const gp_pixmap *c, gp_coord x, gp_coord y)
gp_getpixel for 18BPP_DB
static void gp_putpixel_raw_4BPP_UB(gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
gp_putpixel for 4BPP_UB
static gp_pixel gp_getpixel_raw_8BPP(const gp_pixmap *c, gp_coord x, gp_coord y)
gp_getpixel for 8BPP
static gp_pixel gp_getpixel_raw_4BPP_DB(const gp_pixmap *c, gp_coord x, gp_coord y)
gp_getpixel for 4BPP_DB
static void gp_putpixel_raw_2BPP_DB(gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
gp_putpixel for 2BPP_DB
static gp_pixel gp_getpixel_raw_32BPP(const gp_pixmap *c, gp_coord x, gp_coord y)
gp_getpixel for 32BPP
static void gp_putpixel_raw_8BPP(gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
gp_putpixel for 8BPP
static void gp_putpixel_raw_2BPP_UB(gp_pixmap *c, gp_coord x, gp_coord y, gp_pixel p)
gp_putpixel for 2BPP_UB
static gp_pixel gp_getpixel_raw_4BPP_UB(const gp_pixmap *c, gp_coord x, gp_coord y)
gp_getpixel for 4BPP_UB
static gp_pixel gp_getpixel_raw_2BPP_DB(const gp_pixmap *c, gp_coord x, gp_coord y)
gp_getpixel for 2BPP_DB
static gp_pixel gp_getpixel_raw_16BPP(const gp_pixmap *c, gp_coord x, gp_coord y)
gp_getpixel for 16BPP
gp_pixel_type
List of all pixel types.
#define GP_PIXEL_IS_CLIPPED(pixmap, x, y)
Returns true when pixel is clipped out of pixmap.
enum gp_pixel_type pixel_type
A pixel format.