Leptonica 1.82.0
Image processing and image analysis suite
shear.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
27
55#ifdef HAVE_CONFIG_H
56#include <config_auto.h>
57#endif /* HAVE_CONFIG_H */
58
59#include <string.h>
60#include <math.h>
61#include "allheaders.h"
62
63 /* Shear angle must not get too close to -pi/2 or pi/2 */
64static const l_float32 MinDiffFromHalfPi = 0.04;
65
66static l_float32 normalizeAngleForShear(l_float32 radang, l_float32 mindif);
67
68
69#ifndef NO_CONSOLE_IO
70#define DEBUG 0
71#endif /* ~NO_CONSOLE_IO */
72
73
74/*-------------------------------------------------------------*
75 * About arbitrary lines *
76 *-------------------------------------------------------------*/
116PIX *
118 PIX *pixs,
119 l_int32 yloc,
120 l_float32 radang,
121 l_int32 incolor)
122{
123l_int32 sign, w, h;
124l_int32 y, yincr, inityincr, hshift;
125l_float32 tanangle, invangle;
126
127 PROCNAME("pixHShear");
128
129 if (!pixs)
130 return (PIX *)ERROR_PTR("pixs not defined", procName, pixd);
131 if (incolor != L_BRING_IN_WHITE && incolor != L_BRING_IN_BLACK)
132 return (PIX *)ERROR_PTR("invalid incolor value", procName, pixd);
133
134 if (pixd == pixs) { /* in place */
135 if (!pixGetColormap(pixs)) {
136 pixHShearIP(pixd, yloc, radang, incolor);
137 } else { /* can't do in-place with a colormap */
138 PIX *pix1 = pixCopy(NULL, pixs);
139 pixHShear(pixd, pix1, yloc, radang, incolor);
140 pixDestroy(&pix1);
141 }
142 return pixd;
143 }
144
145 /* Make sure pixd exists and is same size as pixs */
146 if (!pixd) {
147 if ((pixd = pixCreateTemplate(pixs)) == NULL)
148 return (PIX *)ERROR_PTR("pixd not made", procName, NULL);
149 } else { /* pixd != pixs */
150 pixResizeImageData(pixd, pixs);
151 }
152
153 /* Normalize angle. If no rotation, return a copy */
154 radang = normalizeAngleForShear(radang, MinDiffFromHalfPi);
155 if (radang == 0.0 || tan(radang) == 0.0)
156 return pixCopy(pixd, pixs);
157
158 /* Initialize to value of incoming pixels */
159 pixSetBlackOrWhite(pixd, incolor);
160
161 pixGetDimensions(pixs, &w, &h, NULL);
162 sign = L_SIGN(radang);
163 tanangle = tan(radang);
164 invangle = L_ABS(1. / tanangle);
165 inityincr = (l_int32)(invangle / 2.);
166 yincr = (l_int32)invangle;
167 pixRasterop(pixd, 0, yloc - inityincr, w, 2 * inityincr, PIX_SRC,
168 pixs, 0, yloc - inityincr);
169
170 for (hshift = 1, y = yloc + inityincr; y < h; hshift++) {
171 yincr = (l_int32)(invangle * (hshift + 0.5) + 0.5) - (y - yloc);
172 if (h - y < yincr) /* reduce for last one if req'd */
173 yincr = h - y;
174 pixRasterop(pixd, -sign*hshift, y, w, yincr, PIX_SRC, pixs, 0, y);
175#if DEBUG
176 lept_stderr("y = %d, hshift = %d, yincr = %d\n", y, hshift, yincr);
177#endif /* DEBUG */
178 y += yincr;
179 }
180
181 for (hshift = -1, y = yloc - inityincr; y > 0; hshift--) {
182 yincr = (y - yloc) - (l_int32)(invangle * (hshift - 0.5) + 0.5);
183 if (y < yincr) /* reduce for last one if req'd */
184 yincr = y;
185 pixRasterop(pixd, -sign*hshift, y - yincr, w, yincr, PIX_SRC,
186 pixs, 0, y - yincr);
187#if DEBUG
188 lept_stderr("y = %d, hshift = %d, yincr = %d\n",
189 y - yincr, hshift, yincr);
190#endif /* DEBUG */
191 y -= yincr;
192 }
193
194 return pixd;
195}
196
197
237PIX *
239 PIX *pixs,
240 l_int32 xloc,
241 l_float32 radang,
242 l_int32 incolor)
243{
244l_int32 sign, w, h;
245l_int32 x, xincr, initxincr, vshift;
246l_float32 tanangle, invangle;
247
248 PROCNAME("pixVShear");
249
250 if (!pixs)
251 return (PIX *)ERROR_PTR("pixs not defined", procName, NULL);
252 if (incolor != L_BRING_IN_WHITE && incolor != L_BRING_IN_BLACK)
253 return (PIX *)ERROR_PTR("invalid incolor value", procName, NULL);
254
255 if (pixd == pixs) { /* in place */
256 if (!pixGetColormap(pixs)) {
257 pixVShearIP(pixd, xloc, radang, incolor);
258 } else { /* can't do in-place with a colormap */
259 PIX *pix1 = pixCopy(NULL, pixs);
260 pixVShear(pixd, pix1, xloc, radang, incolor);
261 pixDestroy(&pix1);
262 }
263 return pixd;
264 }
265
266 /* Make sure pixd exists and is same size as pixs */
267 if (!pixd) {
268 if ((pixd = pixCreateTemplate(pixs)) == NULL)
269 return (PIX *)ERROR_PTR("pixd not made", procName, NULL);
270 } else { /* pixd != pixs */
271 pixResizeImageData(pixd, pixs);
272 }
273
274 /* Normalize angle. If no rotation, return a copy */
275 radang = normalizeAngleForShear(radang, MinDiffFromHalfPi);
276 if (radang == 0.0 || tan(radang) == 0.0)
277 return pixCopy(pixd, pixs);
278
279 /* Initialize to value of incoming pixels */
280 pixSetBlackOrWhite(pixd, incolor);
281
282 pixGetDimensions(pixs, &w, &h, NULL);
283 sign = L_SIGN(radang);
284 tanangle = tan(radang);
285 invangle = L_ABS(1. / tanangle);
286 initxincr = (l_int32)(invangle / 2.);
287 xincr = (l_int32)invangle;
288 pixRasterop(pixd, xloc - initxincr, 0, 2 * initxincr, h, PIX_SRC,
289 pixs, xloc - initxincr, 0);
290
291 for (vshift = 1, x = xloc + initxincr; x < w; vshift++) {
292 xincr = (l_int32)(invangle * (vshift + 0.5) + 0.5) - (x - xloc);
293 if (w - x < xincr) /* reduce for last one if req'd */
294 xincr = w - x;
295 pixRasterop(pixd, x, sign*vshift, xincr, h, PIX_SRC, pixs, x, 0);
296#if DEBUG
297 lept_stderr("x = %d, vshift = %d, xincr = %d\n", x, vshift, xincr);
298#endif /* DEBUG */
299 x += xincr;
300 }
301
302 for (vshift = -1, x = xloc - initxincr; x > 0; vshift--) {
303 xincr = (x - xloc) - (l_int32)(invangle * (vshift - 0.5) + 0.5);
304 if (x < xincr) /* reduce for last one if req'd */
305 xincr = x;
306 pixRasterop(pixd, x - xincr, sign*vshift, xincr, h, PIX_SRC,
307 pixs, x - xincr, 0);
308#if DEBUG
309 lept_stderr("x = %d, vshift = %d, xincr = %d\n",
310 x - xincr, vshift, xincr);
311#endif /* DEBUG */
312 x -= xincr;
313 }
314
315 return pixd;
316}
317
318
319
320/*-------------------------------------------------------------*
321 * Shears about UL corner and center *
322 *-------------------------------------------------------------*/
339PIX *
341 PIX *pixs,
342 l_float32 radang,
343 l_int32 incolor)
344{
345 PROCNAME("pixHShearCorner");
346
347 if (!pixs)
348 return (PIX *)ERROR_PTR("pixs not defined", procName, pixd);
349
350 return pixHShear(pixd, pixs, 0, radang, incolor);
351}
352
353
370PIX *
372 PIX *pixs,
373 l_float32 radang,
374 l_int32 incolor)
375{
376 PROCNAME("pixVShearCorner");
377
378 if (!pixs)
379 return (PIX *)ERROR_PTR("pixs not defined", procName, pixd);
380
381 return pixVShear(pixd, pixs, 0, radang, incolor);
382}
383
384
401PIX *
403 PIX *pixs,
404 l_float32 radang,
405 l_int32 incolor)
406{
407 PROCNAME("pixHShearCenter");
408
409 if (!pixs)
410 return (PIX *)ERROR_PTR("pixs not defined", procName, pixd);
411
412 return pixHShear(pixd, pixs, pixGetHeight(pixs) / 2, radang, incolor);
413}
414
415
432PIX *
434 PIX *pixs,
435 l_float32 radang,
436 l_int32 incolor)
437{
438 PROCNAME("pixVShearCenter");
439
440 if (!pixs)
441 return (PIX *)ERROR_PTR("pixs not defined", procName, pixd);
442
443 return pixVShear(pixd, pixs, pixGetWidth(pixs) / 2, radang, incolor);
444}
445
446
447
448/*--------------------------------------------------------------------------*
449 * In place about arbitrary lines *
450 *--------------------------------------------------------------------------*/
470l_ok
472 l_int32 yloc,
473 l_float32 radang,
474 l_int32 incolor)
475{
476l_int32 sign, w, h;
477l_int32 y, yincr, inityincr, hshift;
478l_float32 tanangle, invangle;
479
480 PROCNAME("pixHShearIP");
481
482 if (!pixs)
483 return ERROR_INT("pixs not defined", procName, 1);
484 if (incolor != L_BRING_IN_WHITE && incolor != L_BRING_IN_BLACK)
485 return ERROR_INT("invalid incolor value", procName, 1);
486 if (pixGetColormap(pixs))
487 return ERROR_INT("pixs is colormapped", procName, 1);
488
489 /* Normalize angle */
490 radang = normalizeAngleForShear(radang, MinDiffFromHalfPi);
491 if (radang == 0.0 || tan(radang) == 0.0)
492 return 0;
493
494 sign = L_SIGN(radang);
495 pixGetDimensions(pixs, &w, &h, NULL);
496 tanangle = tan(radang);
497 invangle = L_ABS(1. / tanangle);
498 inityincr = (l_int32)(invangle / 2.);
499 yincr = (l_int32)invangle;
500
501 if (inityincr > 0)
502 pixRasteropHip(pixs, yloc - inityincr, 2 * inityincr, 0, incolor);
503
504 for (hshift = 1, y = yloc + inityincr; y < h; hshift++) {
505 yincr = (l_int32)(invangle * (hshift + 0.5) + 0.5) - (y - yloc);
506 if (yincr == 0) continue;
507 if (h - y < yincr) /* reduce for last one if req'd */
508 yincr = h - y;
509 pixRasteropHip(pixs, y, yincr, -sign*hshift, incolor);
510 y += yincr;
511 }
512
513 for (hshift = -1, y = yloc - inityincr; y > 0; hshift--) {
514 yincr = (y - yloc) - (l_int32)(invangle * (hshift - 0.5) + 0.5);
515 if (yincr == 0) continue;
516 if (y < yincr) /* reduce for last one if req'd */
517 yincr = y;
518 pixRasteropHip(pixs, y - yincr, yincr, -sign*hshift, incolor);
519 y -= yincr;
520 }
521
522 return 0;
523}
524
525
545l_ok
547 l_int32 xloc,
548 l_float32 radang,
549 l_int32 incolor)
550{
551l_int32 sign, w, h;
552l_int32 x, xincr, initxincr, vshift;
553l_float32 tanangle, invangle;
554
555 PROCNAME("pixVShearIP");
556
557 if (!pixs)
558 return ERROR_INT("pixs not defined", procName, 1);
559 if (incolor != L_BRING_IN_WHITE && incolor != L_BRING_IN_BLACK)
560 return ERROR_INT("invalid incolor value", procName, 1);
561 if (pixGetColormap(pixs))
562 return ERROR_INT("pixs is colormapped", procName, 1);
563
564 /* Normalize angle */
565 radang = normalizeAngleForShear(radang, MinDiffFromHalfPi);
566 if (radang == 0.0 || tan(radang) == 0.0)
567 return 0;
568
569 sign = L_SIGN(radang);
570 pixGetDimensions(pixs, &w, &h, NULL);
571 tanangle = tan(radang);
572 invangle = L_ABS(1. / tanangle);
573 initxincr = (l_int32)(invangle / 2.);
574 xincr = (l_int32)invangle;
575
576 if (initxincr > 0)
577 pixRasteropVip(pixs, xloc - initxincr, 2 * initxincr, 0, incolor);
578
579 for (vshift = 1, x = xloc + initxincr; x < w; vshift++) {
580 xincr = (l_int32)(invangle * (vshift + 0.5) + 0.5) - (x - xloc);
581 if (xincr == 0) continue;
582 if (w - x < xincr) /* reduce for last one if req'd */
583 xincr = w - x;
584 pixRasteropVip(pixs, x, xincr, sign*vshift, incolor);
585 x += xincr;
586 }
587
588 for (vshift = -1, x = xloc - initxincr; x > 0; vshift--) {
589 xincr = (x - xloc) - (l_int32)(invangle * (vshift - 0.5) + 0.5);
590 if (xincr == 0) continue;
591 if (x < xincr) /* reduce for last one if req'd */
592 xincr = x;
593 pixRasteropVip(pixs, x - xincr, xincr, sign*vshift, incolor);
594 x -= xincr;
595 }
596
597 return 0;
598}
599
600
601/*-------------------------------------------------------------------------*
602 * Linear interpolated shear about arbitrary lines *
603 *-------------------------------------------------------------------------*/
628PIX *
630 l_int32 yloc,
631 l_float32 radang,
632 l_int32 incolor)
633{
634l_int32 i, jd, x, xp, xf, w, h, d, wm, wpls, wpld, val, rval, gval, bval;
635l_uint32 word0, word1;
636l_uint32 *datas, *datad, *lines, *lined;
637l_float32 tanangle, xshift;
638PIX *pix, *pixd;
639
640 PROCNAME("pixHShearLI");
641
642 if (!pixs)
643 return (PIX *)ERROR_PTR("pixs not defined", procName, NULL);
644 pixGetDimensions(pixs, &w, &h, &d);
645 if (d != 8 && d != 32 && !pixGetColormap(pixs))
646 return (PIX *)ERROR_PTR("pixs not 8, 32 bpp, or cmap", procName, NULL);
647 if (incolor != L_BRING_IN_WHITE && incolor != L_BRING_IN_BLACK)
648 return (PIX *)ERROR_PTR("invalid incolor value", procName, NULL);
649 if (yloc < 0 || yloc >= h)
650 return (PIX *)ERROR_PTR("yloc not in [0 ... h-1]", procName, NULL);
651
652 if (pixGetColormap(pixs))
654 else
655 pix = pixClone(pixs);
656
657 /* Normalize angle. If no rotation, return a copy */
658 radang = normalizeAngleForShear(radang, MinDiffFromHalfPi);
659 if (radang == 0.0 || tan(radang) == 0.0) {
660 pixDestroy(&pix);
661 return pixCopy(NULL, pixs);
662 }
663
664 /* Initialize to value of incoming pixels */
665 pixd = pixCreateTemplate(pix);
666 pixSetBlackOrWhite(pixd, incolor);
667
668 /* Standard linear interp: subdivide each pixel into 64 parts */
669 d = pixGetDepth(pixd); /* 8 or 32 */
670 datas = pixGetData(pix);
671 datad = pixGetData(pixd);
672 wpls = pixGetWpl(pix);
673 wpld = pixGetWpl(pixd);
674 tanangle = tan(radang);
675 for (i = 0; i < h; i++) {
676 lines = datas + i * wpls;
677 lined = datad + i * wpld;
678 xshift = (yloc - i) * tanangle;
679 for (jd = 0; jd < w; jd++) {
680 x = (l_int32)(64.0 * (-xshift + jd) + 0.5);
681 xp = x / 64;
682 xf = x & 63;
683 wm = w - 1;
684 if (xp < 0 || xp > wm) continue;
685 if (d == 8) {
686 if (xp < wm) {
687 val = ((63 - xf) * GET_DATA_BYTE(lines, xp) +
688 xf * GET_DATA_BYTE(lines, xp + 1) + 31) / 63;
689 } else { /* xp == wm */
690 val = GET_DATA_BYTE(lines, xp);
691 }
692 SET_DATA_BYTE(lined, jd, val);
693 } else { /* d == 32 */
694 if (xp < wm) {
695 word0 = *(lines + xp);
696 word1 = *(lines + xp + 1);
697 rval = ((63 - xf) * ((word0 >> L_RED_SHIFT) & 0xff) +
698 xf * ((word1 >> L_RED_SHIFT) & 0xff) + 31) / 63;
699 gval = ((63 - xf) * ((word0 >> L_GREEN_SHIFT) & 0xff) +
700 xf * ((word1 >> L_GREEN_SHIFT) & 0xff) + 31) / 63;
701 bval = ((63 - xf) * ((word0 >> L_BLUE_SHIFT) & 0xff) +
702 xf * ((word1 >> L_BLUE_SHIFT) & 0xff) + 31) / 63;
703 composeRGBPixel(rval, gval, bval, lined + jd);
704 } else { /* xp == wm */
705 lined[jd] = lines[xp];
706 }
707 }
708 }
709 }
710
711 pixDestroy(&pix);
712 return pixd;
713}
714
715
740PIX *
742 l_int32 xloc,
743 l_float32 radang,
744 l_int32 incolor)
745{
746l_int32 id, y, yp, yf, j, w, h, d, hm, wpls, wpld, val, rval, gval, bval;
747l_uint32 word0, word1;
748l_uint32 *datas, *datad, *lines, *lined;
749l_float32 tanangle, yshift;
750PIX *pix, *pixd;
751
752 PROCNAME("pixVShearLI");
753
754 if (!pixs)
755 return (PIX *)ERROR_PTR("pixs not defined", procName, NULL);
756 pixGetDimensions(pixs, &w, &h, &d);
757 if (d != 8 && d != 32 && !pixGetColormap(pixs))
758 return (PIX *)ERROR_PTR("pixs not 8, 32 bpp, or cmap", procName, NULL);
759 if (incolor != L_BRING_IN_WHITE && incolor != L_BRING_IN_BLACK)
760 return (PIX *)ERROR_PTR("invalid incolor value", procName, NULL);
761 if (xloc < 0 || xloc >= w)
762 return (PIX *)ERROR_PTR("xloc not in [0 ... w-1]", procName, NULL);
763
764 if (pixGetColormap(pixs))
766 else
767 pix = pixClone(pixs);
768
769 /* Normalize angle. If no rotation, return a copy */
770 radang = normalizeAngleForShear(radang, MinDiffFromHalfPi);
771 if (radang == 0.0 || tan(radang) == 0.0) {
772 pixDestroy(&pix);
773 return pixCopy(NULL, pixs);
774 }
775
776 /* Initialize to value of incoming pixels */
777 pixd = pixCreateTemplate(pix);
778 pixSetBlackOrWhite(pixd, incolor);
779
780 /* Standard linear interp: subdivide each pixel into 64 parts */
781 d = pixGetDepth(pixd); /* 8 or 32 */
782 datas = pixGetData(pix);
783 datad = pixGetData(pixd);
784 wpls = pixGetWpl(pix);
785 wpld = pixGetWpl(pixd);
786 tanangle = tan(radang);
787 for (j = 0; j < w; j++) {
788 yshift = (j - xloc) * tanangle;
789 for (id = 0; id < h; id++) {
790 y = (l_int32)(64.0 * (-yshift + id) + 0.5);
791 yp = y / 64;
792 yf = y & 63;
793 hm = h - 1;
794 if (yp < 0 || yp > hm) continue;
795 lines = datas + yp * wpls;
796 lined = datad + id * wpld;
797 if (d == 8) {
798 if (yp < hm) {
799 val = ((63 - yf) * GET_DATA_BYTE(lines, j) +
800 yf * GET_DATA_BYTE(lines + wpls, j) + 31) / 63;
801 } else { /* yp == hm */
802 val = GET_DATA_BYTE(lines, j);
803 }
804 SET_DATA_BYTE(lined, j, val);
805 } else { /* d == 32 */
806 if (yp < hm) {
807 word0 = *(lines + j);
808 word1 = *(lines + wpls + j);
809 rval = ((63 - yf) * ((word0 >> L_RED_SHIFT) & 0xff) +
810 yf * ((word1 >> L_RED_SHIFT) & 0xff) + 31) / 63;
811 gval = ((63 - yf) * ((word0 >> L_GREEN_SHIFT) & 0xff) +
812 yf * ((word1 >> L_GREEN_SHIFT) & 0xff) + 31) / 63;
813 bval = ((63 - yf) * ((word0 >> L_BLUE_SHIFT) & 0xff) +
814 yf * ((word1 >> L_BLUE_SHIFT) & 0xff) + 31) / 63;
815 composeRGBPixel(rval, gval, bval, lined + j);
816 } else { /* yp == hm */
817 lined[j] = lines[j];
818 }
819 }
820 }
821 }
822
823 pixDestroy(&pix);
824 return pixd;
825}
826
827
828/*-------------------------------------------------------------------------*
829 * Angle normalization *
830 *-------------------------------------------------------------------------*/
831static l_float32
832normalizeAngleForShear(l_float32 radang,
833 l_float32 mindif)
834{
835l_float32 pi2;
836
837 PROCNAME("normalizeAngleForShear");
838
839 /* Bring angle into range [-pi/2, pi/2] */
840 pi2 = 3.14159265 / 2.0;
841 if (radang < -pi2 || radang > pi2)
842 radang = radang - (l_int32)(radang / pi2) * pi2;
843
844 /* If angle is too close to pi/2 or -pi/2, move it */
845 if (radang > pi2 - mindif) {
846 L_WARNING("angle close to pi/2; shifting away\n", procName);
847 radang = pi2 - mindif;
848 } else if (radang < -pi2 + mindif) {
849 L_WARNING("angle close to -pi/2; shifting away\n", procName);
850 radang = -pi2 + mindif;
851 }
852
853 return radang;
854}
#define GET_DATA_BYTE(pdata, n)
Definition: arrayaccess.h:188
#define SET_DATA_BYTE(pdata, n, val)
Definition: arrayaccess.h:198
l_ok pixResizeImageData(PIX *pixd, const PIX *pixs)
pixResizeImageData()
Definition: pix1.c:768
void pixDestroy(PIX **ppix)
pixDestroy()
Definition: pix1.c:621
l_ok pixGetDimensions(const PIX *pix, l_int32 *pw, l_int32 *ph, l_int32 *pd)
pixGetDimensions()
Definition: pix1.c:1113
PIX * pixClone(PIX *pixs)
pixClone()
Definition: pix1.c:593
PIX * pixCreateTemplate(const PIX *pixs)
pixCreateTemplate()
Definition: pix1.c:383
PIX * pixCopy(PIX *pixd, const PIX *pixs)
pixCopy()
Definition: pix1.c:705
l_uint32 * pixGetData(PIX *pix)
pixGetData()
Definition: pix1.c:1763
l_ok composeRGBPixel(l_int32 rval, l_int32 gval, l_int32 bval, l_uint32 *ppixel)
composeRGBPixel()
Definition: pix2.c:2751
l_ok pixSetBlackOrWhite(PIX *pixs, l_int32 op)
pixSetBlackOrWhite()
Definition: pix2.c:1021
@ REMOVE_CMAP_BASED_ON_SRC
Definition: pix.h:260
#define PIX_SRC
Definition: pix.h:330
@ L_BRING_IN_BLACK
Definition: pix.h:870
@ L_BRING_IN_WHITE
Definition: pix.h:869
PIX * pixRemoveColormap(PIX *pixs, l_int32 type)
pixRemoveColormap()
Definition: pixconv.c:328
l_ok pixRasteropHip(PIX *pixd, l_int32 by, l_int32 bh, l_int32 hshift, l_int32 incolor)
pixRasteropHip()
Definition: rop.c:361
l_ok pixRasteropVip(PIX *pixd, l_int32 bx, l_int32 bw, l_int32 vshift, l_int32 incolor)
pixRasteropVip()
Definition: rop.c:283
l_ok pixRasterop(PIX *pixd, l_int32 dx, l_int32 dy, l_int32 dw, l_int32 dh, l_int32 op, PIX *pixs, l_int32 sx, l_int32 sy)
pixRasterop()
Definition: rop.c:204
PIX * pixVShearLI(PIX *pixs, l_int32 xloc, l_float32 radang, l_int32 incolor)
pixVShearLI()
Definition: shear.c:741
PIX * pixHShearCorner(PIX *pixd, PIX *pixs, l_float32 radang, l_int32 incolor)
pixHShearCorner()
Definition: shear.c:340
PIX * pixVShearCenter(PIX *pixd, PIX *pixs, l_float32 radang, l_int32 incolor)
pixVShearCenter()
Definition: shear.c:433
l_ok pixHShearIP(PIX *pixs, l_int32 yloc, l_float32 radang, l_int32 incolor)
pixHShearIP()
Definition: shear.c:471
PIX * pixHShearLI(PIX *pixs, l_int32 yloc, l_float32 radang, l_int32 incolor)
pixHShearLI()
Definition: shear.c:629
PIX * pixHShear(PIX *pixd, PIX *pixs, l_int32 yloc, l_float32 radang, l_int32 incolor)
pixHShear()
Definition: shear.c:117
PIX * pixHShearCenter(PIX *pixd, PIX *pixs, l_float32 radang, l_int32 incolor)
pixHShearCenter()
Definition: shear.c:402
l_ok pixVShearIP(PIX *pixs, l_int32 xloc, l_float32 radang, l_int32 incolor)
pixVShearIP()
Definition: shear.c:546
PIX * pixVShearCorner(PIX *pixd, PIX *pixs, l_float32 radang, l_int32 incolor)
pixVShearCorner()
Definition: shear.c:371
PIX * pixVShear(PIX *pixd, PIX *pixs, l_int32 xloc, l_float32 radang, l_int32 incolor)
pixVShear()
Definition: shear.c:238
Definition: pix.h:139
void lept_stderr(const char *fmt,...)
lept_stderr()
Definition: utils1.c:306