Leptonica 1.82.0
Image processing and image analysis suite
paintcmap.c
Go to the documentation of this file.
1/*====================================================================*
2 - Copyright (C) 2001 Leptonica. All rights reserved.
3 -
4 - Redistribution and use in source and binary forms, with or without
5 - modification, are permitted provided that the following conditions
6 - are met:
7 - 1. Redistributions of source code must retain the above copyright
8 - notice, this list of conditions and the following disclaimer.
9 - 2. Redistributions in binary form must reproduce the above
10 - copyright notice, this list of conditions and the following
11 - disclaimer in the documentation and/or other materials
12 - provided with the distribution.
13 -
14 - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15 - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16 - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17 - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY
18 - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 - OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23 - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *====================================================================*/
26
64#ifdef HAVE_CONFIG_H
65#include <config_auto.h>
66#endif /* HAVE_CONFIG_H */
67
68#include <string.h>
69#include "allheaders.h"
70
71/*-------------------------------------------------------------*
72 * Repaint selected pixels in region *
73 *-------------------------------------------------------------*/
101l_ok
103 BOX *box,
104 l_int32 sindex,
105 l_int32 rval,
106 l_int32 gval,
107 l_int32 bval)
108{
109l_int32 i, j, w, h, d, n, x1, y1, x2, y2, bw, bh, val, wpls;
110l_int32 index; /* of new color to be set */
111l_uint32 *lines, *datas;
112PIXCMAP *cmap;
113
114 PROCNAME("pixSetSelectCmap");
115
116 if (!pixs)
117 return ERROR_INT("pixs not defined", procName, 1);
118 if ((cmap = pixGetColormap(pixs)) == NULL)
119 return ERROR_INT("no colormap", procName, 1);
120 d = pixGetDepth(pixs);
121 if (d != 1 && d != 2 && d != 4 && d != 8)
122 return ERROR_INT("depth not in {1,2,4,8}", procName, 1);
123
124 /* Add new color if necessary; get index of this color in cmap */
125 n = pixcmapGetCount(cmap);
126 if (sindex >= n)
127 return ERROR_INT("sindex too large; no cmap entry", procName, 1);
128 if (pixcmapGetIndex(cmap, rval, gval, bval, &index)) { /* not found */
129 if (pixcmapAddColor(cmap, rval, gval, bval))
130 return ERROR_INT("error adding cmap entry", procName, 1);
131 else
132 index = n; /* we've added one color */
133 }
134
135 /* Determine the region of substitution */
136 pixGetDimensions(pixs, &w, &h, NULL);
137 if (!box) {
138 x1 = y1 = 0;
139 x2 = w;
140 y2 = h;
141 } else {
142 boxGetGeometry(box, &x1, &y1, &bw, &bh);
143 x2 = x1 + bw - 1;
144 y2 = y1 + bh - 1;
145 }
146
147 /* Replace pixel value sindex by index in the region */
148 datas = pixGetData(pixs);
149 wpls = pixGetWpl(pixs);
150 for (i = y1; i <= y2; i++) {
151 if (i < 0 || i >= h) /* clip */
152 continue;
153 lines = datas + i * wpls;
154 for (j = x1; j <= x2; j++) {
155 if (j < 0 || j >= w) /* clip */
156 continue;
157 switch (d) {
158 case 1:
159 val = GET_DATA_BIT(lines, j);
160 if (val == sindex) {
161 if (index == 0)
162 CLEAR_DATA_BIT(lines, j);
163 else
164 SET_DATA_BIT(lines, j);
165 }
166 break;
167 case 2:
168 val = GET_DATA_DIBIT(lines, j);
169 if (val == sindex)
170 SET_DATA_DIBIT(lines, j, index);
171 break;
172 case 4:
173 val = GET_DATA_QBIT(lines, j);
174 if (val == sindex)
175 SET_DATA_QBIT(lines, j, index);
176 break;
177 case 8:
178 val = GET_DATA_BYTE(lines, j);
179 if (val == sindex)
180 SET_DATA_BYTE(lines, j, index);
181 break;
182 default:
183 return ERROR_INT("depth not in {1,2,4,8}", procName, 1);
184 }
185 }
186 }
187
188 return 0;
189}
190
191
192/*-------------------------------------------------------------*
193 * Repaint gray pixels in region *
194 *-------------------------------------------------------------*/
222l_ok
224 BOXA *boxa,
225 l_int32 type,
226 l_int32 rval,
227 l_int32 gval,
228 l_int32 bval)
229{
230l_int32 i, j, k, w, h, n, nc, x1, y1, x2, y2, bw, bh, wpl;
231l_int32 val, nval;
232l_int32 *map;
233l_uint32 *line, *data;
234BOX *box;
235NUMA *na;
236PIXCMAP *cmap;
237
238 PROCNAME("pixColorGrayRegionsCmap");
239
240 if (!pixs)
241 return ERROR_INT("pixs not defined", procName, 1);
242 if (!boxa)
243 return ERROR_INT("boxa not defined", procName, 1);
244 if ((cmap = pixGetColormap(pixs)) == NULL)
245 return ERROR_INT("no colormap", procName, 1);
246 if (pixGetDepth(pixs) != 8)
247 return ERROR_INT("depth not 8 bpp", procName, 1);
248 if (type != L_PAINT_DARK && type != L_PAINT_LIGHT)
249 return ERROR_INT("invalid type", procName, 1);
250
251 nc = pixcmapGetCount(cmap);
252 if (addColorizedGrayToCmap(cmap, type, rval, gval, bval, &na))
253 return ERROR_INT("no room; cmap full", procName, 1);
254 map = numaGetIArray(na);
255 numaDestroy(&na);
256 if (!map)
257 return ERROR_INT("map not made", procName, 1);
258
259 pixGetDimensions(pixs, &w, &h, NULL);
260 data = pixGetData(pixs);
261 wpl = pixGetWpl(pixs);
262 n = boxaGetCount(boxa);
263 for (k = 0; k < n; k++) {
264 box = boxaGetBox(boxa, k, L_CLONE);
265 boxGetGeometry(box, &x1, &y1, &bw, &bh);
266 x2 = x1 + bw - 1;
267 y2 = y1 + bh - 1;
268
269 /* Remap gray pixels in the region */
270 for (i = y1; i <= y2; i++) {
271 if (i < 0 || i >= h) /* clip */
272 continue;
273 line = data + i * wpl;
274 for (j = x1; j <= x2; j++) {
275 if (j < 0 || j >= w) /* clip */
276 continue;
277 val = GET_DATA_BYTE(line, j);
278 if (val >= nc) continue; /* from overlapping b.b. */
279 nval = map[val];
280 if (nval != 256)
281 SET_DATA_BYTE(line, j, nval);
282 }
283 }
284 boxDestroy(&box);
285 }
286
287 LEPT_FREE(map);
288 return 0;
289}
290
291
330l_ok
332 BOX *box,
333 l_int32 type,
334 l_int32 rval,
335 l_int32 gval,
336 l_int32 bval)
337{
338l_int32 w, h, d, ret;
339PIX *pixt;
340BOXA *boxa;
341PIXCMAP *cmap;
342
343 PROCNAME("pixColorGrayCmap");
344
345 if (!pixs)
346 return ERROR_INT("pixs not defined", procName, 1);
347 if ((cmap = pixGetColormap(pixs)) == NULL)
348 return ERROR_INT("no colormap", procName, 1);
349 pixGetDimensions(pixs, &w, &h, &d);
350 if (d != 2 && d != 4 && d != 8)
351 return ERROR_INT("depth not in {2, 4, 8}", procName, 1);
352 if (type != L_PAINT_DARK && type != L_PAINT_LIGHT)
353 return ERROR_INT("invalid type", procName, 1);
354
355 /* If 2 bpp or 4 bpp, convert in-place to 8 bpp. */
356 if (d == 2 || d == 4) {
357 pixt = pixConvertTo8(pixs, 1);
358 pixTransferAllData(pixs, &pixt, 0, 0);
359 }
360
361 /* If box == NULL, color the entire image */
362 boxa = boxaCreate(1);
363 if (box) {
364 boxaAddBox(boxa, box, L_COPY);
365 } else {
366 box = boxCreate(0, 0, w, h);
367 boxaAddBox(boxa, box, L_INSERT);
368 }
369 ret = pixColorGrayRegionsCmap(pixs, boxa, type, rval, gval, bval);
370
371 boxaDestroy(&boxa);
372 return ret;
373}
374
375
398l_ok
400 PIX *pixm,
401 l_int32 type,
402 l_int32 rval,
403 l_int32 gval,
404 l_int32 bval)
405{
406l_int32 i, j, w, h, wm, hm, wmin, hmin, wpl, wplm;
407l_int32 val, nval;
408l_int32 *map;
409l_uint32 *line, *data, *linem, *datam;
410NUMA *na;
411PIXCMAP *cmap;
412
413 PROCNAME("pixColorGrayMaskedCmap");
414
415 if (!pixs)
416 return ERROR_INT("pixs not defined", procName, 1);
417 if (!pixm || pixGetDepth(pixm) != 1)
418 return ERROR_INT("pixm undefined or not 1 bpp", procName, 1);
419 if ((cmap = pixGetColormap(pixs)) == NULL)
420 return ERROR_INT("no colormap", procName, 1);
421 if (pixGetDepth(pixs) != 8)
422 return ERROR_INT("depth not 8 bpp", procName, 1);
423 if (type != L_PAINT_DARK && type != L_PAINT_LIGHT)
424 return ERROR_INT("invalid type", procName, 1);
425
426 if (addColorizedGrayToCmap(cmap, type, rval, gval, bval, &na))
427 return ERROR_INT("no room; cmap full", procName, 1);
428 map = numaGetIArray(na);
429 numaDestroy(&na);
430 if (!map)
431 return ERROR_INT("map not made", procName, 1);
432
433 pixGetDimensions(pixs, &w, &h, NULL);
434 pixGetDimensions(pixm, &wm, &hm, NULL);
435 if (wm != w)
436 L_WARNING("wm = %d differs from w = %d\n", procName, wm, w);
437 if (hm != h)
438 L_WARNING("hm = %d differs from h = %d\n", procName, hm, h);
439 wmin = L_MIN(w, wm);
440 hmin = L_MIN(h, hm);
441
442 data = pixGetData(pixs);
443 wpl = pixGetWpl(pixs);
444 datam = pixGetData(pixm);
445 wplm = pixGetWpl(pixm);
446
447 /* Remap gray pixels in the region */
448 for (i = 0; i < hmin; i++) {
449 line = data + i * wpl;
450 linem = datam + i * wplm;
451 for (j = 0; j < wmin; j++) {
452 if (GET_DATA_BIT(linem, j) == 0)
453 continue;
454 val = GET_DATA_BYTE(line, j);
455 nval = map[val];
456 if (nval != 256)
457 SET_DATA_BYTE(line, j, nval);
458 }
459 }
460
461 LEPT_FREE(map);
462 return 0;
463}
464
465
495l_ok
497 l_int32 type,
498 l_int32 rval,
499 l_int32 gval,
500 l_int32 bval,
501 NUMA **pna)
502{
503l_int32 i, n, erval, egval, ebval, nrval, ngval, nbval, newindex;
504NUMA *na;
505
506 PROCNAME("addColorizedGrayToCmap");
507
508 if (pna) *pna = NULL;
509 if (!cmap)
510 return ERROR_INT("cmap not defined", procName, 1);
511 if (type != L_PAINT_DARK && type != L_PAINT_LIGHT)
512 return ERROR_INT("invalid type", procName, 1);
513
514 n = pixcmapGetCount(cmap);
515 na = numaCreate(n);
516 for (i = 0; i < n; i++) {
517 pixcmapGetColor(cmap, i, &erval, &egval, &ebval);
518 if (type == L_PAINT_LIGHT) {
519 if (erval == egval && erval == ebval && erval != 0) {
520 nrval = (l_int32)(rval * (l_float32)erval / 255.);
521 ngval = (l_int32)(gval * (l_float32)egval / 255.);
522 nbval = (l_int32)(bval * (l_float32)ebval / 255.);
523 if (pixcmapAddNewColor(cmap, nrval, ngval, nbval, &newindex)) {
524 numaDestroy(&na);
525 L_WARNING("no room; colormap full\n", procName);
526 return 2;
527 }
528 numaAddNumber(na, newindex);
529 } else {
530 numaAddNumber(na, 256); /* invalid number; not gray */
531 }
532 } else { /* L_PAINT_DARK */
533 if (erval == egval && erval == ebval && erval != 255) {
534 nrval = rval +
535 (l_int32)((255. - rval) * (l_float32)erval / 255.);
536 ngval = gval +
537 (l_int32)((255. - gval) * (l_float32)egval / 255.);
538 nbval = bval +
539 (l_int32)((255. - bval) * (l_float32)ebval / 255.);
540 if (pixcmapAddNewColor(cmap, nrval, ngval, nbval, &newindex)) {
541 numaDestroy(&na);
542 L_WARNING("no room; colormap full\n", procName);
543 return 2;
544 }
545 numaAddNumber(na, newindex);
546 } else {
547 numaAddNumber(na, 256); /* invalid number; not gray */
548 }
549 }
550 }
551
552 if (pna)
553 *pna = na;
554 else
555 numaDestroy(&na);
556 return 0;
557}
558
559
560/*-------------------------------------------------------------*
561 * Repaint selected pixels through mask *
562 *-------------------------------------------------------------*/
586l_ok
588 PIX *pixm,
589 l_int32 x,
590 l_int32 y,
591 l_int32 sindex,
592 l_int32 rval,
593 l_int32 gval,
594 l_int32 bval)
595{
596l_int32 i, j, w, h, d, n, wm, hm, wpls, wplm, val;
597l_int32 index; /* of new color to be set */
598l_uint32 *lines, *linem, *datas, *datam;
599PIXCMAP *cmap;
600
601 PROCNAME("pixSetSelectMaskedCmap");
602
603 if (!pixs)
604 return ERROR_INT("pixs not defined", procName, 1);
605 if ((cmap = pixGetColormap(pixs)) == NULL)
606 return ERROR_INT("no colormap", procName, 1);
607 if (!pixm) {
608 L_WARNING("no mask; nothing to do\n", procName);
609 return 0;
610 }
611
612 d = pixGetDepth(pixs);
613 if (d != 2 && d != 4 && d != 8)
614 return ERROR_INT("depth not in {2, 4, 8}", procName, 1);
615
616 /* add new color if necessary; get index of this color in cmap */
617 n = pixcmapGetCount(cmap);
618 if (sindex >= n)
619 return ERROR_INT("sindex too large; no cmap entry", procName, 1);
620 if (pixcmapGetIndex(cmap, rval, gval, bval, &index)) { /* not found */
621 if (pixcmapAddColor(cmap, rval, gval, bval))
622 return ERROR_INT("error adding cmap entry", procName, 1);
623 else
624 index = n; /* we've added one color */
625 }
626
627 /* replace pixel value sindex by index when fg pixel in pixmc
628 * overlays it */
629 pixGetDimensions(pixs, &w, &h, NULL);
630 datas = pixGetData(pixs);
631 wpls = pixGetWpl(pixs);
632 wm = pixGetWidth(pixm);
633 hm = pixGetHeight(pixm);
634 datam = pixGetData(pixm);
635 wplm = pixGetWpl(pixm);
636 for (i = 0; i < hm; i++) {
637 if (i + y < 0 || i + y >= h) continue;
638 lines = datas + (y + i) * wpls;
639 linem = datam + i * wplm;
640 for (j = 0; j < wm; j++) {
641 if (j + x < 0 || j + x >= w) continue;
642 if (GET_DATA_BIT(linem, j)) {
643 switch (d) {
644 case 2:
645 val = GET_DATA_DIBIT(lines, x + j);
646 if (val == sindex)
647 SET_DATA_DIBIT(lines, x + j, index);
648 break;
649 case 4:
650 val = GET_DATA_QBIT(lines, x + j);
651 if (val == sindex)
652 SET_DATA_QBIT(lines, x + j, index);
653 break;
654 case 8:
655 val = GET_DATA_BYTE(lines, x + j);
656 if (val == sindex)
657 SET_DATA_BYTE(lines, x + j, index);
658 break;
659 default:
660 return ERROR_INT("depth not in {1,2,4,8}", procName, 1);
661 }
662 }
663 }
664 }
665
666 return 0;
667}
668
669
670/*-------------------------------------------------------------*
671 * Repaint all pixels through mask *
672 *-------------------------------------------------------------*/
697l_ok
699 PIX *pixm,
700 l_int32 x,
701 l_int32 y,
702 l_int32 rval,
703 l_int32 gval,
704 l_int32 bval)
705{
706l_int32 w, h, d, wpl, wm, hm, wplm;
707l_int32 i, j, index;
708l_uint32 *data, *datam, *line, *linem;
709PIXCMAP *cmap;
710
711 PROCNAME("pixSetMaskedCmap");
712
713 if (!pixs)
714 return ERROR_INT("pixs not defined", procName, 1);
715 if ((cmap = pixGetColormap(pixs)) == NULL)
716 return ERROR_INT("no colormap in pixs", procName, 1);
717 if (!pixm) {
718 L_WARNING("no mask; nothing to do\n", procName);
719 return 0;
720 }
721 d = pixGetDepth(pixs);
722 if (d != 2 && d != 4 && d != 8)
723 return ERROR_INT("depth not in {2,4,8}", procName, 1);
724 if (pixGetDepth(pixm) != 1)
725 return ERROR_INT("pixm not 1 bpp", procName, 1);
726
727 /* Add new color if necessary; store in 'index' */
728 if (pixcmapGetIndex(cmap, rval, gval, bval, &index)) { /* not found */
729 if (pixcmapAddColor(cmap, rval, gval, bval))
730 return ERROR_INT("no room in cmap", procName, 1);
731 index = pixcmapGetCount(cmap) - 1;
732 }
733
734 pixGetDimensions(pixs, &w, &h, NULL);
735 wpl = pixGetWpl(pixs);
736 data = pixGetData(pixs);
737 pixGetDimensions(pixm, &wm, &hm, NULL);
738 wplm = pixGetWpl(pixm);
739 datam = pixGetData(pixm);
740 for (i = 0; i < hm; i++) {
741 if (i + y < 0 || i + y >= h) continue;
742 line = data + (i + y) * wpl;
743 linem = datam + i * wplm;
744 for (j = 0; j < wm; j++) {
745 if (j + x < 0 || j + x >= w) continue;
746 if (GET_DATA_BIT(linem, j)) { /* paint color */
747 switch (d) {
748 case 2:
749 SET_DATA_DIBIT(line, j + x, index);
750 break;
751 case 4:
752 SET_DATA_QBIT(line, j + x, index);
753 break;
754 case 8:
755 SET_DATA_BYTE(line, j + x, index);
756 break;
757 default:
758 return ERROR_INT("depth not in {2,4,8}", procName, 1);
759 }
760 }
761 }
762 }
763
764 return 0;
765}
#define GET_DATA_QBIT(pdata, n)
Definition: arrayaccess.h:164
#define SET_DATA_BIT(pdata, n)
Definition: arrayaccess.h:127
#define SET_DATA_DIBIT(pdata, n, val)
Definition: arrayaccess.h:149
#define GET_DATA_BYTE(pdata, n)
Definition: arrayaccess.h:188
#define GET_DATA_DIBIT(pdata, n)
Definition: arrayaccess.h:145
#define SET_DATA_BYTE(pdata, n, val)
Definition: arrayaccess.h:198
#define CLEAR_DATA_BIT(pdata, n)
Definition: arrayaccess.h:131
#define GET_DATA_BIT(pdata, n)
Definition: arrayaccess.h:123
#define SET_DATA_QBIT(pdata, n, val)
Definition: arrayaccess.h:168
BOX * boxaGetBox(BOXA *boxa, l_int32 index, l_int32 accessflag)
boxaGetBox()
Definition: boxbasic.c:779
void boxDestroy(BOX **pbox)
boxDestroy()
Definition: boxbasic.c:282
BOX * boxCreate(l_int32 x, l_int32 y, l_int32 w, l_int32 h)
boxCreate()
Definition: boxbasic.c:172
l_int32 boxaGetCount(BOXA *boxa)
boxaGetCount()
Definition: boxbasic.c:734
l_ok boxGetGeometry(BOX *box, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxGetGeometry()
Definition: boxbasic.c:313
BOXA * boxaCreate(l_int32 n)
boxaCreate()
Definition: boxbasic.c:502
l_ok boxaAddBox(BOXA *boxa, BOX *box, l_int32 copyflag)
boxaAddBox()
Definition: boxbasic.c:620
void boxaDestroy(BOXA **pboxa)
boxaDestroy()
Definition: boxbasic.c:583
l_int32 pixcmapGetCount(const PIXCMAP *cmap)
pixcmapGetCount()
Definition: colormap.c:708
l_ok pixcmapAddNewColor(PIXCMAP *cmap, l_int32 rval, l_int32 gval, l_int32 bval, l_int32 *pindex)
pixcmapAddNewColor()
Definition: colormap.c:496
l_int32 pixcmapGetIndex(PIXCMAP *cmap, l_int32 rval, l_int32 gval, l_int32 bval, l_int32 *pindex)
pixcmapGetIndex()
Definition: colormap.c:1036
l_ok pixcmapGetColor(PIXCMAP *cmap, l_int32 index, l_int32 *prval, l_int32 *pgval, l_int32 *pbval)
pixcmapGetColor()
Definition: colormap.c:824
l_ok pixcmapAddColor(PIXCMAP *cmap, l_int32 rval, l_int32 gval, l_int32 bval)
pixcmapAddColor()
Definition: colormap.c:414
l_ok numaAddNumber(NUMA *na, l_float32 val)
numaAddNumber()
Definition: numabasic.c:478
l_int32 * numaGetIArray(NUMA *na)
numaGetIArray()
Definition: numabasic.c:847
void numaDestroy(NUMA **pna)
numaDestroy()
Definition: numabasic.c:366
NUMA * numaCreate(l_int32 n)
numaCreate()
Definition: numabasic.c:194
l_ok pixSetSelectMaskedCmap(PIX *pixs, PIX *pixm, l_int32 x, l_int32 y, l_int32 sindex, l_int32 rval, l_int32 gval, l_int32 bval)
pixSetSelectMaskedCmap()
Definition: paintcmap.c:587
l_ok pixColorGrayCmap(PIX *pixs, BOX *box, l_int32 type, l_int32 rval, l_int32 gval, l_int32 bval)
pixColorGrayCmap()
Definition: paintcmap.c:331
l_ok addColorizedGrayToCmap(PIXCMAP *cmap, l_int32 type, l_int32 rval, l_int32 gval, l_int32 bval, NUMA **pna)
addColorizedGrayToCmap()
Definition: paintcmap.c:496
l_ok pixColorGrayMaskedCmap(PIX *pixs, PIX *pixm, l_int32 type, l_int32 rval, l_int32 gval, l_int32 bval)
pixColorGrayMaskedCmap()
Definition: paintcmap.c:399
l_ok pixSetSelectCmap(PIX *pixs, BOX *box, l_int32 sindex, l_int32 rval, l_int32 gval, l_int32 bval)
pixSetSelectCmap()
Definition: paintcmap.c:102
l_ok pixColorGrayRegionsCmap(PIX *pixs, BOXA *boxa, l_int32 type, l_int32 rval, l_int32 gval, l_int32 bval)
pixColorGrayRegionsCmap()
Definition: paintcmap.c:223
l_ok pixSetMaskedCmap(PIX *pixs, PIX *pixm, l_int32 x, l_int32 y, l_int32 rval, l_int32 gval, l_int32 bval)
pixSetMaskedCmap()
Definition: paintcmap.c:698
l_ok pixGetDimensions(const PIX *pix, l_int32 *pw, l_int32 *ph, l_int32 *pd)
pixGetDimensions()
Definition: pix1.c:1113
l_ok pixTransferAllData(PIX *pixd, PIX **ppixs, l_int32 copytext, l_int32 copyformat)
pixTransferAllData()
Definition: pix1.c:902
l_uint32 * pixGetData(PIX *pix)
pixGetData()
Definition: pix1.c:1763
@ L_COPY
Definition: pix.h:712
@ L_CLONE
Definition: pix.h:713
@ L_INSERT
Definition: pix.h:711
@ L_PAINT_LIGHT
Definition: pix.h:763
@ L_PAINT_DARK
Definition: pix.h:764
PIX * pixConvertTo8(PIX *pixs, l_int32 cmapflag)
pixConvertTo8()
Definition: pixconv.c:3133
Definition: pix.h:481
Definition: pix.h:492
Definition: array.h:71
Definition: pix.h:139