GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_pixel_channel.gen.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.1-or-later
2/*
3 * gp_pixel_channel.gen.h
4 *
5 * GENERATED on 2025 11 30 21:24:31 from gp_pixel_channel.gen.h.t
6 *
7 * DO NOT MODIFY THIS FILE DIRECTLY!
8 */
9#ifndef GP_PIXEL_CHANNEL_GEN_H
10#define GP_PIXEL_CHANNEL_GEN_H
11
12/*
13 * Pixel channel operations.
14 *
15 * Copyright (C) 2011 Tomas Gavenciak <gavento@ucw.cz>
16 * Copyright (C) 2013-2025 Cyril Hrubis <metan@ucw.cz>
17 */
18
27
28#include <core/gp_clamp.h>
30
34#define GP_PIXEL_GET_R_RGB101010(p) (GP_GET_BITS(20, 10, (p)))
35#define GP_PIXEL_GET_G_RGB101010(p) (GP_GET_BITS(10, 10, (p)))
36#define GP_PIXEL_GET_B_RGB101010(p) (GP_GET_BITS(0, 10, (p)))
37
38/*
39 * macros to create gp_pixel of pixel type RGB101010 directly from given values.
40 * The values MUST be already clipped/converted to relevant value ranges.
41 */
42#define GP_PIXEL_CREATE_RGB101010(R, G, B) (0\
43 + ((R) << 20) \
44 + ((G) << 10) \
45 + ((B) << 0) \
46 )
47
48/*
49 * macros to do per-channel operations on a pixel.
50 */
54#define GP_PIXEL_GET_R_xRGB8888(p) (GP_GET_BITS(16, 8, (p)))
55#define GP_PIXEL_GET_G_xRGB8888(p) (GP_GET_BITS(8, 8, (p)))
56#define GP_PIXEL_GET_B_xRGB8888(p) (GP_GET_BITS(0, 8, (p)))
57
58/*
59 * macros to create gp_pixel of pixel type xRGB8888 directly from given values.
60 * The values MUST be already clipped/converted to relevant value ranges.
61 */
62#define GP_PIXEL_CREATE_xRGB8888(R, G, B) (0\
63 + ((R) << 16) \
64 + ((G) << 8) \
65 + ((B) << 0) \
66 )
67
68/*
69 * macros to do per-channel operations on a pixel.
70 */
74#define GP_PIXEL_GET_R_RGBA8888(p) (GP_GET_BITS(24, 8, (p)))
75#define GP_PIXEL_GET_G_RGBA8888(p) (GP_GET_BITS(16, 8, (p)))
76#define GP_PIXEL_GET_B_RGBA8888(p) (GP_GET_BITS(8, 8, (p)))
77#define GP_PIXEL_GET_A_RGBA8888(p) (GP_GET_BITS(0, 8, (p)))
78
79/*
80 * macros to create gp_pixel of pixel type RGBA8888 directly from given values.
81 * The values MUST be already clipped/converted to relevant value ranges.
82 */
83#define GP_PIXEL_CREATE_RGBA8888(R, G, B, A) (0\
84 + ((R) << 24) \
85 + ((G) << 16) \
86 + ((B) << 8) \
87 + ((A) << 0) \
88 )
89
90/*
91 * macros to do per-channel operations on a pixel.
92 */
96#define GP_PIXEL_GET_R_RGB888(p) (GP_GET_BITS(16, 8, (p)))
97#define GP_PIXEL_GET_G_RGB888(p) (GP_GET_BITS(8, 8, (p)))
98#define GP_PIXEL_GET_B_RGB888(p) (GP_GET_BITS(0, 8, (p)))
99
100/*
101 * macros to create gp_pixel of pixel type RGB888 directly from given values.
102 * The values MUST be already clipped/converted to relevant value ranges.
103 */
104#define GP_PIXEL_CREATE_RGB888(R, G, B) (0\
105 + ((R) << 16) \
106 + ((G) << 8) \
107 + ((B) << 0) \
108 )
109
110/*
111 * macros to do per-channel operations on a pixel.
112 */
116#define GP_PIXEL_GET_B_BGR888(p) (GP_GET_BITS(16, 8, (p)))
117#define GP_PIXEL_GET_G_BGR888(p) (GP_GET_BITS(8, 8, (p)))
118#define GP_PIXEL_GET_R_BGR888(p) (GP_GET_BITS(0, 8, (p)))
119
120/*
121 * macros to create gp_pixel of pixel type BGR888 directly from given values.
122 * The values MUST be already clipped/converted to relevant value ranges.
123 */
124#define GP_PIXEL_CREATE_BGR888(B, G, R) (0\
125 + ((B) << 16) \
126 + ((G) << 8) \
127 + ((R) << 0) \
128 )
129
130/*
131 * macros to do per-channel operations on a pixel.
132 */
136#define GP_PIXEL_GET_R_RGB555(p) (GP_GET_BITS(10, 5, (p)))
137#define GP_PIXEL_GET_G_RGB555(p) (GP_GET_BITS(5, 5, (p)))
138#define GP_PIXEL_GET_B_RGB555(p) (GP_GET_BITS(0, 5, (p)))
139
140/*
141 * macros to create gp_pixel of pixel type RGB555 directly from given values.
142 * The values MUST be already clipped/converted to relevant value ranges.
143 */
144#define GP_PIXEL_CREATE_RGB555(R, G, B) (0\
145 + ((R) << 10) \
146 + ((G) << 5) \
147 + ((B) << 0) \
148 )
149
150/*
151 * macros to do per-channel operations on a pixel.
152 */
156#define GP_PIXEL_GET_R_RGB565_BE(p) (GP_GET_BITS(11, 5, (p)))
157#define GP_PIXEL_GET_G_RGB565_BE(p) (GP_GET_BITS(5, 6, (p)))
158#define GP_PIXEL_GET_B_RGB565_BE(p) (GP_GET_BITS(0, 5, (p)))
159
160/*
161 * macros to create gp_pixel of pixel type RGB565_BE directly from given values.
162 * The values MUST be already clipped/converted to relevant value ranges.
163 */
164#define GP_PIXEL_CREATE_RGB565_BE(R, G, B) (0\
165 + ((R) << 11) \
166 + ((G) << 5) \
167 + ((B) << 0) \
168 )
169
170/*
171 * macros to do per-channel operations on a pixel.
172 */
176#define GP_PIXEL_GET_R_RGB565_LE(p) (GP_GET_BITS(11, 5, (p)))
177#define GP_PIXEL_GET_G_RGB565_LE(p) (GP_GET_BITS(5, 6, (p)))
178#define GP_PIXEL_GET_B_RGB565_LE(p) (GP_GET_BITS(0, 5, (p)))
179
180/*
181 * macros to create gp_pixel of pixel type RGB565_LE directly from given values.
182 * The values MUST be already clipped/converted to relevant value ranges.
183 */
184#define GP_PIXEL_CREATE_RGB565_LE(R, G, B) (0\
185 + ((R) << 11) \
186 + ((G) << 5) \
187 + ((B) << 0) \
188 )
189
190/*
191 * macros to do per-channel operations on a pixel.
192 */
196#define GP_PIXEL_GET_R_RGB666(p) (GP_GET_BITS(12, 6, (p)))
197#define GP_PIXEL_GET_G_RGB666(p) (GP_GET_BITS(6, 6, (p)))
198#define GP_PIXEL_GET_B_RGB666(p) (GP_GET_BITS(0, 6, (p)))
199
200/*
201 * macros to create gp_pixel of pixel type RGB666 directly from given values.
202 * The values MUST be already clipped/converted to relevant value ranges.
203 */
204#define GP_PIXEL_CREATE_RGB666(R, G, B) (0\
205 + ((R) << 12) \
206 + ((G) << 6) \
207 + ((B) << 0) \
208 )
209
210/*
211 * macros to do per-channel operations on a pixel.
212 */
216#define GP_PIXEL_GET_R_RGB332(p) (GP_GET_BITS(5, 3, (p)))
217#define GP_PIXEL_GET_G_RGB332(p) (GP_GET_BITS(2, 3, (p)))
218#define GP_PIXEL_GET_B_RGB332(p) (GP_GET_BITS(0, 2, (p)))
219
220/*
221 * macros to create gp_pixel of pixel type RGB332 directly from given values.
222 * The values MUST be already clipped/converted to relevant value ranges.
223 */
224#define GP_PIXEL_CREATE_RGB332(R, G, B) (0\
225 + ((R) << 5) \
226 + ((G) << 2) \
227 + ((B) << 0) \
228 )
229
230/*
231 * macros to do per-channel operations on a pixel.
232 */
236#define GP_PIXEL_GET_K_CMYK8888(p) (GP_GET_BITS(24, 8, (p)))
237#define GP_PIXEL_GET_Y_CMYK8888(p) (GP_GET_BITS(16, 8, (p)))
238#define GP_PIXEL_GET_M_CMYK8888(p) (GP_GET_BITS(8, 8, (p)))
239#define GP_PIXEL_GET_C_CMYK8888(p) (GP_GET_BITS(0, 8, (p)))
240
241/*
242 * macros to create gp_pixel of pixel type CMYK8888 directly from given values.
243 * The values MUST be already clipped/converted to relevant value ranges.
244 */
245#define GP_PIXEL_CREATE_CMYK8888(K, Y, M, C) (0\
246 + ((K) << 24) \
247 + ((Y) << 16) \
248 + ((M) << 8) \
249 + ((C) << 0) \
250 )
251
252/*
253 * macros to do per-channel operations on a pixel.
254 */
258#define GP_PIXEL_GET_P_P2(p) (GP_GET_BITS(0, 2, (p)))
259
260/*
261 * macros to create gp_pixel of pixel type P2 directly from given values.
262 * The values MUST be already clipped/converted to relevant value ranges.
263 */
264#define GP_PIXEL_CREATE_P2(P) (0\
265 + ((P) << 0) \
266 )
267
268/*
269 * macros to do per-channel operations on a pixel.
270 */
274#define GP_PIXEL_GET_P_P4(p) (GP_GET_BITS(0, 4, (p)))
275
276/*
277 * macros to create gp_pixel of pixel type P4 directly from given values.
278 * The values MUST be already clipped/converted to relevant value ranges.
279 */
280#define GP_PIXEL_CREATE_P4(P) (0\
281 + ((P) << 0) \
282 )
283
284/*
285 * macros to do per-channel operations on a pixel.
286 */
290#define GP_PIXEL_GET_P_P8(p) (GP_GET_BITS(0, 8, (p)))
291
292/*
293 * macros to create gp_pixel of pixel type P8 directly from given values.
294 * The values MUST be already clipped/converted to relevant value ranges.
295 */
296#define GP_PIXEL_CREATE_P8(P) (0\
297 + ((P) << 0) \
298 )
299
300/*
301 * macros to do per-channel operations on a pixel.
302 */
306#define GP_PIXEL_GET_V_G1_DB(p) (GP_GET_BITS(0, 1, (p)))
307
308/*
309 * macros to create gp_pixel of pixel type G1_DB directly from given values.
310 * The values MUST be already clipped/converted to relevant value ranges.
311 */
312#define GP_PIXEL_CREATE_G1_DB(V) (0\
313 + ((V) << 0) \
314 )
315
316/*
317 * macros to do per-channel operations on a pixel.
318 */
322#define GP_PIXEL_GET_V_G2_DB(p) (GP_GET_BITS(0, 2, (p)))
323
324/*
325 * macros to create gp_pixel of pixel type G2_DB directly from given values.
326 * The values MUST be already clipped/converted to relevant value ranges.
327 */
328#define GP_PIXEL_CREATE_G2_DB(V) (0\
329 + ((V) << 0) \
330 )
331
332/*
333 * macros to do per-channel operations on a pixel.
334 */
338#define GP_PIXEL_GET_V_G4_DB(p) (GP_GET_BITS(0, 4, (p)))
339
340/*
341 * macros to create gp_pixel of pixel type G4_DB directly from given values.
342 * The values MUST be already clipped/converted to relevant value ranges.
343 */
344#define GP_PIXEL_CREATE_G4_DB(V) (0\
345 + ((V) << 0) \
346 )
347
348/*
349 * macros to do per-channel operations on a pixel.
350 */
354#define GP_PIXEL_GET_V_G1_UB(p) (GP_GET_BITS(0, 1, (p)))
355
356/*
357 * macros to create gp_pixel of pixel type G1_UB directly from given values.
358 * The values MUST be already clipped/converted to relevant value ranges.
359 */
360#define GP_PIXEL_CREATE_G1_UB(V) (0\
361 + ((V) << 0) \
362 )
363
364/*
365 * macros to do per-channel operations on a pixel.
366 */
370#define GP_PIXEL_GET_V_G2_UB(p) (GP_GET_BITS(0, 2, (p)))
371
372/*
373 * macros to create gp_pixel of pixel type G2_UB directly from given values.
374 * The values MUST be already clipped/converted to relevant value ranges.
375 */
376#define GP_PIXEL_CREATE_G2_UB(V) (0\
377 + ((V) << 0) \
378 )
379
380/*
381 * macros to do per-channel operations on a pixel.
382 */
386#define GP_PIXEL_GET_V_G4_UB(p) (GP_GET_BITS(0, 4, (p)))
387
388/*
389 * macros to create gp_pixel of pixel type G4_UB directly from given values.
390 * The values MUST be already clipped/converted to relevant value ranges.
391 */
392#define GP_PIXEL_CREATE_G4_UB(V) (0\
393 + ((V) << 0) \
394 )
395
396/*
397 * macros to do per-channel operations on a pixel.
398 */
402#define GP_PIXEL_GET_V_G8(p) (GP_GET_BITS(0, 8, (p)))
403
404/*
405 * macros to create gp_pixel of pixel type G8 directly from given values.
406 * The values MUST be already clipped/converted to relevant value ranges.
407 */
408#define GP_PIXEL_CREATE_G8(V) (0\
409 + ((V) << 0) \
410 )
411
412/*
413 * macros to do per-channel operations on a pixel.
414 */
418#define GP_PIXEL_GET_V_GA88(p) (GP_GET_BITS(0, 8, (p)))
419#define GP_PIXEL_GET_A_GA88(p) (GP_GET_BITS(8, 8, (p)))
420
421/*
422 * macros to create gp_pixel of pixel type GA88 directly from given values.
423 * The values MUST be already clipped/converted to relevant value ranges.
424 */
425#define GP_PIXEL_CREATE_GA88(V, A) (0\
426 + ((V) << 0) \
427 + ((A) << 8) \
428 )
429
430/*
431 * macros to do per-channel operations on a pixel.
432 */
436#define GP_PIXEL_GET_V_G16(p) (GP_GET_BITS(0, 16, (p)))
437
438/*
439 * macros to create gp_pixel of pixel type G16 directly from given values.
440 * The values MUST be already clipped/converted to relevant value ranges.
441 */
442#define GP_PIXEL_CREATE_G16(V) (0\
443 + ((V) << 0) \
444 )
445
446/*
447 * macros to do per-channel operations on a pixel.
448 */
449#define GP_PIXEL_CHANS_ADD_RGB101010(pixel, perc) \
450 GP_PIXEL_CREATE_RGB101010( \
451 GP_SAT_ADD(GP_PIXEL_GET_R_RGB101010(pixel), 0x3ff * perc / 100, 0x3ff), \
452 GP_SAT_ADD(GP_PIXEL_GET_G_RGB101010(pixel), 0x3ff * perc / 100, 0x3ff), \
453 GP_SAT_ADD(GP_PIXEL_GET_B_RGB101010(pixel), 0x3ff * perc / 100, 0x3ff) \
454 )
455
456#define GP_PIXEL_CHANS_ADD_xRGB8888(pixel, perc) \
457 GP_PIXEL_CREATE_xRGB8888( \
458 GP_SAT_ADD(GP_PIXEL_GET_R_xRGB8888(pixel), 0xff * perc / 100, 0xff), \
459 GP_SAT_ADD(GP_PIXEL_GET_G_xRGB8888(pixel), 0xff * perc / 100, 0xff), \
460 GP_SAT_ADD(GP_PIXEL_GET_B_xRGB8888(pixel), 0xff * perc / 100, 0xff) \
461 )
462
463#define GP_PIXEL_CHANS_ADD_RGBA8888(pixel, perc) \
464 GP_PIXEL_CREATE_RGBA8888( \
465 GP_SAT_ADD(GP_PIXEL_GET_R_RGBA8888(pixel), 0xff * perc / 100, 0xff), \
466 GP_SAT_ADD(GP_PIXEL_GET_G_RGBA8888(pixel), 0xff * perc / 100, 0xff), \
467 GP_SAT_ADD(GP_PIXEL_GET_B_RGBA8888(pixel), 0xff * perc / 100, 0xff), \
468 GP_PIXEL_GET_A_RGBA8888(pixel) \
469 )
470
471#define GP_PIXEL_CHANS_ADD_RGB888(pixel, perc) \
472 GP_PIXEL_CREATE_RGB888( \
473 GP_SAT_ADD(GP_PIXEL_GET_R_RGB888(pixel), 0xff * perc / 100, 0xff), \
474 GP_SAT_ADD(GP_PIXEL_GET_G_RGB888(pixel), 0xff * perc / 100, 0xff), \
475 GP_SAT_ADD(GP_PIXEL_GET_B_RGB888(pixel), 0xff * perc / 100, 0xff) \
476 )
477
478#define GP_PIXEL_CHANS_ADD_BGR888(pixel, perc) \
479 GP_PIXEL_CREATE_BGR888( \
480 GP_SAT_ADD(GP_PIXEL_GET_B_BGR888(pixel), 0xff * perc / 100, 0xff), \
481 GP_SAT_ADD(GP_PIXEL_GET_G_BGR888(pixel), 0xff * perc / 100, 0xff), \
482 GP_SAT_ADD(GP_PIXEL_GET_R_BGR888(pixel), 0xff * perc / 100, 0xff) \
483 )
484
485#define GP_PIXEL_CHANS_ADD_RGB555(pixel, perc) \
486 GP_PIXEL_CREATE_RGB555( \
487 GP_SAT_ADD(GP_PIXEL_GET_R_RGB555(pixel), 0x1f * perc / 100, 0x1f), \
488 GP_SAT_ADD(GP_PIXEL_GET_G_RGB555(pixel), 0x1f * perc / 100, 0x1f), \
489 GP_SAT_ADD(GP_PIXEL_GET_B_RGB555(pixel), 0x1f * perc / 100, 0x1f) \
490 )
491
492#define GP_PIXEL_CHANS_ADD_RGB565_BE(pixel, perc) \
493 GP_PIXEL_CREATE_RGB565_BE( \
494 GP_SAT_ADD(GP_PIXEL_GET_R_RGB565_BE(pixel), 0x1f * perc / 100, 0x1f), \
495 GP_SAT_ADD(GP_PIXEL_GET_G_RGB565_BE(pixel), 0x3f * perc / 100, 0x3f), \
496 GP_SAT_ADD(GP_PIXEL_GET_B_RGB565_BE(pixel), 0x1f * perc / 100, 0x1f) \
497 )
498
499#define GP_PIXEL_CHANS_ADD_RGB565_LE(pixel, perc) \
500 GP_PIXEL_CREATE_RGB565_LE( \
501 GP_SAT_ADD(GP_PIXEL_GET_R_RGB565_LE(pixel), 0x1f * perc / 100, 0x1f), \
502 GP_SAT_ADD(GP_PIXEL_GET_G_RGB565_LE(pixel), 0x3f * perc / 100, 0x3f), \
503 GP_SAT_ADD(GP_PIXEL_GET_B_RGB565_LE(pixel), 0x1f * perc / 100, 0x1f) \
504 )
505
506#define GP_PIXEL_CHANS_ADD_RGB666(pixel, perc) \
507 GP_PIXEL_CREATE_RGB666( \
508 GP_SAT_ADD(GP_PIXEL_GET_R_RGB666(pixel), 0x3f * perc / 100, 0x3f), \
509 GP_SAT_ADD(GP_PIXEL_GET_G_RGB666(pixel), 0x3f * perc / 100, 0x3f), \
510 GP_SAT_ADD(GP_PIXEL_GET_B_RGB666(pixel), 0x3f * perc / 100, 0x3f) \
511 )
512
513#define GP_PIXEL_CHANS_ADD_RGB332(pixel, perc) \
514 GP_PIXEL_CREATE_RGB332( \
515 GP_SAT_ADD(GP_PIXEL_GET_R_RGB332(pixel), 0x7 * perc / 100, 0x7), \
516 GP_SAT_ADD(GP_PIXEL_GET_G_RGB332(pixel), 0x7 * perc / 100, 0x7), \
517 GP_SAT_ADD(GP_PIXEL_GET_B_RGB332(pixel), 0x3 * perc / 100, 0x3) \
518 )
519
520#define GP_PIXEL_CHANS_ADD_CMYK8888(pixel, perc) \
521 GP_PIXEL_CREATE_CMYK8888( \
522 GP_SAT_ADD(GP_PIXEL_GET_K_CMYK8888(pixel), 0xff * perc / 100, 0xff), \
523 GP_SAT_ADD(GP_PIXEL_GET_Y_CMYK8888(pixel), 0xff * perc / 100, 0xff), \
524 GP_SAT_ADD(GP_PIXEL_GET_M_CMYK8888(pixel), 0xff * perc / 100, 0xff), \
525 GP_SAT_ADD(GP_PIXEL_GET_C_CMYK8888(pixel), 0xff * perc / 100, 0xff) \
526 )
527
528#define GP_PIXEL_CHANS_ADD_P2(pixel, perc) \
529 GP_PIXEL_CREATE_P2( \
530 GP_SAT_ADD(GP_PIXEL_GET_P_P2(pixel), 0x3 * perc / 100, 0x3) \
531 )
532
533#define GP_PIXEL_CHANS_ADD_P4(pixel, perc) \
534 GP_PIXEL_CREATE_P4( \
535 GP_SAT_ADD(GP_PIXEL_GET_P_P4(pixel), 0xf * perc / 100, 0xf) \
536 )
537
538#define GP_PIXEL_CHANS_ADD_P8(pixel, perc) \
539 GP_PIXEL_CREATE_P8( \
540 GP_SAT_ADD(GP_PIXEL_GET_P_P8(pixel), 0xff * perc / 100, 0xff) \
541 )
542
543#define GP_PIXEL_CHANS_ADD_G1_DB(pixel, perc) \
544 GP_PIXEL_CREATE_G1_DB( \
545 GP_SAT_ADD(GP_PIXEL_GET_V_G1_DB(pixel), 0x1 * perc / 100, 0x1) \
546 )
547
548#define GP_PIXEL_CHANS_ADD_G2_DB(pixel, perc) \
549 GP_PIXEL_CREATE_G2_DB( \
550 GP_SAT_ADD(GP_PIXEL_GET_V_G2_DB(pixel), 0x3 * perc / 100, 0x3) \
551 )
552
553#define GP_PIXEL_CHANS_ADD_G4_DB(pixel, perc) \
554 GP_PIXEL_CREATE_G4_DB( \
555 GP_SAT_ADD(GP_PIXEL_GET_V_G4_DB(pixel), 0xf * perc / 100, 0xf) \
556 )
557
558#define GP_PIXEL_CHANS_ADD_G1_UB(pixel, perc) \
559 GP_PIXEL_CREATE_G1_UB( \
560 GP_SAT_ADD(GP_PIXEL_GET_V_G1_UB(pixel), 0x1 * perc / 100, 0x1) \
561 )
562
563#define GP_PIXEL_CHANS_ADD_G2_UB(pixel, perc) \
564 GP_PIXEL_CREATE_G2_UB( \
565 GP_SAT_ADD(GP_PIXEL_GET_V_G2_UB(pixel), 0x3 * perc / 100, 0x3) \
566 )
567
568#define GP_PIXEL_CHANS_ADD_G4_UB(pixel, perc) \
569 GP_PIXEL_CREATE_G4_UB( \
570 GP_SAT_ADD(GP_PIXEL_GET_V_G4_UB(pixel), 0xf * perc / 100, 0xf) \
571 )
572
573#define GP_PIXEL_CHANS_ADD_G8(pixel, perc) \
574 GP_PIXEL_CREATE_G8( \
575 GP_SAT_ADD(GP_PIXEL_GET_V_G8(pixel), 0xff * perc / 100, 0xff) \
576 )
577
578#define GP_PIXEL_CHANS_ADD_GA88(pixel, perc) \
579 GP_PIXEL_CREATE_GA88( \
580 GP_SAT_ADD(GP_PIXEL_GET_V_GA88(pixel), 0xff * perc / 100, 0xff), \
581 GP_PIXEL_GET_A_GA88(pixel) \
582 )
583
584#define GP_PIXEL_CHANS_ADD_G16(pixel, perc) \
585 GP_PIXEL_CREATE_G16( \
586 GP_SAT_ADD(GP_PIXEL_GET_V_G16(pixel), 0xffff * perc / 100, 0xffff) \
587 )
588
589#endif /* GP_PIXEL_CHANNEL_GEN_H */
Fast value clamping.
Helper macros to get and set bytes.