w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

pix1.c
Go to the documentation of this file.
1 /*====================================================================*
2  - Copyright (C) 2001 Leptonica. All rights reserved.
3  - This software is distributed in the hope that it will be
4  - useful, but with NO WARRANTY OF ANY KIND.
5  - No author or distributor accepts responsibility to anyone for the
6  - consequences of using this software, or for whether it serves any
7  - particular purpose or works at all, unless he or she says so in
8  - writing. Everyone is granted permission to copy, modify and
9  - redistribute this source code, for commercial or non-commercial
10  - purposes, with the following restrictions: (1) the origin of this
11  - source code must not be misrepresented; (2) modified versions must
12  - be plainly marked as such; and (3) this notice may not be removed
13  - or altered from any source or modified source distribution.
14  *====================================================================*/
15 
16 
17 /*
18  * pix1.c
19  *
20  * Pix creation
21  * PIX *pixCreate()
22  * PIX *pixCreateTemplate()
23  * PIX *pixClone()
24  *
25  * Pix destruction
26  * void pixDestroy()
27  *
28  * Pix copy
29  * PIX *pixCopy()
30  * l_int32 pixCopyColormap()
31  * l_int32 pixSizesEqual()
32  *
33  * Pix accessors
34  * l_int32 pixGetWidth()
35  * l_int32 pixSetWidth()
36  * l_int32 pixGetHeight()
37  * l_int32 pixSetHeight()
38  * l_int32 pixGetDepth()
39  * l_int32 pixSetDepth()
40  * l_int32 pixGetWpl()
41  * l_int32 pixSetWpl()
42  * l_int32 pixGetRefcount()
43  * l_int32 pixChangeRefcount()
44  * l_uint32 pixGetXRes()
45  * l_uint32 pixGetYRes()
46  * l_int32 pixSetXRes()
47  * l_int32 pixSetYRes()
48  * l_int32 pixCopyResolution()
49  * l_int32 pixScaleResolution()
50  * l_int32 pixGetInputFormat()
51  * l_int32 pixSetInputFormat()
52  * l_int32 pixCopyInputFormat()
53  * char *pixGetText()
54  * l_int32 pixSetText()
55  * l_int32 pixAddText()
56  * l_int32 pixCopyText()
57  * l_int32 pixDestroyColormap()
58  * PIXCMAP *pixGetColormap()
59  * l_int32 pixSetColormap()
60  * l_uint32 *pixGetData()
61  * l_int32 pixSetData()
62  *
63  * Pix debug
64  * l_int32 pixPrintStreamInfo()
65  */
66 
67 #include <stdio.h>
68 #include <stdlib.h>
69 #include <string.h>
70 #include "allheaders.h"
71 
72  /* Can use this to pad each rasterline. Not presently necessary */
73 static const l_int32 EXTRA_WORDS_ON_RIGHT = 0;
74 
75 #ifndef NO_CONSOLE_IO
76 #define DEBUG 0
77 #endif /* ~NO_CONSOLE_IO */
78 
79 
80 /*--------------------------------------------------------------------*
81  * Pix Creation *
82  *--------------------------------------------------------------------*/
83 /*!
84  * pixCreate()
85  *
86  * Input: width, height, depth
87  * Return: pixd (with data allocated), or null on error
88  */
89 PIX *
92  l_int32 depth)
93 {
94 l_int32 wpl;
95 PIX *pixd;
96 l_uint32 *data;
97 
98  PROCNAME("pixCreate");
99 
100  if ((depth != 1) && (depth != 2) && (depth != 4) && (depth != 8)
101  && (depth != 16) && (depth != 24) && (depth != 32))
102  return (PIX *)ERROR_PTR("depth must be {1, 2, 4, 8, 16, 24, 32}",
103  procName, NULL);
104  if (width <= 0)
105  return (PIX *)ERROR_PTR("width must be > 0", procName, NULL);
106  if (height <= 0)
107  return (PIX *)ERROR_PTR("height must be > 0", procName, NULL);
108 
109  if ((pixd = (PIX *)CALLOC(1, sizeof(PIX))) == NULL)
110  return (PIX *)ERROR_PTR("CALLOC fail for pixd", procName, NULL);
111 
112  pixSetWidth(pixd, width);
113  pixSetHeight(pixd, height);
114  pixSetDepth(pixd, depth);
115 
116  /* So far, there is no need to add an extra word to each
117  * raster line. But the mechanism is here if needed, and
118  * should have no side effects if enabled, as all ops that
119  * use the word pad bits use the actual image width, not wpl.
120  * When I got valgrind, I found that rasteropGeneralLow() was
121  * making occasional read errors one word off the end
122  * of the data, and adding an extra word to each raster
123  * line was a quick fix, but is currently not necessary. */
124  wpl = (width * depth + 31) / 32 + EXTRA_WORDS_ON_RIGHT;
125  pixSetWpl(pixd, wpl);
126  if ((data = (l_uint32 *)CALLOC(4 * wpl, height)) == NULL)
127  return (PIX *)ERROR_PTR("CALLOC fail for data", procName, NULL);
128  pixSetData(pixd, data);
129  pixd->refcount = 1;
130  pixd->informat = IFF_UNKNOWN;
131 
132  return pixd;
133 }
134 
135 
136 /*!
137  * pixCreateTemplate()
138  *
139  * Input: pixs
140  * Return: pixd, or null on error
141  *
142  * Notes:
143  * (1) Makes a Pix of the same size as the input Pix, allocating
144  * the data array, but without copying the image data from pixs.
145  * (2) Copies the other fields, including colormap if it exists.
146  */
147 PIX *
149 {
150 l_int32 w, h, d;
151 PIX *pixd;
152 
153  PROCNAME("pixCreateTemplate");
154 
155  if (!pixs)
156  return (PIX *)ERROR_PTR("pixs not defined", procName, NULL);
157 
158  w = pixGetWidth(pixs);
159  h = pixGetHeight(pixs);
160  d = pixGetDepth(pixs);
161 
162  if ((pixd = pixCreate(w, h, d)) == NULL)
163  return (PIX *)ERROR_PTR("pixd not made", procName, NULL);
164 
165  pixCopyResolution(pixd, pixs);
166  pixCopyColormap(pixd, pixs);
167  pixCopyText(pixd, pixs);
168  pixCopyInputFormat(pixd, pixs);
169 
170  return pixd;
171 }
172 
173 
174 /*!
175  * pixClone()
176  *
177  * Input: pix
178  * Return: same pix (ptr), or null on error
179  *
180  * Note: Why is this here? We make a "clone", which
181  * is just another handle to an existing pix, because
182  * (1) images can be large and hence expensive to copy,
183  * (2) extra handles to a data structure that are made
184  * without some control are dangerous because if you
185  * have two (say), how do you know which one should be
186  * used to destroy the pix, and, conversely, if you
187  * destroy the pix, how do you remember that the other
188  * handle is no longer valid? This is solved by a
189  * simple protocol: (1) whenever you want a new handle
190  * to an existing image, call pixClone(), which just
191  * bumps a ref count, and (2) always call pixDestroy()
192  * on ALL handles, which decrements the ref count,
193  * nulls the handle, and only destroys the pix when
194  * pixDestroy() has been called on all handles.
195  */
196 PIX *
197 pixClone(PIX *pixs)
198 {
199  PROCNAME("pixClone");
200 
201  if (!pixs)
202  return (PIX *)ERROR_PTR("pixs not defined", procName, NULL);
203 
204  pixChangeRefcount(pixs, 1);
205 
206  return pixs;
207 }
208 
209 
210 
211 /*--------------------------------------------------------------------*
212  * Pix Destruction *
213  *--------------------------------------------------------------------*/
214 /*!
215  * pixDestroy()
216  *
217  * Input: &pix <can be nulled>
218  * Return: void
219  *
220  * Notes:
221  * (1) Decrements the ref count and, if 0, destroys the pix.
222  * (2) Always nulls the input ptr.
223  */
224 void
226 {
227 l_uint32 *data;
228 char *text;
229 PIX *pix;
230 
231  PROCNAME("pixDestroy");
232 
233  if (!ppix) {
234  L_WARNING("ptr address is null!", procName);
235  return;
236  }
237 
238  if ((pix = *ppix) == NULL)
239  return;
240 
241  /* Decrement the ref count. If it is 0, destroy the pix. */
242  pixChangeRefcount(pix, -1);
243  if (pixGetRefcount(pix) <= 0) {
244  if ((data = pixGetData(pix)))
245  FREE((void *)data);
246  if ((text = pixGetText(pix)))
247  FREE((void *)text);
249  FREE((void *)pix);
250  }
251 
252  *ppix = NULL;
253  return;
254 }
255 
256 
257 /*-------------------------------------------------------------------------*
258  * Pix Copy *
259  *-------------------------------------------------------------------------*/
260 /*!
261  * pixCopy()
262  *
263  * Input: pixd (<optional>)
264  * pixs
265  * Return: pixd, or null on error
266  *
267  * Notes:
268  * (1) If pixd = NULL, this makes a new copy, with refcount of 1.
269  * If pixd != NULL, this makes sure pixs and pixd are the same
270  * size, and then copies the image data, leaving the refcounts
271  * of pixs and pixd unchanged.
272  * (2) This operation, like all others that may involve a pre-existing
273  * pixd, will side-effect any existing clones of pixd.
274  */
275 PIX *
276 pixCopy(PIX *pixd, /* can be null */
277  PIX *pixs)
278 {
279 l_int32 bytes;
280 l_uint32 *datas, *datad;
281 
282  PROCNAME("pixCopy");
283 
284  if (!pixs)
285  return (PIX *)ERROR_PTR("pixs not defined", procName, pixd);
286 
287  /* Total bytes in image data */
288  bytes = 4 * pixGetWpl(pixs) * pixGetHeight(pixs);
289 
290  /* If we're making a new pix ... */
291  if (!pixd) {
292  if ((pixd = pixCreateTemplate(pixs)) == NULL)
293  return (PIX *)ERROR_PTR("pixd not made", procName, NULL);
294  datas = pixGetData(pixs);
295  datad = pixGetData(pixd);
296  memcpy((char *)datad, (char *)datas, bytes);
297  return pixd;
298  }
299 
300  /* Programmer error! */
301  if (pixs == pixd)
302  return (PIX *)ERROR_PTR("image data copied to itself", procName, pixd);
303 
304  /* Check sizes */
305  if (!pixSizesEqual(pixs, pixd))
306  return (PIX *)ERROR_PTR("pix sizes not equal", procName, pixd);
307  pixCopyColormap(pixd, pixs);
308  pixCopyResolution(pixd, pixs);
309  pixCopyInputFormat(pixd, pixs);
310  pixCopyText(pixd, pixs);
311 
312  /* Copy the data */
313  datas = pixGetData(pixs);
314  datad = pixGetData(pixd);
315  memcpy((char*)datad, (char*)datas, bytes);
316 
317  return pixd;
318 }
319 
320 
321 /*!
322  * pixCopyColormap()
323  *
324  * Input: src and dest Pix
325  * Return: 0 if OK, 1 on error
326  */
327 l_int32
329  PIX *pixs)
330 {
331 PIXCMAP *cmaps, *cmapd;
332 
333  PROCNAME("pixCopyColormap");
334 
335  if (!pixs)
336  return ERROR_INT("pixs not defined", procName, 1);
337  if (!pixd)
338  return ERROR_INT("pixd not defined", procName, 1);
339 
340  if ((cmaps = pixGetColormap(pixs)) == NULL) /* not an error */
341  return 0;
342 
343  if ((cmapd = pixcmapCopy(cmaps)) == NULL)
344  return ERROR_INT("cmapd not made", procName, 1);
345  pixSetColormap(pixd, cmapd);
346 
347  return 0;
348 }
349 
350 
351 /*!
352  * pixSizesEqual()
353  *
354  * Input: two Pix
355  * Return: 1 if the two Pix have same {h, w, d}; 0 otherwise.
356  */
357 l_int32
359  PIX *pix2)
360 {
361  PROCNAME("pixSizesEqual");
362 
363  if (!pix1)
364  return ERROR_INT("pix1 not defined", procName, 0);
365  if (!pix2)
366  return ERROR_INT("pix2 not defined", procName, 0);
367 
368  if ((pixGetWidth(pix1) != pixGetWidth(pix2)) ||
369  (pixGetHeight(pix1) != pixGetHeight(pix2)) ||
370  (pixGetDepth(pix1) != pixGetDepth(pix2))) {
371 #if DEBUG
372  fprintf(stderr, "w1 = %d, w2 = %d, h1 = %d, h2 = %d, d1 = %d, d2 = %d\n",
373  pixGetWidth(pix1), pixGetWidth(pix2),
374  pixGetHeight(pix1), pixGetHeight(pix2),
375  pixGetDepth(pix1), pixGetDepth(pix2));
376 #endif /* DEBUG */
377  return 0;
378  }
379  else
380  return 1;
381 }
382 
383 
384 
385 /*--------------------------------------------------------------------*
386  * Accessors *
387  *--------------------------------------------------------------------*/
388 l_int32
390 {
391  PROCNAME("pixGetWidth");
392 
393  if (!pix)
394  return ERROR_INT("pix not defined", procName, UNDEF);
395 
396  return pix->w;
397 }
398 
399 
400 l_int32
402  l_int32 width)
403 {
404  PROCNAME("pixSetWidth");
405 
406  if (!pix)
407  return ERROR_INT("pix not defined", procName, 1);
408  if (width < 0) {
409  pix->w = 0;
410  return ERROR_INT("width must be >= 0", procName, 1);
411  }
412 
413  pix->w = width;
414  return 0;
415 }
416 
417 
418 l_int32
420 {
421  PROCNAME("pixGetHeight");
422 
423  if (!pix)
424  return ERROR_INT("pix not defined", procName, UNDEF);
425 
426  return pix->h;
427 }
428 
429 
430 l_int32
432  l_int32 height)
433 {
434  PROCNAME("pixSetHeight");
435 
436  if (!pix)
437  return ERROR_INT("pix not defined", procName, 1);
438  if (height < 0) {
439  pix->h = 0;
440  return ERROR_INT("h must be >= 0", procName, 1);
441  }
442 
443  pix->h = height;
444  return 0;
445 }
446 
447 
448 l_int32
450 {
451  PROCNAME("pixGetDepth");
452 
453  if (!pix)
454  return ERROR_INT("pix not defined", procName, UNDEF);
455 
456  return pix->d;
457 }
458 
459 
460 l_int32
462  l_int32 depth)
463 {
464  PROCNAME("pixSetDepth");
465 
466  if (!pix)
467  return ERROR_INT("pix not defined", procName, 1);
468  if (depth < 1)
469  return ERROR_INT("d must be >= 1", procName, 1);
470 
471  pix->d = depth;
472  return 0;
473 }
474 
475 
476 l_int32
478 {
479  PROCNAME("pixGetWpl");
480 
481  if (!pix)
482  return ERROR_INT("pix not defined", procName, UNDEF);
483 
484  return pix->wpl;
485 }
486 
487 
488 l_int32
490  l_int32 wpl)
491 {
492  PROCNAME("pixSetWpl");
493 
494  if (!pix)
495  return ERROR_INT("pix not defined", procName, 1);
496 
497  pix->wpl = wpl;
498  return 0;
499 }
500 
501 
502 l_int32
504 {
505  PROCNAME("pixGetRefcount");
506 
507  if (!pix)
508  return ERROR_INT("pix not defined", procName, UNDEF);
509 
510  return pix->refcount;
511 }
512 
513 
514 l_int32
516  l_int32 delta)
517 {
518  PROCNAME("pixChangeRefcount");
519 
520  if (!pix)
521  return ERROR_INT("pix not defined", procName, 1);
522 
523  pix->refcount += delta;
524  return 0;
525 }
526 
527 
528 l_uint32
530 {
531  PROCNAME("pixGetXRes");
532 
533  if (!pix)
534  return ERROR_INT("pix not defined", procName, 0);
535 
536  return pix->xres;
537 }
538 
539 
540 l_uint32
542 {
543  PROCNAME("pixGetYRes");
544 
545  if (!pix)
546  return ERROR_INT("pix not defined", procName, 0);
547 
548  return pix->yres;
549 }
550 
551 
552 l_int32
554  l_uint32 res)
555 {
556  PROCNAME("pixSetXRes");
557 
558  if (!pix)
559  return ERROR_INT("pix not defined", procName, 1);
560 
561  pix->xres = res;
562  return 0;
563 }
564 
565 
566 l_int32
568  PIX *pixs)
569 {
570  PROCNAME("pixCopyResolution");
571 
572  if (!pixs)
573  return ERROR_INT("pixs not defined", procName, 1);
574  if (!pixd)
575  return ERROR_INT("pixd not defined", procName, 1);
576 
577  pixSetXRes(pixd, pixGetXRes(pixs));
578  pixSetYRes(pixd, pixGetYRes(pixs));
579  return 0;
580 }
581 
582 
583 l_int32
587 {
588  PROCNAME("pixScaleResolution");
589 
590  if (!pix)
591  return ERROR_INT("pix not defined", procName, 1);
592 
593  if (pix->xres != 0 && pix->yres != 0) {
594  pix->xres = (l_uint32)(xscale * (l_float32)(pix->xres) + 0.5);
595  pix->yres = (l_uint32)(yscale * (l_float32)(pix->yres) + 0.5);
596  }
597  return 0;
598 }
599 
600 
601 l_int32
603  l_uint32 res)
604 {
605  PROCNAME("pixSetYRes");
606 
607  if (!pix)
608  return ERROR_INT("pix not defined", procName, 1);
609 
610  pix->yres = res;
611  return 0;
612 }
613 
614 
615 l_int32
617 {
618  PROCNAME("pixGetInputFormat");
619 
620  if (!pix)
621  return ERROR_INT("pix not defined", procName, UNDEF);
622 
623  return pix->informat;
624 }
625 
626 
627 l_int32
629  l_int32 informat)
630 {
631  PROCNAME("pixSetInputFormat");
632 
633  if (!pix)
634  return ERROR_INT("pix not defined", procName, 1);
635 
636  pix->informat = informat;
637  return 0;
638 }
639 
640 
641 l_int32
643  PIX *pixs)
644 {
645  PROCNAME("pixCopyInputFormat");
646 
647  if (!pixs)
648  return ERROR_INT("pixs not defined", procName, 1);
649  if (!pixd)
650  return ERROR_INT("pixd not defined", procName, 1);
651 
653  return 0;
654 }
655 
656 
657 char *
659 {
660  PROCNAME("pixGetText");
661 
662  if (!pix)
663  return (char *)ERROR_PTR("pix not defined", procName, NULL);
664 
665  return pix->text;
666 }
667 
668 
669 /*!
670  * pixSetText()
671  *
672  * Input: pix
673  * textstring
674  * Return: 0 if OK, 1 on error
675  *
676  * Notes:
677  * (1) This removes any existing textstring and puts a copy of
678  * the input textstring there.
679  */
680 l_int32
682  const char *textstring)
683 {
684  PROCNAME("pixSetText");
685 
686  if (!pix)
687  return ERROR_INT("pix not defined", procName, 1);
688 
689  stringReplace(&pix->text, textstring);
690  return 0;
691 }
692 
693 
694 /*!
695  * pixAddText()
696  *
697  * Input: pix
698  * textstring
699  * Return: 0 if OK, 1 on error
700  *
701  * Notes:
702  * (1) This adds the new textstring to any existing text.
703  * (2) Either or both the existing text and the new text
704  * string can be null.
705  */
706 l_int32
708  const char *textstring)
709 {
710 char *newstring;
711 
712  PROCNAME("pixAddText");
713 
714  if (!pix)
715  return ERROR_INT("pix not defined", procName, 1);
716 
717  newstring = stringJoin(pixGetText(pix), textstring);
718  stringReplace(&pix->text, newstring);
719  FREE((void *)newstring);
720  return 0;
721 }
722 
723 
724 l_int32
726  PIX *pixs)
727 {
728  PROCNAME("pixCopyText");
729 
730  if (!pixs)
731  return ERROR_INT("pixs not defined", procName, 1);
732  if (!pixd)
733  return ERROR_INT("pixd not defined", procName, 1);
734 
735  pixSetText(pixd, pixGetText(pixs));
736  return 0;
737 }
738 
739 
740 /*!
741  * pixDestroyColormap()
742  *
743  * Input: pix
744  * Return: 0 if OK, 1 on error
745  */
746 l_int32
748 {
749 PIXCMAP *cmap;
750 
751  PROCNAME("pixDestroyColormap");
752 
753  if (!pix)
754  return ERROR_INT("pix not defined", procName, 1);
755 
756  if ((cmap = pix->colormap) == NULL)
757  return 0;
758 
760  pix->colormap = NULL;
761  return 0;
762 }
763 
764 
765 PIXCMAP *
767 {
768  PROCNAME("pixGetColormap");
769 
770  if (!pix)
771  return (PIXCMAP *)ERROR_PTR("pix not defined", procName, NULL);
772 
773  return pix->colormap;
774 }
775 
776 
777 l_int32
779  PIXCMAP *colormap)
780 {
781  PROCNAME("pixSetColormap");
782 
783  if (!pix)
784  return ERROR_INT("pix not defined", procName, 1);
785 
787  pix->colormap = colormap;
788  return 0;
789 }
790 
791 
792 l_uint32 *
794 {
795  PROCNAME("pixGetData");
796 
797  if (!pix)
798  return (l_uint32 *)ERROR_PTR("pix not defined", procName, NULL);
799 
800  return pix->data;
801 }
802 
803 
804 l_int32
806  l_uint32 *data)
807 {
808  PROCNAME("pixSetData");
809 
810  if (!pix)
811  return ERROR_INT("pix not defined", procName, 1);
812 
813  pix->data = data;
814  return 0;
815 }
816 
817 
818 /*--------------------------------------------------------------------*
819  * Print output for debugging *
820  *--------------------------------------------------------------------*/
821 /*!
822  * pixPrintStreamInfo()
823  *
824  * Input: stream
825  * pix
826  * text (an identifying string that is printed)
827  * Return: 0 if OK, 1 on error
828  */
829 l_int32
831  PIX *pix,
832  const char *text)
833 {
834 PIXCMAP *cmap;
835 
836  PROCNAME("pixPrintStreamInfo");
837 
838  if (!fp)
839  return ERROR_INT("fp not defined", procName, 1);
840  if (!pix)
841  return ERROR_INT("pix not defined", procName, 1);
842  if (!text)
843  return ERROR_INT("text not defined", procName, 1);
844 
845  fprintf(fp, " Pix Info for %s:\n", text);
846  fprintf(fp, " width = %d, height = %d, depth = %d\n",
848  fprintf(fp, " wpl = %d, data = %p, refcount = %d\n",
850  if ((cmap = pixGetColormap(pix)) != NULL)
852  else
853  fprintf(fp, " no colormap\n");
854 
855  return 0;
856 }
857 
static char * newstring(const char *s)
Definition: afm2pl.c:282
#define width(a)
Definition: aptex-macros.h:198
#define depth(a)
Definition: aptex-macros.h:199
#define height(a)
Definition: aptex-macros.h:200
#define text(a)
Definition: aptex-macros.h:925
void pixcmapDestroy(PIXCMAP **pcmap)
Definition: colormap.c:129
l_int32 pixcmapWriteStream(FILE *fp, PIXCMAP *cmap)
Definition: colormap.c:574
PIXCMAP * pixcmapCopy(PIXCMAP *cmaps)
Definition: colormap.c:98
int w
Definition: dviconv.c:26
int h
Definition: dviconv.c:9
struct rect data
Definition: dvipdfm.c:64
#define PROCNAME(name)
Definition: environ.h:131
#define ERROR_PTR(a, b, c)
Definition: environ.h:132
unsigned int l_uint32
Definition: environ.h:33
#define L_WARNING(a, b)
Definition: environ.h:136
#define ERROR_INT(a, b, c)
Definition: environ.h:133
int l_int32
Definition: environ.h:32
#define UNDEF
Definition: environ.h:58
float l_float32
Definition: environ.h:34
#define d(n)
Definition: gpos-common.c:151
#define memcpy(d, s, n)
Definition: gsftopk.c:64
const unsigned char FREE
Definition: image.cpp:34
@ IFF_UNKNOWN
Definition: imageio.h:28
pix
Definition: in_pcx.cpp:383
#define NULL
Definition: ftobjs.h:61
#define fprintf
Definition: mendex.h:64
#define CALLOC(t, n)
Definition: hash.c:21
char * stringJoin(const char *src1, const char *src2)
Definition: utils.c:445
l_int32 stringReplace(char **pdest, const char *src)
Definition: utils.c:405
static int delta
Definition: pbmtolj.c:36
#define res(length)
Definition: picttoppm.c:287
l_int32 pixSetInputFormat(PIX *pix, l_int32 informat)
Definition: pix1.c:628
l_uint32 * pixGetData(PIX *pix)
Definition: pix1.c:793
l_int32 pixCopyText(PIX *pixd, PIX *pixs)
Definition: pix1.c:725
void pixDestroy(PIX **ppix)
Definition: pix1.c:225
l_int32 pixSetYRes(PIX *pix, l_uint32 res)
Definition: pix1.c:602
l_int32 pixSetXRes(PIX *pix, l_uint32 res)
Definition: pix1.c:553
static const l_int32 EXTRA_WORDS_ON_RIGHT
Definition: pix1.c:73
l_int32 pixCopyInputFormat(PIX *pixd, PIX *pixs)
Definition: pix1.c:642
l_int32 pixGetWpl(PIX *pix)
Definition: pix1.c:477
l_int32 pixAddText(PIX *pix, const char *textstring)
Definition: pix1.c:707
l_int32 pixCopyResolution(PIX *pixd, PIX *pixs)
Definition: pix1.c:567
l_int32 pixSetDepth(PIX *pix, l_int32 depth)
Definition: pix1.c:461
l_int32 pixGetDepth(PIX *pix)
Definition: pix1.c:449
PIX * pixCopy(PIX *pixd, PIX *pixs)
Definition: pix1.c:276
PIX * pixCreateTemplate(PIX *pixs)
Definition: pix1.c:148
char * pixGetText(PIX *pix)
Definition: pix1.c:658
l_int32 pixCopyColormap(PIX *pixd, PIX *pixs)
Definition: pix1.c:328
l_uint32 pixGetXRes(PIX *pix)
Definition: pix1.c:529
l_int32 pixSetColormap(PIX *pix, PIXCMAP *colormap)
Definition: pix1.c:778
PIXCMAP * pixGetColormap(PIX *pix)
Definition: pix1.c:766
l_int32 pixGetInputFormat(PIX *pix)
Definition: pix1.c:616
l_int32 pixSetWpl(PIX *pix, l_int32 wpl)
Definition: pix1.c:489
l_int32 pixSetData(PIX *pix, l_uint32 *data)
Definition: pix1.c:805
l_int32 pixSetHeight(PIX *pix, l_int32 height)
Definition: pix1.c:431
l_int32 pixSetWidth(PIX *pix, l_int32 width)
Definition: pix1.c:401
l_int32 pixSetText(PIX *pix, const char *textstring)
Definition: pix1.c:681
l_uint32 pixGetYRes(PIX *pix)
Definition: pix1.c:541
l_int32 pixChangeRefcount(PIX *pix, l_int32 delta)
Definition: pix1.c:515
l_int32 pixSizesEqual(PIX *pix1, PIX *pix2)
Definition: pix1.c:358
l_int32 pixDestroyColormap(PIX *pix)
Definition: pix1.c:747
PIX * pixCreate(l_int32 width, l_int32 height, l_int32 depth)
Definition: pix1.c:90
PIX * pixClone(PIX *pixs)
Definition: pix1.c:197
l_int32 pixGetRefcount(PIX *pix)
Definition: pix1.c:503
l_int32 pixGetHeight(PIX *pix)
Definition: pix1.c:419
l_int32 pixScaleResolution(PIX *pix, l_float32 xscale, l_float32 yscale)
Definition: pix1.c:584
l_int32 pixPrintStreamInfo(FILE *fp, PIX *pix, const char *text)
Definition: pix1.c:830
l_int32 pixGetWidth(PIX *pix)
Definition: pix1.c:389
#define fp
static double yscale
Definition: ppmtopjxl.c:47
static double xscale
Definition: ppmtopjxl.c:46
static long bytes
Definition: psutil.c:35
rle_map * colormap
Definition: rletopnm.c:57
Definition: pix.h:51
l_uint32 refcount
Definition: pix.h:56
l_int32 informat
Definition: pix.h:61
Definition: sh2.c:920
#define FILE
Definition: t1stdio.h:34
TT_CharMap cmap
Definition: ttf2pfb.c:163