Leptonica  1.83.1
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 */
64 static const l_float32 MinDiffFromHalfPi = 0.04;
65 
66 static 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  *-------------------------------------------------------------*/
116 PIX *
118  PIX *pixs,
119  l_int32 yloc,
120  l_float32 radang,
121  l_int32 incolor)
122 {
123 l_int32 sign, w, h;
124 l_int32 y, yincr, inityincr, hshift;
125 l_float32 tanangle, invangle;
126 
127  if (!pixs)
128  return (PIX *)ERROR_PTR("pixs not defined", __func__, pixd);
129  if (incolor != L_BRING_IN_WHITE && incolor != L_BRING_IN_BLACK)
130  return (PIX *)ERROR_PTR("invalid incolor value", __func__, pixd);
131 
132  if (pixd == pixs) { /* in place */
133  if (!pixGetColormap(pixs)) {
134  pixHShearIP(pixd, yloc, radang, incolor);
135  } else { /* can't do in-place with a colormap */
136  PIX *pix1 = pixCopy(NULL, pixs);
137  pixHShear(pixd, pix1, yloc, radang, incolor);
138  pixDestroy(&pix1);
139  }
140  return pixd;
141  }
142 
143  /* Make sure pixd exists and is same size as pixs */
144  if (!pixd) {
145  if ((pixd = pixCreateTemplate(pixs)) == NULL)
146  return (PIX *)ERROR_PTR("pixd not made", __func__, NULL);
147  } else { /* pixd != pixs */
148  pixResizeImageData(pixd, pixs);
149  }
150 
151  /* Normalize angle. If no rotation, return a copy */
152  radang = normalizeAngleForShear(radang, MinDiffFromHalfPi);
153  if (radang == 0.0 || tan(radang) == 0.0)
154  return pixCopy(pixd, pixs);
155 
156  /* Initialize to value of incoming pixels */
157  pixSetBlackOrWhite(pixd, incolor);
158 
159  pixGetDimensions(pixs, &w, &h, NULL);
160  sign = L_SIGN(radang);
161  tanangle = tan(radang);
162  invangle = L_ABS(1. / tanangle);
163  inityincr = (l_int32)(invangle / 2.);
164  yincr = (l_int32)invangle;
165  pixRasterop(pixd, 0, yloc - inityincr, w, 2 * inityincr, PIX_SRC,
166  pixs, 0, yloc - inityincr);
167 
168  for (hshift = 1, y = yloc + inityincr; y < h; hshift++) {
169  yincr = (l_int32)(invangle * (hshift + 0.5) + 0.5) - (y - yloc);
170  if (h - y < yincr) /* reduce for last one if req'd */
171  yincr = h - y;
172  pixRasterop(pixd, -sign*hshift, y, w, yincr, PIX_SRC, pixs, 0, y);
173 #if DEBUG
174  lept_stderr("y = %d, hshift = %d, yincr = %d\n", y, hshift, yincr);
175 #endif /* DEBUG */
176  y += yincr;
177  }
178 
179  for (hshift = -1, y = yloc - inityincr; y > 0; hshift--) {
180  yincr = (y - yloc) - (l_int32)(invangle * (hshift - 0.5) + 0.5);
181  if (y < yincr) /* reduce for last one if req'd */
182  yincr = y;
183  pixRasterop(pixd, -sign*hshift, y - yincr, w, yincr, PIX_SRC,
184  pixs, 0, y - yincr);
185 #if DEBUG
186  lept_stderr("y = %d, hshift = %d, yincr = %d\n",
187  y - yincr, hshift, yincr);
188 #endif /* DEBUG */
189  y -= yincr;
190  }
191 
192  return pixd;
193 }
194 
195 
235 PIX *
237  PIX *pixs,
238  l_int32 xloc,
239  l_float32 radang,
240  l_int32 incolor)
241 {
242 l_int32 sign, w, h;
243 l_int32 x, xincr, initxincr, vshift;
244 l_float32 tanangle, invangle;
245 
246  if (!pixs)
247  return (PIX *)ERROR_PTR("pixs not defined", __func__, NULL);
248  if (incolor != L_BRING_IN_WHITE && incolor != L_BRING_IN_BLACK)
249  return (PIX *)ERROR_PTR("invalid incolor value", __func__, NULL);
250 
251  if (pixd == pixs) { /* in place */
252  if (!pixGetColormap(pixs)) {
253  pixVShearIP(pixd, xloc, radang, incolor);
254  } else { /* can't do in-place with a colormap */
255  PIX *pix1 = pixCopy(NULL, pixs);
256  pixVShear(pixd, pix1, xloc, radang, incolor);
257  pixDestroy(&pix1);
258  }
259  return pixd;
260  }
261 
262  /* Make sure pixd exists and is same size as pixs */
263  if (!pixd) {
264  if ((pixd = pixCreateTemplate(pixs)) == NULL)
265  return (PIX *)ERROR_PTR("pixd not made", __func__, NULL);
266  } else { /* pixd != pixs */
267  pixResizeImageData(pixd, pixs);
268  }
269 
270  /* Normalize angle. If no rotation, return a copy */
271  radang = normalizeAngleForShear(radang, MinDiffFromHalfPi);
272  if (radang == 0.0 || tan(radang) == 0.0)
273  return pixCopy(pixd, pixs);
274 
275  /* Initialize to value of incoming pixels */
276  pixSetBlackOrWhite(pixd, incolor);
277 
278  pixGetDimensions(pixs, &w, &h, NULL);
279  sign = L_SIGN(radang);
280  tanangle = tan(radang);
281  invangle = L_ABS(1. / tanangle);
282  initxincr = (l_int32)(invangle / 2.);
283  xincr = (l_int32)invangle;
284  pixRasterop(pixd, xloc - initxincr, 0, 2 * initxincr, h, PIX_SRC,
285  pixs, xloc - initxincr, 0);
286 
287  for (vshift = 1, x = xloc + initxincr; x < w; vshift++) {
288  xincr = (l_int32)(invangle * (vshift + 0.5) + 0.5) - (x - xloc);
289  if (w - x < xincr) /* reduce for last one if req'd */
290  xincr = w - x;
291  pixRasterop(pixd, x, sign*vshift, xincr, h, PIX_SRC, pixs, x, 0);
292 #if DEBUG
293  lept_stderr("x = %d, vshift = %d, xincr = %d\n", x, vshift, xincr);
294 #endif /* DEBUG */
295  x += xincr;
296  }
297 
298  for (vshift = -1, x = xloc - initxincr; x > 0; vshift--) {
299  xincr = (x - xloc) - (l_int32)(invangle * (vshift - 0.5) + 0.5);
300  if (x < xincr) /* reduce for last one if req'd */
301  xincr = x;
302  pixRasterop(pixd, x - xincr, sign*vshift, xincr, h, PIX_SRC,
303  pixs, x - xincr, 0);
304 #if DEBUG
305  lept_stderr("x = %d, vshift = %d, xincr = %d\n",
306  x - xincr, vshift, xincr);
307 #endif /* DEBUG */
308  x -= xincr;
309  }
310 
311  return pixd;
312 }
313 
314 
315 
316 /*-------------------------------------------------------------*
317  * Shears about UL corner and center *
318  *-------------------------------------------------------------*/
335 PIX *
337  PIX *pixs,
338  l_float32 radang,
339  l_int32 incolor)
340 {
341  if (!pixs)
342  return (PIX *)ERROR_PTR("pixs not defined", __func__, pixd);
343 
344  return pixHShear(pixd, pixs, 0, radang, incolor);
345 }
346 
347 
364 PIX *
366  PIX *pixs,
367  l_float32 radang,
368  l_int32 incolor)
369 {
370  if (!pixs)
371  return (PIX *)ERROR_PTR("pixs not defined", __func__, pixd);
372 
373  return pixVShear(pixd, pixs, 0, radang, incolor);
374 }
375 
376 
393 PIX *
395  PIX *pixs,
396  l_float32 radang,
397  l_int32 incolor)
398 {
399  if (!pixs)
400  return (PIX *)ERROR_PTR("pixs not defined", __func__, pixd);
401 
402  return pixHShear(pixd, pixs, pixGetHeight(pixs) / 2, radang, incolor);
403 }
404 
405 
422 PIX *
424  PIX *pixs,
425  l_float32 radang,
426  l_int32 incolor)
427 {
428  if (!pixs)
429  return (PIX *)ERROR_PTR("pixs not defined", __func__, pixd);
430 
431  return pixVShear(pixd, pixs, pixGetWidth(pixs) / 2, radang, incolor);
432 }
433 
434 
435 
436 /*--------------------------------------------------------------------------*
437  * In place about arbitrary lines *
438  *--------------------------------------------------------------------------*/
458 l_ok
460  l_int32 yloc,
461  l_float32 radang,
462  l_int32 incolor)
463 {
464 l_int32 sign, w, h;
465 l_int32 y, yincr, inityincr, hshift;
466 l_float32 tanangle, invangle;
467 
468  if (!pixs)
469  return ERROR_INT("pixs not defined", __func__, 1);
470  if (incolor != L_BRING_IN_WHITE && incolor != L_BRING_IN_BLACK)
471  return ERROR_INT("invalid incolor value", __func__, 1);
472  if (pixGetColormap(pixs))
473  return ERROR_INT("pixs is colormapped", __func__, 1);
474 
475  /* Normalize angle */
476  radang = normalizeAngleForShear(radang, MinDiffFromHalfPi);
477  if (radang == 0.0 || tan(radang) == 0.0)
478  return 0;
479 
480  sign = L_SIGN(radang);
481  pixGetDimensions(pixs, &w, &h, NULL);
482  tanangle = tan(radang);
483  invangle = L_ABS(1. / tanangle);
484  inityincr = (l_int32)(invangle / 2.);
485  yincr = (l_int32)invangle;
486 
487  if (inityincr > 0)
488  pixRasteropHip(pixs, yloc - inityincr, 2 * inityincr, 0, incolor);
489 
490  for (hshift = 1, y = yloc + inityincr; y < h; hshift++) {
491  yincr = (l_int32)(invangle * (hshift + 0.5) + 0.5) - (y - yloc);
492  if (yincr == 0) continue;
493  if (h - y < yincr) /* reduce for last one if req'd */
494  yincr = h - y;
495  pixRasteropHip(pixs, y, yincr, -sign*hshift, incolor);
496  y += yincr;
497  }
498 
499  for (hshift = -1, y = yloc - inityincr; y > 0; hshift--) {
500  yincr = (y - yloc) - (l_int32)(invangle * (hshift - 0.5) + 0.5);
501  if (yincr == 0) continue;
502  if (y < yincr) /* reduce for last one if req'd */
503  yincr = y;
504  pixRasteropHip(pixs, y - yincr, yincr, -sign*hshift, incolor);
505  y -= yincr;
506  }
507 
508  return 0;
509 }
510 
511 
531 l_ok
533  l_int32 xloc,
534  l_float32 radang,
535  l_int32 incolor)
536 {
537 l_int32 sign, w, h;
538 l_int32 x, xincr, initxincr, vshift;
539 l_float32 tanangle, invangle;
540 
541  if (!pixs)
542  return ERROR_INT("pixs not defined", __func__, 1);
543  if (incolor != L_BRING_IN_WHITE && incolor != L_BRING_IN_BLACK)
544  return ERROR_INT("invalid incolor value", __func__, 1);
545  if (pixGetColormap(pixs))
546  return ERROR_INT("pixs is colormapped", __func__, 1);
547 
548  /* Normalize angle */
549  radang = normalizeAngleForShear(radang, MinDiffFromHalfPi);
550  if (radang == 0.0 || tan(radang) == 0.0)
551  return 0;
552 
553  sign = L_SIGN(radang);
554  pixGetDimensions(pixs, &w, &h, NULL);
555  tanangle = tan(radang);
556  invangle = L_ABS(1. / tanangle);
557  initxincr = (l_int32)(invangle / 2.);
558  xincr = (l_int32)invangle;
559 
560  if (initxincr > 0)
561  pixRasteropVip(pixs, xloc - initxincr, 2 * initxincr, 0, incolor);
562 
563  for (vshift = 1, x = xloc + initxincr; x < w; vshift++) {
564  xincr = (l_int32)(invangle * (vshift + 0.5) + 0.5) - (x - xloc);
565  if (xincr == 0) continue;
566  if (w - x < xincr) /* reduce for last one if req'd */
567  xincr = w - x;
568  pixRasteropVip(pixs, x, xincr, sign*vshift, incolor);
569  x += xincr;
570  }
571 
572  for (vshift = -1, x = xloc - initxincr; x > 0; vshift--) {
573  xincr = (x - xloc) - (l_int32)(invangle * (vshift - 0.5) + 0.5);
574  if (xincr == 0) continue;
575  if (x < xincr) /* reduce for last one if req'd */
576  xincr = x;
577  pixRasteropVip(pixs, x - xincr, xincr, sign*vshift, incolor);
578  x -= xincr;
579  }
580 
581  return 0;
582 }
583 
584 
585 /*-------------------------------------------------------------------------*
586  * Linear interpolated shear about arbitrary lines *
587  *-------------------------------------------------------------------------*/
612 PIX *
614  l_int32 yloc,
615  l_float32 radang,
616  l_int32 incolor)
617 {
618 l_int32 i, jd, x, xp, xf, w, h, d, wm, wpls, wpld, val, rval, gval, bval;
619 l_uint32 word0, word1;
620 l_uint32 *datas, *datad, *lines, *lined;
621 l_float32 tanangle, xshift;
622 PIX *pix, *pixd;
623 
624  if (!pixs)
625  return (PIX *)ERROR_PTR("pixs not defined", __func__, NULL);
626  pixGetDimensions(pixs, &w, &h, &d);
627  if (d != 8 && d != 32 && !pixGetColormap(pixs))
628  return (PIX *)ERROR_PTR("pixs not 8, 32 bpp, or cmap", __func__, NULL);
629  if (incolor != L_BRING_IN_WHITE && incolor != L_BRING_IN_BLACK)
630  return (PIX *)ERROR_PTR("invalid incolor value", __func__, NULL);
631  if (yloc < 0 || yloc >= h)
632  return (PIX *)ERROR_PTR("yloc not in [0 ... h-1]", __func__, NULL);
633 
634  if (pixGetColormap(pixs))
636  else
637  pix = pixClone(pixs);
638 
639  /* Normalize angle. If no rotation, return a copy */
640  radang = normalizeAngleForShear(radang, MinDiffFromHalfPi);
641  if (radang == 0.0 || tan(radang) == 0.0) {
642  pixDestroy(&pix);
643  return pixCopy(NULL, pixs);
644  }
645 
646  /* Initialize to value of incoming pixels */
647  pixd = pixCreateTemplate(pix);
648  pixSetBlackOrWhite(pixd, incolor);
649 
650  /* Standard linear interp: subdivide each pixel into 64 parts */
651  d = pixGetDepth(pixd); /* 8 or 32 */
652  datas = pixGetData(pix);
653  datad = pixGetData(pixd);
654  wpls = pixGetWpl(pix);
655  wpld = pixGetWpl(pixd);
656  tanangle = tan(radang);
657  for (i = 0; i < h; i++) {
658  lines = datas + i * wpls;
659  lined = datad + i * wpld;
660  xshift = (yloc - i) * tanangle;
661  for (jd = 0; jd < w; jd++) {
662  x = (l_int32)(64.0 * (-xshift + jd) + 0.5);
663  xp = x / 64;
664  xf = x & 63;
665  wm = w - 1;
666  if (xp < 0 || xp > wm) continue;
667  if (d == 8) {
668  if (xp < wm) {
669  val = ((63 - xf) * GET_DATA_BYTE(lines, xp) +
670  xf * GET_DATA_BYTE(lines, xp + 1) + 31) / 63;
671  } else { /* xp == wm */
672  val = GET_DATA_BYTE(lines, xp);
673  }
674  SET_DATA_BYTE(lined, jd, val);
675  } else { /* d == 32 */
676  if (xp < wm) {
677  word0 = *(lines + xp);
678  word1 = *(lines + xp + 1);
679  rval = ((63 - xf) * ((word0 >> L_RED_SHIFT) & 0xff) +
680  xf * ((word1 >> L_RED_SHIFT) & 0xff) + 31) / 63;
681  gval = ((63 - xf) * ((word0 >> L_GREEN_SHIFT) & 0xff) +
682  xf * ((word1 >> L_GREEN_SHIFT) & 0xff) + 31) / 63;
683  bval = ((63 - xf) * ((word0 >> L_BLUE_SHIFT) & 0xff) +
684  xf * ((word1 >> L_BLUE_SHIFT) & 0xff) + 31) / 63;
685  composeRGBPixel(rval, gval, bval, lined + jd);
686  } else { /* xp == wm */
687  lined[jd] = lines[xp];
688  }
689  }
690  }
691  }
692 
693  pixDestroy(&pix);
694  return pixd;
695 }
696 
697 
722 PIX *
724  l_int32 xloc,
725  l_float32 radang,
726  l_int32 incolor)
727 {
728 l_int32 id, y, yp, yf, j, w, h, d, hm, wpls, wpld, val, rval, gval, bval;
729 l_uint32 word0, word1;
730 l_uint32 *datas, *datad, *lines, *lined;
731 l_float32 tanangle, yshift;
732 PIX *pix, *pixd;
733 
734  if (!pixs)
735  return (PIX *)ERROR_PTR("pixs not defined", __func__, NULL);
736  pixGetDimensions(pixs, &w, &h, &d);
737  if (d != 8 && d != 32 && !pixGetColormap(pixs))
738  return (PIX *)ERROR_PTR("pixs not 8, 32 bpp, or cmap", __func__, NULL);
739  if (incolor != L_BRING_IN_WHITE && incolor != L_BRING_IN_BLACK)
740  return (PIX *)ERROR_PTR("invalid incolor value", __func__, NULL);
741  if (xloc < 0 || xloc >= w)
742  return (PIX *)ERROR_PTR("xloc not in [0 ... w-1]", __func__, NULL);
743 
744  if (pixGetColormap(pixs))
746  else
747  pix = pixClone(pixs);
748 
749  /* Normalize angle. If no rotation, return a copy */
750  radang = normalizeAngleForShear(radang, MinDiffFromHalfPi);
751  if (radang == 0.0 || tan(radang) == 0.0) {
752  pixDestroy(&pix);
753  return pixCopy(NULL, pixs);
754  }
755 
756  /* Initialize to value of incoming pixels */
757  pixd = pixCreateTemplate(pix);
758  pixSetBlackOrWhite(pixd, incolor);
759 
760  /* Standard linear interp: subdivide each pixel into 64 parts */
761  d = pixGetDepth(pixd); /* 8 or 32 */
762  datas = pixGetData(pix);
763  datad = pixGetData(pixd);
764  wpls = pixGetWpl(pix);
765  wpld = pixGetWpl(pixd);
766  tanangle = tan(radang);
767  for (j = 0; j < w; j++) {
768  yshift = (j - xloc) * tanangle;
769  for (id = 0; id < h; id++) {
770  y = (l_int32)(64.0 * (-yshift + id) + 0.5);
771  yp = y / 64;
772  yf = y & 63;
773  hm = h - 1;
774  if (yp < 0 || yp > hm) continue;
775  lines = datas + yp * wpls;
776  lined = datad + id * wpld;
777  if (d == 8) {
778  if (yp < hm) {
779  val = ((63 - yf) * GET_DATA_BYTE(lines, j) +
780  yf * GET_DATA_BYTE(lines + wpls, j) + 31) / 63;
781  } else { /* yp == hm */
782  val = GET_DATA_BYTE(lines, j);
783  }
784  SET_DATA_BYTE(lined, j, val);
785  } else { /* d == 32 */
786  if (yp < hm) {
787  word0 = *(lines + j);
788  word1 = *(lines + wpls + j);
789  rval = ((63 - yf) * ((word0 >> L_RED_SHIFT) & 0xff) +
790  yf * ((word1 >> L_RED_SHIFT) & 0xff) + 31) / 63;
791  gval = ((63 - yf) * ((word0 >> L_GREEN_SHIFT) & 0xff) +
792  yf * ((word1 >> L_GREEN_SHIFT) & 0xff) + 31) / 63;
793  bval = ((63 - yf) * ((word0 >> L_BLUE_SHIFT) & 0xff) +
794  yf * ((word1 >> L_BLUE_SHIFT) & 0xff) + 31) / 63;
795  composeRGBPixel(rval, gval, bval, lined + j);
796  } else { /* yp == hm */
797  lined[j] = lines[j];
798  }
799  }
800  }
801  }
802 
803  pixDestroy(&pix);
804  return pixd;
805 }
806 
807 
808 /*-------------------------------------------------------------------------*
809  * Angle normalization *
810  *-------------------------------------------------------------------------*/
811 static l_float32
812 normalizeAngleForShear(l_float32 radang,
813  l_float32 mindif)
814 {
815 l_float32 pi2;
816 
817  /* Bring angle into range [-pi/2, pi/2] */
818  pi2 = 3.14159265 / 2.0;
819  if (radang < -pi2 || radang > pi2)
820  radang = radang - (l_int32)(radang / pi2) * pi2;
821 
822  /* If angle is too close to pi/2 or -pi/2, move it */
823  if (radang > pi2 - mindif) {
824  L_WARNING("angle close to pi/2; shifting away\n", __func__);
825  radang = pi2 - mindif;
826  } else if (radang < -pi2 + mindif) {
827  L_WARNING("angle close to -pi/2; shifting away\n", __func__);
828  radang = -pi2 + mindif;
829  }
830 
831  return radang;
832 }
#define GET_DATA_BYTE(pdata, n)
Definition: arrayaccess.h:188
#define SET_DATA_BYTE(pdata, n, val)
Definition: arrayaccess.h:198
l_uint32 * pixGetData(PIX *pix)
pixGetData()
Definition: pix1.c:1642
l_ok pixResizeImageData(PIX *pixd, const PIX *pixs)
pixResizeImageData()
Definition: pix1.c:750
void pixDestroy(PIX **ppix)
pixDestroy()
Definition: pix1.c:608
l_ok pixGetDimensions(const PIX *pix, l_int32 *pw, l_int32 *ph, l_int32 *pd)
pixGetDimensions()
Definition: pix1.c:1074
PIX * pixCopy(PIX *pixd, const PIX *pixs)
pixCopy()
Definition: pix1.c:689
PIX * pixCreateTemplate(const PIX *pixs)
pixCreateTemplate()
Definition: pix1.c:380
PIX * pixClone(PIX *pixs)
pixClone()
Definition: pix1.c:582
l_ok composeRGBPixel(l_int32 rval, l_int32 gval, l_int32 bval, l_uint32 *ppixel)
composeRGBPixel()
Definition: pix2.c:2728
l_ok pixSetBlackOrWhite(PIX *pixs, l_int32 op)
pixSetBlackOrWhite()
Definition: pix2.c:997
@ REMOVE_CMAP_BASED_ON_SRC
Definition: pix.h:384
#define PIX_SRC
Definition: pix.h:444
@ L_BRING_IN_BLACK
Definition: pix.h:663
@ L_BRING_IN_WHITE
Definition: pix.h:662
PIX * pixRemoveColormap(PIX *pixs, l_int32 type)
pixRemoveColormap()
Definition: pixconv.c:324
l_ok pixRasteropHip(PIX *pixd, l_int32 by, l_int32 bh, l_int32 hshift, l_int32 incolor)
pixRasteropHip()
Definition: rop.c:357
l_ok pixRasteropVip(PIX *pixd, l_int32 bx, l_int32 bw, l_int32 vshift, l_int32 incolor)
pixRasteropVip()
Definition: rop.c:281
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 * pixHShearCenter(PIX *pixd, PIX *pixs, l_float32 radang, l_int32 incolor)
pixHShearCenter()
Definition: shear.c:394
PIX * pixVShear(PIX *pixd, PIX *pixs, l_int32 xloc, l_float32 radang, l_int32 incolor)
pixVShear()
Definition: shear.c:236
l_ok pixHShearIP(PIX *pixs, l_int32 yloc, l_float32 radang, l_int32 incolor)
pixHShearIP()
Definition: shear.c:459
PIX * pixVShearCenter(PIX *pixd, PIX *pixs, l_float32 radang, l_int32 incolor)
pixVShearCenter()
Definition: shear.c:423
PIX * pixHShearLI(PIX *pixs, l_int32 yloc, l_float32 radang, l_int32 incolor)
pixHShearLI()
Definition: shear.c:613
PIX * pixVShearCorner(PIX *pixd, PIX *pixs, l_float32 radang, l_int32 incolor)
pixVShearCorner()
Definition: shear.c:365
PIX * pixHShearCorner(PIX *pixd, PIX *pixs, l_float32 radang, l_int32 incolor)
pixHShearCorner()
Definition: shear.c:336
l_ok pixVShearIP(PIX *pixs, l_int32 xloc, l_float32 radang, l_int32 incolor)
pixVShearIP()
Definition: shear.c:532
PIX * pixVShearLI(PIX *pixs, l_int32 xloc, l_float32 radang, l_int32 incolor)
pixVShearLI()
Definition: shear.c:723
PIX * pixHShear(PIX *pixd, PIX *pixs, l_int32 yloc, l_float32 radang, l_int32 incolor)
pixHShear()
Definition: shear.c:117
void lept_stderr(const char *fmt,...)
lept_stderr()
Definition: utils1.c:306