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