139 #include "allheaders.h" 188 l_int32
w,
h, d, i, j, wplc, wplr, wplg, wplb;
189 l_int32 rval, gval, bval, rgdiff, rbdiff, gbdiff, maxval, colorval;
190 l_int32 *rtab, *gtab, *btab;
192 l_uint32 *datac, *datar, *datag, *datab, *linec, *liner, *lineg, *lineb;
193 NUMA *nar, *nag, *nab;
195 PIX *pixr, *pixg, *pixb;
198 PROCNAME(
"pixColorContent");
200 if (!ppixr && !ppixg && !ppixb)
201 return ERROR_INT(
"no return val requested", procName, 1);
202 if (ppixr) *ppixr = NULL;
203 if (ppixg) *ppixg = NULL;
204 if (ppixb) *ppixb = NULL;
206 return ERROR_INT(
"pixs not defined", procName, 1);
207 if (mingray < 0) mingray = 0;
210 return ERROR_INT(
"mingray > 255", procName, 1);
211 if (rwhite < 0 || gwhite < 0 || bwhite < 0)
212 return ERROR_INT(
"some white vals are negative", procName, 1);
213 if ((rwhite || gwhite || bwhite) && (rwhite * gwhite * bwhite == 0))
214 return ERROR_INT(
"white vals not all zero or all nonzero", procName, 1);
216 cmap = pixGetColormap(pixs);
217 if (!cmap && d != 32)
218 return ERROR_INT(
"pixs neither cmapped nor 32 bpp", procName, 1);
224 pixr = pixg = pixb = NULL;
229 wplr = pixGetWpl(pixr);
235 wplg = pixGetWpl(pixg);
241 wplb = pixGetWpl(pixb);
246 wplc = pixGetWpl(pixc);
255 for (i = 0; i <
h; i++) {
256 linec = datac + i * wplc;
258 liner = datar + i * wplr;
260 lineg = datag + i * wplg;
262 lineb = datab + i * wplb;
263 for (j = 0; j <
w; j++) {
272 maxval = L_MAX(rval, gval);
273 maxval = L_MAX(maxval, bval);
274 if (maxval < mingray)
277 rgdiff = L_ABS(rval - gval);
278 rbdiff = L_ABS(rval - bval);
279 gbdiff = L_ABS(gval - bval);
281 colorval = (rgdiff + rbdiff) / 2;
285 colorval = (rgdiff + gbdiff) / 2;
289 colorval = (rbdiff + gbdiff) / 2;
369 l_int32
w,
h, d, i, j, wplc, wpld;
370 l_int32 rval, gval, bval, rdist, gdist, bdist, colorval;
371 l_int32 rgdist, rbdist, gbdist, mindist, maxdist, minval, maxval;
372 l_int32 *rtab, *gtab, *btab;
374 l_uint32 *datac, *datad, *linec, *lined;
375 NUMA *nar, *nag, *nab;
379 PROCNAME(
"pixColorMagnitude");
382 return (
PIX *)ERROR_PTR(
"pixs not defined", procName, NULL);
384 if (type != L_MAX_DIFF_FROM_AVERAGE_2 && type != L_MAX_MIN_DIFF_FROM_2 &&
386 return (
PIX *)ERROR_PTR(
"invalid type", procName, NULL);
387 if (rwhite < 0 || gwhite < 0 || bwhite < 0)
388 return (
PIX *)ERROR_PTR(
"some white vals are negative", procName, NULL);
389 if ((rwhite || gwhite || bwhite) && (rwhite * gwhite * bwhite == 0))
390 return (
PIX *)ERROR_PTR(
"white vals not all zero or all nonzero",
393 cmap = pixGetColormap(pixs);
394 if (!cmap && d != 32)
395 return (
PIX *)ERROR_PTR(
"pixs not cmapped or 32 bpp", procName, NULL);
403 wpld = pixGetWpl(pixd);
405 wplc = pixGetWpl(pixc);
414 for (i = 0; i <
h; i++) {
415 linec = datac + i * wplc;
416 lined = datad + i * wpld;
417 for (j = 0; j <
w; j++) {
425 if (type == L_MAX_DIFF_FROM_AVERAGE_2) {
426 rdist = ((gval + bval ) / 2 - rval);
427 rdist = L_ABS(rdist);
428 gdist = ((rval + bval ) / 2 - gval);
429 gdist = L_ABS(gdist);
430 bdist = ((rval + gval ) / 2 - bval);
431 bdist = L_ABS(bdist);
432 colorval = L_MAX(rdist, gdist);
433 colorval = L_MAX(colorval, bdist);
434 }
else if (type == L_MAX_MIN_DIFF_FROM_2) {
435 rgdist = L_ABS(rval - gval);
436 rbdist = L_ABS(rval - bval);
437 gbdist = L_ABS(gval - bval);
438 maxdist = L_MAX(rgdist, rbdist);
439 if (gbdist >= maxdist) {
442 mindist = L_MIN(rgdist, rbdist);
443 colorval = L_MAX(mindist, gbdist);
446 minval = L_MIN(rval, gval);
447 minval = L_MIN(minval, bval);
448 maxval = L_MAX(rval, gval);
449 maxval = L_MAX(maxval, bval);
450 colorval = maxval - minval;
506 l_int32
w,
h, d, i, j, wpls, wpld, size;
507 l_int32 rval, gval, bval, minval, maxval;
508 l_uint32 *datas, *datad, *lines, *lined;
512 PROCNAME(
"pixMaskOverColorPixels");
515 return (
PIX *)ERROR_PTR(
"pixs not defined", procName, NULL);
518 cmap = pixGetColormap(pixs);
519 if (!cmap && d != 32)
520 return (
PIX *)ERROR_PTR(
"pixs not cmapped or 32 bpp", procName, NULL);
528 wpld = pixGetWpl(pixd);
530 wpls = pixGetWpl(pixc);
531 for (i = 0; i <
h; i++) {
532 lines = datas + i * wpls;
533 lined = datad + i * wpld;
534 for (j = 0; j <
w; j++) {
536 minval = L_MIN(rval, gval);
537 minval = L_MIN(minval, bval);
538 maxval = L_MAX(rval, gval);
539 maxval = L_MAX(maxval, bval);
540 if (maxval - minval >= threshdiff)
546 size = 2 * (mindist - 1) + 1;
577 l_int32
w,
h, d, i, j, wpls, wpld;
578 l_int32 rval, gval, bval;
579 l_uint32 *datas, *datad, *lines, *lined;
583 PROCNAME(
"pixMaskOverColorRange");
586 return (
PIX *)ERROR_PTR(
"pixs not defined", procName, NULL);
589 cmap = pixGetColormap(pixs);
590 if (!cmap && d != 32)
591 return (
PIX *)ERROR_PTR(
"pixs not cmapped or 32 bpp", procName, NULL);
599 wpld = pixGetWpl(pixd);
601 wpls = pixGetWpl(pixc);
602 for (i = 0; i <
h; i++) {
603 lines = datas + i * wpls;
604 lined = datad + i * wpld;
605 for (j = 0; j <
w; j++) {
607 if (rval < rmin || rval > rmax)
continue;
608 if (gval < gmin || gval > gmax)
continue;
609 if (bval < bmin || bval > bmax)
continue;
683 l_float32 *ppixfract,
684 l_float32 *pcolorfract)
686 l_int32 i, j,
w,
h, wpl, rval, gval, bval, minval, maxval;
687 l_int32 total, npix, ncolor;
689 l_uint32 *data, *line;
691 PROCNAME(
"pixColorFraction");
693 if (ppixfract) *ppixfract = 0.0;
694 if (pcolorfract) *pcolorfract = 0.0;
695 if (!ppixfract || !pcolorfract)
696 return ERROR_INT(
"&pixfract and &colorfract not defined",
698 if (!pixs || pixGetDepth(pixs) != 32)
699 return ERROR_INT(
"pixs not defined or not 32 bpp", procName, 1);
703 wpl = pixGetWpl(pixs);
704 npix = ncolor = total = 0;
705 for (i = 0; i <
h; i += factor) {
706 line = data + i * wpl;
707 for (j = 0; j <
w; j += factor) {
711 minval = L_MIN(rval, gval);
712 minval = L_MIN(minval, bval);
713 if (minval > lightthresh)
715 maxval = L_MAX(rval, gval);
716 maxval = L_MAX(maxval, bval);
717 if (maxval < darkthresh)
721 if (maxval - minval >= diffthresh)
727 L_WARNING(
"No pixels found for consideration\n", procName);
730 *ppixfract = (l_float32)npix / (l_float32)total;
731 *pcolorfract = (l_float32)ncolor / (l_float32)npix;
813 l_float32 *pcolorfract,
818 l_int32
w,
h, count, rval, gval, bval, aveval, proceed;
822 PIX *pix1, *pix2, *pix3, *pix4, *pix5, *pixm1, *pixm2, *pixm3;
824 PROCNAME(
"pixFindColorRegions");
826 if (pcolormask1) *pcolormask1 = NULL;
827 if (pcolormask2) *pcolormask2 = NULL;
829 return ERROR_INT(
"&colorfract not defined", procName, 1);
831 if (!pixs || pixGetDepth(pixs) != 32)
832 return ERROR_INT(
"pixs not defined or not 32 bpp", procName, 1);
833 if (factor < 1) factor = 1;
834 if (lightthresh < 0) lightthresh = 210;
835 if (darkthresh < 0) darkthresh = 70;
836 if (mindiff < 0) mindiff = 10;
837 if (colordiff < 0) colordiff = 90;
838 if (edgefract < 0.0 || edgefract > 1.0) edgefract = 0.05;
844 ratio = (l_float32)count / ((l_float32)(
w) *
h);
846 if (pixadb) L_INFO(
"pixm has big fg: %f5.2\n", procName, ratio);
856 return ERROR_INT(
"rank color array not made", procName, 1);
858 if (pixadb) L_INFO(
"lightest background color: (r,g,b) = (%d,%d,%d)\n",
859 procName, rval, gval, bval);
861 if ((rval < bval - 2) || (rval < gval - 2)) {
862 if (pixadb) L_INFO(
"background not reddish\n", procName);
865 aveval = (rval + gval + bval) / 3;
866 if (aveval < lightthresh) {
867 if (pixadb) L_INFO(
"background too dark\n", procName);
875 if (proceed == FALSE)
return 0;
887 pixOr(pixm1, pixm1, pixm);
900 pixOr(pixm2, pixm2, pix1);
906 pixOr(pixm2, pixm2, pix2);
925 if (edgefract > 0.0) {
927 pixAnd(pixm3, pixm3, pix2);
934 *pcolorfract = (l_float32)count / ((l_float32)(
w) *
h);
937 L_INFO(
"no light color pixels found\n", procName);
939 L_INFO(
"fraction of light color pixels = %5.3f\n", procName,
944 if (pixadb && count > 0) {
976 if (pcolormask2 && count > 0)
978 if (pcolormask1 && count > 0)
979 *pcolormask1 = pixm3;
1024 l_int32 lightthresh,
1029 l_int32 i,
w,
h, count, mincount, ncolors;
1032 PROCNAME(
"pixNumSignificantGrayColors");
1035 return ERROR_INT(
"&ncolors not defined", procName, 1);
1037 if (!pixs || pixGetDepth(pixs) != 8)
1038 return ERROR_INT(
"pixs not defined or not 8 bpp", procName, 1);
1039 if (darkthresh < 0) darkthresh = 20;
1040 if (lightthresh < 0) lightthresh = 236;
1041 if (minfract < 0.0) minfract = 0.0001;
1043 return ERROR_INT(
"minfract > 1.0", procName, 1);
1044 if (minfract >= 0.001)
1045 L_WARNING(
"minfract too big; likely to underestimate ncolors\n",
1047 if (lightthresh > 255 || darkthresh >= lightthresh)
1048 return ERROR_INT(
"invalid thresholds", procName, 1);
1049 if (factor < 1) factor = 1;
1052 mincount = (l_int32)(minfract *
w *
h * factor * factor);
1054 return ERROR_INT(
"na not made", procName, 1);
1056 for (i = darkthresh; i <= lightthresh; i++) {
1058 if (count >= mincount)
1062 *pncolors = ncolors;
1151 l_int32
w,
h, d, minside, factor;
1152 l_float32 pixfract, colorfract;
1153 PIX *pixt, *pixsc, *pixg, *pixe, *pixb, *pixm;
1156 PROCNAME(
"pixColorsForQuantization");
1158 if (piscolor) *piscolor = 0;
1160 return ERROR_INT(
"&ncolors not defined", procName, 1);
1163 return ERROR_INT(
"pixs not defined", procName, 1);
1164 if ((cmap = pixGetColormap(pixs)) != NULL) {
1172 if (d != 8 && d != 32)
1173 return ERROR_INT(
"pixs not 8 or 32 bpp", procName, 1);
1182 minside = L_MIN(
w,
h);
1186 factor = L_MAX(1, minside / 400);
1188 if (pixfract * colorfract < 0.00025) {
1203 factor = L_MAX(1, minside / 500);
1206 else if (factor == 2 || factor == 3)
1243 if (debug) pixWrite(
"junkpix8.png", pixg, IFF_PNG);
1247 if (debug) pixWrite(
"junkpix32.png", pixsc, IFF_PNG);
1291 l_int32
w,
h, d, i, j, wpl, hashsize, sum, count;
1292 l_int32 rval, gval, bval, val;
1295 l_uint32 *data, *line;
1298 PROCNAME(
"pixNumColors");
1301 return ERROR_INT(
"&ncolors not defined", procName, 1);
1304 return ERROR_INT(
"pixs not defined", procName, 1);
1306 if (d != 2 && d != 4 && d != 8 && d != 32)
1307 return ERROR_INT(
"d not in {2, 4, 8, 32}", procName, 1);
1308 if (factor < 1) factor = 1;
1311 wpl = pixGetWpl(pixs);
1314 if ((inta = (l_int32 *)LEPT_CALLOC(256,
sizeof(l_int32))) == NULL)
1315 return ERROR_INT(
"calloc failure for inta", procName, 1);
1316 for (i = 0; i <
h; i += factor) {
1317 line = data + i * wpl;
1318 for (j = 0; j <
w; j += factor) {
1328 for (i = 0; i < 256; i++)
1333 cmap = pixGetColormap(pixs);
1334 if (cmap && factor == 1) {
1337 L_WARNING(
"colormap size %d differs from actual colors\n",
1345 if ((inta = (l_int32 *)LEPT_CALLOC(hashsize,
sizeof(l_int32))) == NULL)
1346 return ERROR_INT(
"calloc failure with hashsize", procName, 1);
1347 for (i = 0; i <
h; i += factor) {
1348 line = data + i * wpl;
1349 for (j = 0; j <
w; j += factor) {
1352 val = (137 * rval + 269 * gval + 353 * bval) % hashsize;
1353 if (inta[val] == 0) {
1402 l_int32
n, i, rgbindex, rval, gval, bval;
1403 NUMA *nahisto, *naindex;
1405 PROCNAME(
"pixGetMostPopulatedColors");
1407 if (!parray && !pcmap)
1408 return ERROR_INT(
"no return val requested", procName, 1);
1409 if (parray) *parray = NULL;
1410 if (pcmap) *pcmap = NULL;
1411 if (!pixs || pixGetDepth(pixs) != 32)
1412 return ERROR_INT(
"pixs not defined", procName, 1);
1413 if (sigbits < 2 || sigbits > 6)
1414 return ERROR_INT(
"sigbits not in [2 ... 6]", procName, 1);
1415 if (factor < 1 || ncolors < 1)
1416 return ERROR_INT(
"factor < 1 or ncolors < 1", procName, 1);
1419 return ERROR_INT(
"nahisto not made", procName, 1);
1425 return ERROR_INT(
"naindex not made", procName, 1);
1428 ncolors = L_MIN(
n, ncolors);
1429 if (parray) *parray = (l_uint32 *)LEPT_CALLOC(ncolors,
sizeof(l_uint32));
1431 for (i = 0; i < ncolors; i++) {
1479 PROCNAME(
"pixSimpleColorQuantize");
1481 if (!pixs || pixGetDepth(pixs) != 32)
1482 return (
PIX *)ERROR_PTR(
"pixs not defined", procName, NULL);
1483 if (sigbits < 2 || sigbits > 4)
1484 return (
PIX *)ERROR_PTR(
"sigbits not in {2,3,4}", procName, NULL);
1520 l_int32
w,
h, i, j, size, wpl, rval, gval, bval, npts;
1521 l_uint32 val32, rgbindex;
1523 l_uint32 *data, *line, *rtab, *gtab, *btab;
1526 PROCNAME(
"pixGetRGBHistogram");
1528 if (!pixs || pixGetDepth(pixs) != 32)
1529 return (
NUMA *)ERROR_PTR(
"pixs not defined", procName, NULL);
1530 if (sigbits < 2 || sigbits > 6)
1531 return (
NUMA *)ERROR_PTR(
"sigbits not in [2 ... 6]", procName, NULL);
1533 return (
NUMA *)ERROR_PTR(
"factor < 1", procName, NULL);
1536 size = 1 << (3 * sigbits);
1544 npts = ((
w + factor - 1) / factor) * ((
h + factor - 1) / factor);
1546 L_WARNING(
"only sampling %d pixels\n", procName, npts);
1547 wpl = pixGetWpl(pixs);
1549 for (i = 0; i <
h; i += factor) {
1550 line = data + i * wpl;
1551 for (j = 0; j <
w; j += factor) {
1552 val32 = *(line + j);
1554 rgbindex = rtab[rval] | gtab[gval] | btab[bval];
1590 l_uint32 *rtab, *gtab, *btab;
1592 PROCNAME(
"makeRGBIndexTables");
1594 if (prtab) *prtab = NULL;
1595 if (pgtab) *pgtab = NULL;
1596 if (pbtab) *pbtab = NULL;
1597 if (!prtab || !pgtab || !pbtab)
1598 return ERROR_INT(
"not all table ptrs defined", procName, 1);
1599 if (sigbits < 2 || sigbits > 6)
1600 return ERROR_INT(
"sigbits not in [2 ... 6]", procName, 1);
1602 rtab = (l_uint32 *)LEPT_CALLOC(256,
sizeof(l_uint32));
1603 gtab = (l_uint32 *)LEPT_CALLOC(256,
sizeof(l_uint32));
1604 btab = (l_uint32 *)LEPT_CALLOC(256,
sizeof(l_uint32));
1605 if (!rtab || !gtab || !btab)
1606 return ERROR_INT(
"calloc fail for tab", procName, 1);
1612 for (i = 0; i < 256; i++) {
1613 rtab[i] = (i & 0xc0) >> 2;
1614 gtab[i] = (i & 0xc0) >> 4;
1615 btab[i] = (i & 0xc0) >> 6;
1619 for (i = 0; i < 256; i++) {
1620 rtab[i] = (i & 0xe0) << 1;
1621 gtab[i] = (i & 0xe0) >> 2;
1622 btab[i] = (i & 0xe0) >> 5;
1626 for (i = 0; i < 256; i++) {
1627 rtab[i] = (i & 0xf0) << 4;
1628 gtab[i] = (i & 0xf0);
1629 btab[i] = (i & 0xf0) >> 4;
1633 for (i = 0; i < 256; i++) {
1634 rtab[i] = (i & 0xf8) << 7;
1635 gtab[i] = (i & 0xf8) << 2;
1636 btab[i] = (i & 0xf8) >> 3;
1640 for (i = 0; i < 256; i++) {
1641 rtab[i] = (i & 0xfc) << 10;
1642 gtab[i] = (i & 0xfc) << 4;
1643 btab[i] = (i & 0xfc) >> 2;
1647 L_ERROR(
"Illegal sigbits = %d\n", procName, sigbits);
1648 return ERROR_INT(
"sigbits not in [2 ... 6]", procName, 1);
1680 PROCNAME(
"getRGBFromIndex");
1682 if (prval) *prval = 0;
1683 if (pgval) *pgval = 0;
1684 if (pbval) *pbval = 0;
1685 if (!prval || !pgval || !pbval)
1686 return ERROR_INT(
"not all component ptrs defined", procName, 1);
1687 if (sigbits < 2 || sigbits > 6)
1688 return ERROR_INT(
"sigbits not in [2 ... 6]", procName, 1);
1692 *prval = ((index << 2) & 0xc0) | 0x20;
1693 *pgval = ((index << 4) & 0xc0) | 0x20;
1694 *pbval = ((index << 6) & 0xc0) | 0x20;
1697 *prval = ((index >> 1) & 0xe0) | 0x10;
1698 *pgval = ((index << 2) & 0xe0) | 0x10;
1699 *pbval = ((index << 5) & 0xe0) | 0x10;
1702 *prval = ((index >> 4) & 0xf0) | 0x08;
1703 *pgval = (index & 0xf0) | 0x08;
1704 *pbval = ((index << 4) & 0xf0) | 0x08;
1707 *prval = ((index >> 7) & 0xf8) | 0x04;
1708 *pgval = ((index >> 2) & 0xf8) | 0x04;
1709 *pbval = ((index << 3) & 0xf8) | 0x04;
1712 *prval = ((index >> 10) & 0xfc) | 0x02;
1713 *pgval = ((index >> 4) & 0xfc) | 0x02;
1714 *pbval = ((index << 2) & 0xfc) | 0x02;
1717 L_ERROR(
"Illegal sigbits = %d\n", procName, sigbits);
1718 return ERROR_INT(
"sigbits not in [2 ... 6]", procName, 1);
1765 l_int32
w,
h, count;
1767 PIX *pix1, *pix2, *pix3, *pix4;
1770 PROCNAME(
"pixHasHighlightRed");
1772 if (pratio) *pratio = 0.0;
1773 if (ppixdb) *ppixdb = NULL;
1774 if (phasred) *phasred = 0;
1775 if (!pratio && !ppixdb)
1776 return ERROR_INT(
"no return val requested", procName, 1);
1778 return ERROR_INT(
"&hasred not defined", procName, 1);
1779 if (!pixs || pixGetDepth(pixs) != 32)
1780 return ERROR_INT(
"pixs not defined or not 32 bpp", procName, 1);
1781 if (fthresh < 1.5 || fthresh > 3.5)
1782 L_WARNING(
"fthresh = %f is out of normal bounds\n", procName, fthresh);
1799 pixAnd(pix4, pix4, pix2);
1802 L_INFO(
"count = %d, thresh = %d\n", procName, count,
1803 (l_int32)(fract *
w *
h));
1804 ratio = (l_float32)count / (fract *
w *
h);
1805 if (pratio) *pratio = ratio;
PIX * pixMaskOverColorPixels(PIX *pixs, l_int32 threshdiff, l_int32 mindist)
pixMaskOverColorPixels()
PIX * pixConvertRGBToLuminance(PIX *pixs)
pixConvertRGBToLuminance()
NUMA * pixGetGrayHistogram(PIX *pixs, l_int32 factor)
pixGetGrayHistogram()
PIX * pixRemoveColormap(PIX *pixs, l_int32 type)
pixRemoveColormap()
PIX * pixConvertRGBToBinaryArb(PIX *pixs, l_float32 rc, l_float32 gc, l_float32 bc, l_int32 thresh, l_int32 relation)
pixConvertRGBToBinaryArb()
PIX * fpixThresholdToPix(FPIX *fpix, l_float32 thresh)
fpixThresholdToPix()
l_ok pixSetMasked(PIX *pixd, PIX *pixm, l_uint32 val)
pixSetMasked()
NUMA * numaGammaTRC(l_float32 gamma, l_int32 minval, l_int32 maxval)
numaGammaTRC()
PIX * pixMakeFrameMask(l_int32 w, l_int32 h, l_float32 hf1, l_float32 hf2, l_float32 vf1, l_float32 vf2)
pixSelectComponentBySize()
NUMA * numaMakeConstant(l_float32 val, l_int32 size)
numaMakeConstant()
PIX * pixDilateBrick(PIX *pixd, PIX *pixs, l_int32 hsize, l_int32 vsize)
pixDilateBrick()
PIX * pixCreate(l_int32 width, l_int32 height, l_int32 depth)
pixCreate()
l_ok pixNumberOccupiedOctcubes(PIX *pix, l_int32 level, l_int32 mincount, l_float32 minfract, l_int32 *pncolors)
pixNumberOccupiedOctcubes()
l_ok pixSetAll(PIX *pix)
pixSetAll()
PIX * pixScaleAreaMap(PIX *pix, l_float32 scalex, l_float32 scaley)
pixScaleAreaMap()
PIX * pixInvert(PIX *pixd, PIX *pixs)
pixInvert()
void boxaDestroy(BOXA **pboxa)
boxaDestroy()
l_uint32 * pixGetData(PIX *pix)
pixGetData()
PIX * pixThresholdToBinary(PIX *pixs, l_int32 thresh)
pixThresholdToBinary()
l_ok pixNumColors(PIX *pixs, l_int32 factor, l_int32 *pncolors)
pixNumColors()
PIX * pixCreateTemplate(PIX *pixs)
pixCreateTemplate()
l_ok pixAssignToNearestColor(PIX *pixd, PIX *pixs, PIX *pixm, l_int32 level, l_int32 *countarray)
pixAssignToNearestColor()
l_ok pixSetColormap(PIX *pix, PIXCMAP *colormap)
pixSetColormap()
PIX * pixGetRGBComponent(PIX *pixs, l_int32 comp)
pixGetRGBComponent()
l_ok pixColorsForQuantization(PIX *pixs, l_int32 thresh, l_int32 *pncolors, l_int32 *piscolor, l_int32 debug)
pixColorsForQuantization()
PIXCMAP * pixcmapCreate(l_int32 depth)
pixcmapCreate()
l_ok pixCombineMasked(PIX *pixd, PIX *pixs, PIX *pixm)
pixCombineMasked()
l_int32 * numaGetIArray(NUMA *na)
numaGetIArray()
NUMA * pixGetRGBHistogram(PIX *pixs, l_int32 sigbits, l_int32 factor)
pixGetRGBHistogram()
l_ok pixGetRankColorArray(PIX *pixs, l_int32 nbins, l_int32 type, l_int32 factor, l_uint32 **pcarray, l_int32 debugflag, l_int32 fontsize)
pixGetRankColorArray()
FPIX * pixComponentFunction(PIX *pix, l_float32 rnum, l_float32 gnum, l_float32 bnum, l_float32 rdenom, l_float32 gdenom, l_float32 bdenom)
pixComponentFunction()
l_ok numaGetIValue(NUMA *na, l_int32 index, l_int32 *pival)
numaGetIValue()
l_ok pixaAddPix(PIXA *pixa, PIX *pix, l_int32 copyflag)
pixaAddPix()
PIX * pixCloseSafeBrick(PIX *pixd, PIX *pixs, l_int32 hsize, l_int32 vsize)
pixCloseSafeBrick()
l_int32 numaGetCount(NUMA *na)
numaGetCount()
BOXA * pixConnCompBB(PIX *pixs, l_int32 connectivity)
pixConnCompBB()
PIX * pixAnd(PIX *pixd, PIX *pixs1, PIX *pixs2)
pixAnd()
PIX * pixMorphSequence(PIX *pixs, const char *sequence, l_int32 dispsep)
pixMorphSequence()
l_ok pixCountPixels(PIX *pixs, l_int32 *pcount, l_int32 *tab8)
pixCountPixels()
#define SET_DATA_BYTE(pdata, n, val)
#define GET_DATA_QBIT(pdata, n)
PIX * pixConvertRGBToGrayMinMax(PIX *pixs, l_int32 type)
pixConvertRGBToGrayMinMax()
#define GET_DATA_BYTE(pdata, n)
PIX * pixRemoveBorderConnComps(PIX *pixs, l_int32 connectivity)
pixRemoveBorderConnComps()
PIX * pixClone(PIX *pixs)
pixClone()
PIX * pixSubtract(PIX *pixd, PIX *pixs1, PIX *pixs2)
pixSubtract()
void pixDestroy(PIX **ppix)
pixDestroy()
PIX * pixMaskBoxa(PIX *pixd, PIX *pixs, BOXA *boxa, l_int32 op)
pixMaskBoxa()
PIX * pixScaleByIntSampling(PIX *pixs, l_int32 factor)
pixScaleByIntSampling()
l_ok pixcmapHasColor(PIXCMAP *cmap, l_int32 *pcolor)
pixcmapHasColor()
PIX * pixScaleAreaMap2(PIX *pix)
pixScaleAreaMap2()
void numaDestroy(NUMA **pna)
numaDestroy()
l_ok pixColorContent(PIX *pixs, l_int32 rwhite, l_int32 gwhite, l_int32 bwhite, l_int32 mingray, PIX **ppixr, PIX **ppixg, PIX **ppixb)
pixColorContent()
l_ok pixNumSignificantGrayColors(PIX *pixs, l_int32 darkthresh, l_int32 lightthresh, l_float32 minfract, l_int32 factor, l_int32 *pncolors)
pixNumSignificantGrayColors()
l_ok pixGetDimensions(const PIX *pix, l_int32 *pw, l_int32 *ph, l_int32 *pd)
pixGetDimensions()
PIX * pixConvertRGBToGray(PIX *pixs, l_float32 rwt, l_float32 gwt, l_float32 bwt)
pixConvertRGBToGray()
PIX * pixOr(PIX *pixd, PIX *pixs1, PIX *pixs2)
pixOr()
l_ok makeRGBIndexTables(l_uint32 **prtab, l_uint32 **pgtab, l_uint32 **pbtab, l_int32 sigbits)
makeRGBIndexTables()
l_ok pixFindColorRegions(PIX *pixs, PIX *pixm, l_int32 factor, l_int32 lightthresh, l_int32 darkthresh, l_int32 mindiff, l_int32 colordiff, l_float32 edgefract, l_float32 *pcolorfract, PIX **pcolormask1, PIX **pcolormask2, PIXA *pixadb)
pixFindColorRegions()
l_ok pixColorFraction(PIX *pixs, l_int32 darkthresh, l_int32 lightthresh, l_int32 diffthresh, l_int32 factor, l_float32 *ppixfract, l_float32 *pcolorfract)
pixColorFraction()
l_float32 * numaGetFArray(NUMA *na, l_int32 copyflag)
numaGetFArray()
#define GET_DATA_DIBIT(pdata, n)
BOXA * boxaCombineOverlaps(BOXA *boxas, PIXA *pixadb)
boxaCombineOverlaps()
PIX * pixSimpleColorQuantize(PIX *pixs, l_int32 sigbits, l_int32 factor, l_int32 ncolors)
pixSimpleColorQuantize()
l_int32 pixcmapGetCount(PIXCMAP *cmap)
pixcmapGetCount()
NUMA * numaSortIndexAutoSelect(NUMA *nas, l_int32 sortorder)
numaSortIndexAutoSelect()
PIX * pixColorMagnitude(PIX *pixs, l_int32 rwhite, l_int32 gwhite, l_int32 bwhite, l_int32 type)
pixColorMagnitude()
PIX * pixSobelEdgeFilter(PIX *pixs, l_int32 orientflag)
pixSobelEdgeFilter()
PIX * pixCopy(PIX *pixd, PIX *pixs)
pixCopy()
PIX * pixDisplayColorArray(l_uint32 *carray, l_int32 ncolors, l_int32 side, l_int32 ncols, l_int32 fontsize)
pixDisplayColorArray()
PIX * pixErodeBrick(PIX *pixd, PIX *pixs, l_int32 hsize, l_int32 vsize)
pixErodeBrick()
l_ok composeRGBPixel(l_int32 rval, l_int32 gval, l_int32 bval, l_uint32 *ppixel)
composeRGBPixel()
l_ok pixGetMostPopulatedColors(PIX *pixs, l_int32 sigbits, l_int32 factor, l_int32 ncolors, l_uint32 **parray, PIXCMAP **pcmap)
pixGetMostPopulatedColors()
PIX * pixMaskOverColorRange(PIX *pixs, l_int32 rmin, l_int32 rmax, l_int32 gmin, l_int32 gmax, l_int32 bmin, l_int32 bmax)
pixMaskOverColorRange()
l_ok pixcmapAddColor(PIXCMAP *cmap, l_int32 rval, l_int32 gval, l_int32 bval)
pixcmapAddColor()
void fpixDestroy(FPIX **pfpix)
fpixDestroy()
l_ok pixHasHighlightRed(PIX *pixs, l_int32 factor, l_float32 fract, l_float32 fthresh, l_int32 *phasred, l_float32 *pratio, PIX **ppixdb)
pixHasHighlightRed()
void extractRGBValues(l_uint32 pixel, l_int32 *prval, l_int32 *pgval, l_int32 *pbval)
extractRGBValues()
l_ok getRGBFromIndex(l_uint32 index, l_int32 sigbits, l_int32 *prval, l_int32 *pgval, l_int32 *pbval)
getRGBFromIndex()
#define SET_DATA_BIT(pdata, n)