Leptonica 1.68
C Image Processing Library

pix1.c File Reference

Implements Pix (image) class - the fundamental one for this library. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "allheaders.h"

Go to the source code of this file.

Data Structures

struct  PixMemoryManager

Functions

static void pixFree (PIX *pix)
static void * pix_malloc (size_t size)
static void pix_free (void *ptr)
void setPixMemoryManager (void *(allocator(size_t)), void(deallocator(void *)))
PIXpixCreate (l_int32 width, l_int32 height, l_int32 depth)
PIXpixCreateNoInit (l_int32 width, l_int32 height, l_int32 depth)
PIXpixCreateTemplate (PIX *pixs)
PIXpixCreateTemplateNoInit (PIX *pixs)
PIXpixCreateHeader (l_int32 width, l_int32 height, l_int32 depth)
PIXpixClone (PIX *pixs)
void pixDestroy (PIX **ppix)
PIXpixCopy (PIX *pixd, PIX *pixs)
l_int32 pixResizeImageData (PIX *pixd, PIX *pixs)
l_int32 pixCopyColormap (PIX *pixd, PIX *pixs)
l_int32 pixSizesEqual (PIX *pix1, PIX *pix2)
l_int32 pixTransferAllData (PIX *pixd, PIX **ppixs, l_int32 copytext, l_int32 copyformat)
l_int32 pixGetWidth (PIX *pix)
l_int32 pixSetWidth (PIX *pix, l_int32 width)
l_int32 pixGetHeight (PIX *pix)
l_int32 pixSetHeight (PIX *pix, l_int32 height)
l_int32 pixGetDepth (PIX *pix)
l_int32 pixSetDepth (PIX *pix, l_int32 depth)
l_int32 pixGetDimensions (PIX *pix, l_int32 *pw, l_int32 *ph, l_int32 *pd)
l_int32 pixSetDimensions (PIX *pix, l_int32 w, l_int32 h, l_int32 d)
l_int32 pixCopyDimensions (PIX *pixd, PIX *pixs)
l_int32 pixGetWpl (PIX *pix)
l_int32 pixSetWpl (PIX *pix, l_int32 wpl)
l_int32 pixGetRefcount (PIX *pix)
l_int32 pixChangeRefcount (PIX *pix, l_int32 delta)
l_int32 pixGetXRes (PIX *pix)
l_int32 pixSetXRes (PIX *pix, l_int32 res)
l_int32 pixGetYRes (PIX *pix)
l_int32 pixSetYRes (PIX *pix, l_int32 res)
l_int32 pixGetResolution (PIX *pix, l_int32 *pxres, l_int32 *pyres)
l_int32 pixSetResolution (PIX *pix, l_int32 xres, l_int32 yres)
l_int32 pixCopyResolution (PIX *pixd, PIX *pixs)
l_int32 pixScaleResolution (PIX *pix, l_float32 xscale, l_float32 yscale)
l_int32 pixGetInputFormat (PIX *pix)
l_int32 pixSetInputFormat (PIX *pix, l_int32 informat)
l_int32 pixCopyInputFormat (PIX *pixd, PIX *pixs)
char * pixGetText (PIX *pix)
l_int32 pixSetText (PIX *pix, const char *textstring)
l_int32 pixAddText (PIX *pix, const char *textstring)
l_int32 pixCopyText (PIX *pixd, PIX *pixs)
PIXCMAPpixGetColormap (PIX *pix)
l_int32 pixSetColormap (PIX *pix, PIXCMAP *colormap)
l_int32 pixDestroyColormap (PIX *pix)
l_uint32pixGetData (PIX *pix)
l_int32 pixSetData (PIX *pix, l_uint32 *data)
l_uint32pixExtractData (PIX *pixs)
l_int32 pixFreeData (PIX *pix)
void ** pixGetLinePtrs (PIX *pix, l_int32 *psize)
l_int32 pixPrintStreamInfo (FILE *fp, PIX *pix, const char *text)

Variables

static struct PixMemoryManager pix_mem_manager
const char * ImageFileFormatExtensions []

Detailed Description

Implements Pix (image) class - the fundamental one for this library.

  The pixN.c {N = 1,2,3,4,5} files are sorted by the type of operation.
  The primary functions in these files are:

      pix1.c: constructors, destructors and field accessors
      pix2.c: pixel poking of image, pad and border pixels
      pix3.c: masking and logical ops, counting, mirrored tiling
      pix4.c: histograms, statistics, fg/bg estimation
      pix5.c: property measurements, rectangle extraction


  This file has the basic constructors, destructors and field accessors

  Pix memory management (allows custom allocator and deallocator)
        static void  *pix_malloc()
        static void   pix_free()
        void          setPixMemoryManager()

  Pix creation
        PIX          *pixCreate()
        PIX          *pixCreateNoInit()
        PIX          *pixCreateTemplate()
        PIX          *pixCreateTemplateNoInit()
        PIX          *pixCreateHeader()
        PIX          *pixClone()

  Pix destruction
        void          pixDestroy()
        static void   pixFree()

  Pix copy
        PIX          *pixCopy()
        l_int32       pixResizeImageData()
        l_int32       pixCopyColormap()
        l_int32       pixSizesEqual()
        l_int32       pixTransferAllData()

  Pix accessors
        l_int32       pixGetWidth()
        l_int32       pixSetWidth()
        l_int32       pixGetHeight()
        l_int32       pixSetHeight()
        l_int32       pixGetDepth()
        l_int32       pixSetDepth()
        l_int32       pixGetDimensions()
        l_int32       pixSetDimensions()
        l_int32       pixCopyDimensions()
        l_int32       pixGetWpl()
        l_int32       pixSetWpl()
        l_int32       pixGetRefcount()
        l_int32       pixChangeRefcount()
        l_uint32      pixGetXRes()
        l_int32       pixSetXRes()
        l_uint32      pixGetYRes()
        l_int32       pixSetYRes()
        l_int32       pixGetResolution()
        l_int32       pixSetResolution()
        l_int32       pixCopyResolution()
        l_int32       pixScaleResolution()
        l_int32       pixGetInputFormat()
        l_int32       pixSetInputFormat()
        l_int32       pixCopyInputFormat()
        char         *pixGetText()
        l_int32       pixSetText()
        l_int32       pixAddText()
        l_int32       pixCopyText()
        PIXCMAP      *pixGetColormap()
        l_int32       pixSetColormap()
        l_int32       pixDestroyColormap()
        l_uint32     *pixGetData()
        l_int32       pixSetData()
        l_uint32     *pixExtractData()
        l_int32       pixFreeData()

  Pix line ptrs
        void        **pixGetLinePtrs()

  Pix debug
        l_int32       pixPrintStreamInfo()


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Important notes on direct management of pix image data 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Custom allocator and deallocator
--------------------------------

At the lowest level, you can specify the function that does the
allocation and deallocation of the data field in the pix.
By default, this is malloc and free.  However, by calling
setPixMemoryManager(), custom functions can be substituted.
When using this, keep two things in mind:

 (1) Call setPixMemoryManager() before any pix have been allocated
 (2) Destroy all pix as usual, in order to prevent leaks.

In pixalloc.c, we provide an example custom allocator and deallocator.
To use it, you must call pmsCreate() before any pix have been allocated
and pmsDestroy() at the end after all pix have been destroyed.


Direct manipulation of the pix data field
-----------------------------------------

Memory management of the (image) data field in the pix is
handled differently from that in the colormap or text fields.
For colormap and text, the functions pixSetColormap() and
pixSetText() remove the existing heap data and insert the
new data.  For the image data, pixSetData() just reassigns the
data field; any existing data will be lost if there isn't
another handle for it.

Why is pixSetData() limited in this way?  Because the image
data can be very large, we need flexible ways to handle it,
particularly when you want to re-use the data in a different
context without making a copy.  Here are some different
things you might want to do:

(1) Use pixCopy(pixd, pixs) where pixd is not the same size
    as pixs.  This will remove the data in pixd, allocate a
    new data field in pixd, and copy the data from pixs, leaving
    pixs unchanged.

(2) Use pixTransferAllData(pixd, &pixs, ...) to transfer the
    data from pixs to pixd without making a copy of it.  If
    pixs is not cloned, this will do the transfer and destroy pixs.
    But if the refcount of pixs is greater than 1, it just copies
    the data and decrements the ref count.

(3) Use pixExtractData() to extract the image data from the pix
    without copying if possible.  This could be used, for example,
    to convert from a pix to some other data structure with minimal
    heap allocation.  After the data is extracated, the pixels can
    be munged and used in another context.  However, the danger
    here is that the pix might have a refcount > 1, in which case
    a copy of the data must be made and the input pix left unchanged.
    If there are no clones, the image data can be extracted without
    a copy, and the data ptr in the pix must be nulled before
    destroying it because the pix will no longer 'own' the data.

We have provided accessors and functions here that should be
sufficient so that you can do anything you want without
explicitly referencing any of the pix member fields.

However, to avoid memory smashes and leaks when doing special operations
on the pix data field, look carefully at the behavior of the image
data accessors and keep in mind that when you invoke pixDestroy(),
the pix considers itself the owner of all its heap data.

Definition in file pix1.c.


Function Documentation

static void pixFree ( PIX pix) [static]

pixFree()

Input: pix Return: void

Notes: (1) Decrements the ref count and, if 0, destroys the pix.

Definition at line 496 of file pix1.c.

References FREE, NULL, pix_free(), pixChangeRefcount(), pixDestroyColormap(), pixGetData(), pixGetRefcount(), and pixGetText().

Referenced by pixDestroy().

static void* pix_malloc ( size_t  size) [static]

Definition at line 200 of file pix1.c.

References PixMemoryManager::allocator, and size.

Referenced by pixCreateNoInit(), pixExtractData(), and pixResizeImageData().

static void pix_free ( void *  ptr) [static]

Definition at line 212 of file pix1.c.

References PixMemoryManager::deallocator.

Referenced by pixFree(), and pixFreeData().

void setPixMemoryManager ( void *  allocator(size_t),
void(deallocator(void *))   
)

setPixMemoryManager()

Input: allocator (<optional>; use null to skip) deallocator (<optional>; use null to skip) Return: void

Notes: (1) Use this to change the alloc and/or dealloc functions; e.g., setPixMemoryManager(my_malloc, my_free).

Definition at line 238 of file pix1.c.

References PixMemoryManager::allocator, and PixMemoryManager::deallocator.

Referenced by main().

PIX* pixCreate ( l_int32  width,
l_int32  height,
l_int32  depth 
)

pixCreate()

Input: width, height, depth Return: pixd (with data allocated and initialized to 0), or null on error

Definition at line 269 of file pix1.c.

References Pix::data, ERROR_PTR, Pix::h, NULL, pixCreateNoInit(), PROCNAME, and Pix::wpl.

Referenced by AddTransformsRGB(), AddTransformsYUV(), boxaaDisplay(), boxaGetCoverage(), ccbaDisplayBorder(), ccbaDisplayImage1(), ccbaDisplayImage2(), ccbaDisplaySPBorder(), displayHSVColorRange(), finalPositioningForAlignment(), fpixConvertToPix(), fpixDisplayMaxDynamicRange(), fpixRenderContours(), freadHeaderPnm(), generateBinaryMaze(), jbAccumulateComposites(), jbDataRender(), kernelDisplayInPix(), main(), make_24_bpp_pix(), MakeColorWash(), MakeGrayWash(), pixaaDisplay(), pixaaDisplayByPixa(), pixAbsDifference(), pixaccCreate(), pixacompDisplayTiledAndScaled(), pixaCreateFromPix(), pixAddSingleTextblock(), pixaDisplay(), pixaDisplayOnColor(), pixaDisplayOnLattice(), pixaDisplayRandomCmap(), pixaDisplayTiled(), pixaDisplayTiledAndScaled(), pixaDisplayTiledInRows(), pixaDisplayUnsplit(), pixAffinePtaWithAlpha(), pixaGenerateFont(), pixaGetAlignedStats(), pixApplyHorizontalDisparity(), pixApplyLocalThreshold(), pixaSplitPix(), pixBilinearPtaWithAlpha(), pixBlockconvAccum(), pixBlockconvGrayUnnormalized(), pixBlocksum(), pixCensusTransform(), pixClipRectangle(), pixColorContent(), pixColorizeGray(), pixColorMagnitude(), pixColorSegmentCluster(), pixConvert16To8(), pixConvert1To16(), pixConvert1To2(), pixConvert1To32(), pixConvert1To4(), pixConvert1To8(), pixConvert2To8(), pixConvert4To8(), pixConvert8To16(), pixConvert8To32(), pixConvertColorToSubpixelRGB(), pixConvertGrayToColormap8(), pixConvertGrayToSubpixelRGB(), pixConvertLossless(), pixConvertRGBToGray(), pixConvertRGBToGrayFast(), pixConvertRGBToGrayMinMax(), pixConvertRGBToHue(), pixConvertRGBToSaturation(), pixConvertRGBToValue(), pixConvolve(), pixCreateRGBImage(), pixDeserializeFromMemory(), pixDisplayColorArray(), pixDisplayDiffBinary(), pixDistanceFunction(), pixDitherTo2bppSpec(), pixDitherToBinaryLUT(), pixDitherToBinarySpec(), pixEmbedForRotation(), pixExpandBinaryPower2(), pixExpandBinaryReplicate(), pixExpandReplicate(), pixExtendByReplication(), pixFewColorsOctcubeQuant1(), pixFewColorsOctcubeQuant2(), pixFewColorsOctcubeQuantMixed(), pixFinalAccumulate(), pixFinalAccumulateThreshold(), pixFindEqualValues(), pixFindLargestRectangle(), pixFixedOctcubeQuant256(), pixFixedOctcubeQuantGenRGB(), pixGenerateFromPta(), pixGenerateMaskByBand(), pixGenerateMaskByBand32(), pixGenerateMaskByDiscr32(), pixGenerateMaskByValue(), pixGenerateSelBoundary(), pixGenerateSelRandom(), pixGenerateSelWithRuns(), pixGetAverageTiled(), pixGetBackgroundGrayMap(), pixGetBackgroundRGBMap(), pixGetInvBackgroundMap(), pixGetRGBComponent(), pixGrayQuantFromCmap(), pixInitAccumulate(), pixMakeHistoHS(), pixMakeHistoHV(), pixMakeHistoSV(), pixMakeMaskFromLUT(), pixMaskOverColorPixels(), pixMaxDynamicRange(), pixMedianCutQuantMixed(), pixMirroredTiling(), pixOctcubeQuantFromCmapLUT(), pixOctcubeQuantMixedWithGray(), pixOctreeQuantByPopulation(), pixOctreeQuantizePixels(), pixOctreeQuantNumColors(), pixOtsuAdaptiveThreshold(), pixPaintSelfThroughMask(), pixProjectivePtaWithAlpha(), pixQuantizeWithColormap(), pixRasteropHip(), pixRasteropVip(), pixReadFromTiffStream(), pixReadStreamBmp(), pixReadStreamGif(), pixReadStreamJpeg(), pixReadStreamPng(), pixReadStreamWebP(), pixReduceBinary2(), pixReduceRankBinary2(), pixRemoveColormap(), pixRenderContours(), pixResizeToMatch(), pixRotate90(), pixRotateWithAlpha(), pixRunlengthTransform(), pixSauvolaGetThreshold(), pixScaleAreaMap(), pixScaleAreaMap2(), pixScaleBinary(), pixScaleBySampling(), pixScaleColor2xLI(), pixScaleColorLI(), pixScaleGray2xLI(), pixScaleGray2xLIDither(), pixScaleGray2xLIThresh(), pixScaleGray4xLI(), pixScaleGray4xLIDither(), pixScaleGray4xLIThresh(), pixScaleGrayLI(), pixScaleGrayMinMax(), pixScaleGrayMinMax2(), pixScaleGrayRank2(), pixScaleGrayToBinaryFast(), pixScaleMipmap(), pixScaleRGBToBinaryFast(), pixScaleRGBToGray2(), pixScaleRGBToGrayFast(), pixScaleSmooth(), pixScaleToGray16(), pixScaleToGray2(), pixScaleToGray3(), pixScaleToGray4(), pixScaleToGray6(), pixScaleToGray8(), pixScaleWithAlpha(), pixSearchBinaryMaze(), pixSearchGrayMaze(), pixSeedspread(), pixShiftRGB258(), pixThresholdGrayArb(), pixThresholdTo2bpp(), pixThresholdTo4bpp(), pixThresholdToBinary(), pixVarThresholdToBinary(), pixWarpStereoscopic(), pixWindowedMean(), pixWindowedMeanSquare(), selaAddCrossJunctions(), selaAddTJunctions(), selDisplayInPix(), and wshedCreate().

PIX* pixCreateNoInit ( l_int32  width,
l_int32  height,
l_int32  depth 
)

pixCreateNoInit()

Input: width, height, depth Return: pixd (with data allocated but not initialized), or null on error

Notes: (1) Must set pad bits to avoid reading unitialized data, because some optimized routines (e.g., pixConnComp()) read from pad bits.

Definition at line 296 of file pix1.c.

References ERROR_PTR, NULL, pix_malloc(), pixCreateHeader(), pixGetWpl(), pixSetData(), pixSetPadBits(), and PROCNAME.

Referenced by pixAddBorderGeneral(), pixApplyVariableGrayMap(), pixConvert24To32(), pixConvert32To24(), pixCreate(), pixCreateTemplateNoInit(), pixGetRGBComponentCmap(), pixGrayQuantFromHisto(), pixMakeRangeMaskHS(), pixMakeRangeMaskHV(), pixMakeRangeMaskSV(), pixRemoveBorderGeneral(), and pixSauvolaBinarizeTiled().

PIX* pixCreateTemplate ( PIX pixs)

pixCreateTemplate()

Input: pixs Return: pixd, or null on error

Notes: (1) Makes a Pix of the same size as the input Pix, with the data array allocated and initialized to 0. (2) Copies the other fields, including colormap if it exists.

Definition at line 328 of file pix1.c.

References Pix::data, ERROR_PTR, Pix::h, NULL, pixCreateTemplateNoInit(), PROCNAME, and Pix::wpl.

Referenced by ccbaDisplayImage1(), ccbaDisplayImage2(), main(), pixAddMinimalGrayColormap8(), pixAffineColor(), pixAffineGray(), pixAffineSampled(), pixApplyInvBackgroundGrayMap(), pixApplyInvBackgroundRGBMap(), pixApplyVerticalDisparity(), pixBilinearColor(), pixBilinearGray(), pixBilinearSampled(), pixBlockconvGray(), pixBlockconvGrayTile(), pixBlockrank(), pixCloseGray(), pixConvertToPdfDataSegmented(), pixCopy(), pixCorrelationScoreSimple(), pixDilateGray(), pixEndianByteSwapNew(), pixEndianTwoByteSwapNew(), pixErodeGray(), pixExtractBorderConnComps(), pixFastTophat(), pixFHMTGen_1(), pixFillClosedBorders(), pixFindSkewSweep(), pixFindSkewSweepAndSearchScorePivot(), pixFlipFHMTGen(), pixFMorphopGen_1(), pixFMorphopGen_2(), pixFMorphopGen_3(), pixGetTextlineCenters(), pixGrayQuantFromHisto(), pixHaustest(), pixHDome(), pixHolesByFilling(), pixHShear(), pixHShearLI(), pixInterlaceGIF(), pixIntersectionOfMorphOps(), pixItalicWords(), pixMaskConnComp(), pixMorphSequenceByComponent(), pixMorphSequenceByRegion(), pixOpenGray(), pixProjectiveColor(), pixProjectiveGray(), pixProjectiveSampled(), pixQuadraticVShearLI(), pixQuadraticVShearSampled(), pixRandomHarmonicWarp(), pixRankFilterGray(), pixRankHaustest(), pixRotateAMColor(), pixRotateAMColorCorner(), pixRotateAMColorFast(), pixRotateAMColorFast2(), pixRotateAMGray(), pixRotateAMGrayCorner(), pixRunHistogramMorph(), pixSeedfillBinary(), pixSeedfillGrayInvSimple(), pixSeedfillGraySimple(), pixSeedfillMorph(), pixSelectByAreaFraction(), pixSelectByAreaPerimRatio(), pixSelectBySize(), pixSelectByWidthHeightRatio(), pixSetMaskedGeneral(), pixSobelEdgeFilter(), pixStereoFromPair(), pixStretchHorizontalLI(), pixStretchHorizontalSampled(), pixThinGeneral(), pixThresholdSpreadNorm(), pixTophat(), pixTwoSidedEdgeFilter(), pixUnionOfMorphOps(), pixUpDownDetectGeneral(), pixUpDownDetectGeneralDwa(), pixVShear(), pixVShearLI(), processMorphArgs1(), processMorphArgs2(), and TestDistance().

PIX* pixCreateTemplateNoInit ( PIX pixs)

pixCreateTemplateNoInit()

Input: pixs Return: pixd, or null on error

Notes: (1) Makes a Pix of the same size as the input Pix, with the data array allocated but not initialized to 0. (2) Copies the other fields, including colormap if it exists.

Definition at line 356 of file pix1.c.

References ERROR_PTR, NULL, pixCopyColormap(), pixCopyInputFormat(), pixCopyResolution(), pixCopyText(), pixCreateNoInit(), pixGetDimensions(), and PROCNAME.

Referenced by main(), pixBlockconvTiled(), pixCopyBorder(), pixCreateTemplate(), pixDilateCompBrickExtendDwa(), pixDilateGray3h(), pixDilateGray3v(), pixErodeCompBrickExtendDwa(), pixErodeGray3h(), pixErodeGray3v(), pixMultConstantColor(), pixMultMatrixColor(), pixRankColumnTransform(), pixRankRowTransform(), and pixRotateBySampling().

PIX* pixCreateHeader ( l_int32  width,
l_int32  height,
l_int32  depth 
)

pixCreateHeader()

Input: width, height, depth Return: pixd (with no data allocated), or null on error

Definition at line 385 of file pix1.c.

References CALLOC, ERROR_PTR, IFF_UNKNOWN, Pix::informat, NULL, pixSetDepth(), pixSetHeight(), pixSetWidth(), pixSetWpl(), PROCNAME, and Pix::refcount.

Referenced by pixCreateNoInit().

PIX* pixClone ( PIX pixs)

pixClone()

Input: pix Return: same pix (ptr), or null on error

Notes: (1) A "clone" is simply a handle (ptr) to an existing pix. It is implemented because (a) images can be large and hence expensive to copy, and (b) extra handles to a data structure need to be made with a simple policy to avoid both double frees and memory leaks. Pix are reference counted. The side effect of pixClone() is an increase by 1 in the ref count. (2) The protocol to be used is: (a) Whenever you want a new handle to an existing image, call pixClone(), which just bumps a ref count. (b) Always call pixDestroy() on all handles. This decrements the ref count, nulls the handle, and only destroys the pix when pixDestroy() has been called on all handles.

Definition at line 440 of file pix1.c.

References ERROR_PTR, NULL, pixChangeRefcount(), and PROCNAME.

Referenced by ccbaCreate(), ccbCreate(), convertFilesTo1bpp(), convertTiffMultipageToPS(), dewarpCreate(), GeneratePattern(), ioFormatTest(), jbGetComponents(), main(), pixaAddPix(), pixacompDisplayTiledAndScaled(), pixAddBlackBorder(), pixAddBorder(), pixAddMinimalGrayColormap8(), pixaDisplayTiledAndScaled(), pixaDisplayTiledInRows(), pixAffine(), pixAffinePta(), pixAffineSequential(), pixaGetPix(), pixAverageIntensityProfile(), pixBackgroundNormFlex(), pixBilinear(), pixBilinearPta(), pixBlendColor(), pixBlendColorByChannel(), pixBlendGray(), pixBlendGrayAdapt(), pixBlendHardLight(), pixBlendMask(), pixBlendWithGrayMask(), pixBlockconv(), pixBlockconvGray(), pixBlockconvGrayTile(), pixBlockconvTiled(), pixBlocksum(), pixColorContent(), pixColorizeGray(), pixColorMagnitude(), pixColorMorphSequence(), pixColorsForQuantization(), pixConvert8To16(), pixConvertForPSWrap(), pixConvertTo8Or32(), pixConvertToFPix(), pixConvertToPdfDataSegmented(), pixDeskewBarcode(), pixDeskewGeneral(), pixDilateCompBrickExtendDwa(), pixDilateGray(), pixDisplayWithTitle(), pixDisplayWriteFormat(), pixEmbedForRotation(), pixEndianByteSwapNew(), pixEndianTwoByteSwapNew(), pixEqual(), pixEqualizeTRC(), pixErodeCompBrickExtendDwa(), pixErodeGray(), pixFindSkewSweep(), pixFindSkewSweepAndSearchScorePivot(), pixGenerateFlateData(), pixGenerateMaskByBand(), pixGenerateMaskByValue(), pixGenerateSelBoundary(), pixGenerateSelRandom(), pixGenerateSelWithRuns(), pixGetAverageMasked(), pixGetBackgroundGrayMapMorph(), pixGetBackgroundRGBMap(), pixGetBackgroundRGBMapMorph(), pixGetGrayHistogram(), pixGetGrayHistogramMasked(), pixGetRankColorArray(), pixGetRGBComponentCmap(), pixGetWordBoxesInTextlines(), pixGetWordsInTextlines(), pixGrayMorphSequence(), pixGrayQuantFromHisto(), pixHalfEdgeByBandpass(), pixHShearLI(), pixHtmlViewer(), pixItalicWords(), pixLocateBarcodes(), pixMakeHistoHS(), pixMakeHistoHV(), pixMakeHistoSV(), pixMaskOverColorPixels(), pixMinMaxTiles(), pixMorphCompSequence(), pixMorphCompSequenceDwa(), pixMorphSequence(), pixMorphSequenceDwa(), pixOctreeColorQuantGeneral(), pixOtsuAdaptiveThreshold(), pixProcessBarcodes(), pixProjective(), pixProjectivePta(), pixQuadraticVShearLI(), pixQuadtreeMean(), pixQuadtreeVariance(), pixQuantizeIfFewColors(), pixRemoveBorder(), pixRemoveColormap(), pixRemoveMatchedPattern(), pixReversalProfile(), pixRotate(), pixRotate2Shear(), pixRotate3Shear(), pixRotateAM(), pixRotateAMColor(), pixRotateAMColorCorner(), pixRotateAMColorFast(), pixRotateAMColorFast2(), pixRotateAMCorner(), pixRotateAMGray(), pixRotateAMGrayCorner(), pixRotateBySampling(), pixRotateShear(), pixRunHistogramMorph(), pixRunlengthTransform(), pixSauvolaBinarize(), pixSaveTiledOutline(), pixSaveTiledWithText(), pixScaleAreaMap(), pixScaleAreaMap2(), pixScaleGeneral(), pixScaleSmooth(), pixSeedfillBinaryRestricted(), pixTilingCreate(), pixTilingGetTile(), pixUnsharpMasking(), pixUnsharpMaskingFast(), pixUnsharpMaskingGray(), pixUnsharpMaskingGray1D(), pixUnsharpMaskingGray2D(), pixUnsharpMaskingGrayFast(), pixVShearLI(), pixWarpStereoscopic(), pixWindowedMean(), pixWindowedMeanSquare(), pixWindowedStats(), pixWriteSegmentedPageToPS(), pixWriteStreamAsciiPnm(), pixWriteStreamGif(), pixWriteStreamPnm(), processMorphArgs1(), ptaaGetBoundaryPixels(), RotateTest(), saConvertFilesToPdfData(), TestImage(), writeMultipageTiffSA(), and wshedCreate().

void pixDestroy ( PIX **  ppix)

pixDestroy()

Input: &pix <will be="" nulled>=""> Return: void

Notes: (1) Decrements the ref count and, if 0, destroys the pix. (2) Always nulls the input ptr.

Definition at line 466 of file pix1.c.

References L_WARNING, NULL, pixFree(), and PROCNAME.

Referenced by AddScaledImages(), AddTestSet(), AddTextAndSave(), AddTransformsRGB(), AddTransformsYUV(), bmfGetWidth(), bmfMakeAsciiTables(), boxaGetCoverage(), BoxaSortTest(), ccbaDestroy(), ccbaDisplayImage1(), ccbaDisplayImage2(), ccbDestroy(), convertFilesTo1bpp(), convertImageDataToPdf(), convertImageDataToPdfData(), convertSegmentedPagesToPS(), convertTiffMultipageToPS(), convertToPdfData(), convertToPdfDataSegmented(), convertToPdfSegmented(), convertToPSEmbed(), CopyStoreClean(), count_pieces(), dewarpApplyDisparity(), dewarpBuildModel(), dewarpDestroy(), dewarpMinimize(), DisplayCaptcha(), displayHSVColorRange(), DisplayPix(), DisplayResult(), DoPageSegmentation(), extractJpegHeaderDataFallback(), finalPositioningForAlignment(), findSimilarSizedTemplatesNext(), fpixaDisplayQuadtree(), generateBinaryMaze(), GeneratePattern(), GenerateSetOfMargePix(), GetImageMask(), ioFormatTest(), jbAccumulateComposites(), jbAddPages(), jbClassifyCorrelation(), jbClassifyRankHaus(), jbCorrelation(), jbDataDestroy(), jbDataRender(), jbGetComponents(), jbGetLLCorners(), jbGetULCorners(), jbRankHaus(), jbTemplatesFromComposites(), jbWordsInTextlines(), kernelDisplayInPix(), l_generateFlateData(), main(), pixaAddBorderGeneral(), pixaaDisplay(), pixaaDisplayByPixa(), pixaAnyColormaps(), pixaccDestroy(), pixaccMultConstAccumulate(), pixaCentroids(), pixaClear(), pixaClipToPix(), pixacompCreateFromPixa(), pixacompDisplayTiledAndScaled(), pixaCountPixels(), pixaCreateFromPix(), PixAddEdgeData(), pixAddMinimalGrayColormap8(), pixAddWithIndicator(), pixaDestroy(), pixaDisplay(), pixaDisplayOnColor(), pixaDisplayOnLattice(), pixaDisplayRandomCmap(), pixaDisplayTiled(), pixaDisplayTiledAndScaled(), pixaDisplayTiledInRows(), pixaDisplayUnsplit(), pixaEqual(), pixaExtractColumnFromEachPix(), pixAffine(), pixAffinePta(), pixAffinePtaGammaXform(), pixAffinePtaWithAlpha(), pixAffineSequential(), pixaFindAreaFraction(), pixaFindAreaPerimRatio(), pixaFindDimensions(), pixaFindPerimSizeRatio(), pixaFindWidthHeightProduct(), pixaFindWidthHeightRatio(), pixaGenerateFont(), pixaGetAlignedStats(), pixaGetPixDimensions(), pixaMorphSequenceByComponent(), pixaMorphSequenceByRegion(), pixaRemovePix(), pixaReplacePix(), PixaSaveDisplay(), pixaSizeRange(), PixaSortTest(), pixAverageIntensityProfile(), pixaWriteCompressedToPS(), pixaWriteFiles(), pixaWriteStream(), pixBackgroundNorm(), pixBackgroundNormFlex(), pixBackgroundNormGrayArray(), pixBackgroundNormGrayArrayMorph(), pixBackgroundNormMorph(), pixBackgroundNormRGBArrays(), pixBackgroundNormRGBArraysMorph(), pixBilinear(), pixBilinearPta(), pixBilinearPtaGammaXform(), pixBilinearPtaWithAlpha(), pixBlend(), pixBlendColor(), pixBlendColorByChannel(), pixBlendGray(), pixBlendGrayAdapt(), pixBlendHardLight(), pixBlendMask(), pixBlendWithGrayMask(), pixBlockconv(), pixBlockconvGray(), pixBlockconvGrayTile(), pixBlockconvGrayUnnormalized(), pixBlockconvTiled(), pixBlockrank(), pixBlocksum(), pixCensusTransform(), pixClipMasked(), pixClose(), pixCloseBrick(), pixCloseBrickDwa(), pixCloseCompBrick(), pixCloseCompBrickDwa(), pixCloseCompBrickExtendDwa(), pixCloseGeneralized(), pixCloseGray(), pixCloseGray3(), pixCloseSafe(), pixCloseSafeBrick(), pixCloseSafeCompBrick(), pixColorContent(), pixColorizeGray(), pixColorMagnitude(), pixColorMorph(), pixColorMorphSequence(), pixColorSegmentClean(), pixColorSegmentCluster(), pixColorSegmentRemoveColors(), pixColorsForQuantization(), pixCombineMasked(), pixCombineMaskedGeneral(), pixCompareBinary(), pixCompareGray(), pixCompareGrayOrRGB(), pixCompareRGB(), pixCompareTiled(), pixcompCreateFromFile(), pixConformsToRectangle(), pixConnCompBB(), pixConnCompPixa(), pixContrastNorm(), pixConvert8To16(), pixConvertColorToSubpixelRGB(), pixConvertGrayToSubpixelRGB(), pixConvertRGBToHue(), pixConvertRGBToSaturation(), pixConvertRGBToValue(), pixConvertTo1(), pixConvertTo1BySampling(), pixConvertTo32(), pixConvertTo32BySampling(), pixConvertTo8BySampling(), pixConvertTo8Or32(), pixConvertToFPix(), pixConvertToPdfDataSegmented(), pixConvertToSubpixelRGB(), pixConvolve(), pixConvolveRGB(), pixConvolveRGBSep(), pixConvolveSep(), pixCorrelationScoreSimple(), pixCountConnComp(), pixDebugFlipDetect(), pixDeskewBarcode(), pixDeskewGeneral(), pixDilate(), pixDilateBrick(), pixDilateBrickDwa(), pixDilateCompBrick(), pixDilateCompBrickDwa(), pixDilateCompBrickExtendDwa(), pixDilateGray(), pixDilateGray3(), pixDisplayColorArray(), pixDisplayDiffBinary(), pixDisplayHitMissSel(), pixDisplayMatchedPattern(), pixDisplayWithTitle(), pixDisplayWriteFormat(), pixDitherTo2bppSpec(), pixDitherToBinaryLUT(), pixDitherToBinarySpec(), pixEqual(), pixEqualizeTRC(), pixErode(), pixErodeBrick(), pixErodeBrickDwa(), pixErodeCompBrick(), pixErodeCompBrickDwa(), pixErodeCompBrickExtendDwa(), pixErodeGray(), pixErodeGray3(), pixExtractBarcodes(), pixFastTophat(), pixFewColorsMedianCutQuantMixed(), pixFewColorsOctcubeQuantMixed(), pixFHMTGen_1(), pixFillClosedBorders(), pixFillHolesToBoundingRect(), pixFillMapHoles(), pixFindAreaPerimRatio(), pixFindBaselines(), pixFindHistoPeaksHSV(), pixFindLargestRectangle(), pixFindNormalizedSquareSum(), pixFindOverlapFraction(), pixFindPerimSizeRatio(), pixFindRectangleComps(), pixFindSkewOrthogonalRange(), pixFindSkewSweep(), pixFindSkewSweepAndSearchScorePivot(), pixFlipFHMTGen(), pixFMorphopGen_1(), pixFMorphopGen_2(), pixFMorphopGen_3(), pixGammaTRCWithAlpha(), pixGenerateBarcodeMask(), pixGenerateFlateData(), pixGenerateMaskByBand(), pixGenerateMaskByValue(), pixGenerateSelBoundary(), pixGenerateSelRandom(), pixGenerateSelWithRuns(), pixGenHalftoneMask(), pixGenTextblockMask(), pixGenTextlineMask(), pixGetAllCCBorders(), pixGetAverageMasked(), pixGetAverageMaskedRGB(), pixGetAverageTiled(), pixGetAverageTiledRGB(), pixGetBackgroundGrayMap(), pixGetBackgroundGrayMapMorph(), pixGetBackgroundRGBMap(), pixGetBackgroundRGBMapMorph(), pixGetBinnedComponentRange(), pixGetCCBorders(), pixGetDifferenceHistogram(), pixGetEdgeProfile(), pixGetGrayHistogram(), pixGetGrayHistogramMasked(), pixGetInvBackgroundMap(), pixGetLocalSkewAngles(), pixGetOuterBorder(), pixGetOuterBordersPtaa(), pixGetRankColorArray(), pixGetRankValueMaskedRGB(), pixGetRegionsBinary(), pixGetRGBComponentCmap(), pixGetTextlineCenters(), pixGetWordBoxesInTextlines(), pixGetWordsInTextlines(), pixGrayMorphSequence(), pixGrayQuantFromHisto(), pixHalfEdgeByBandpass(), pixHaustest(), pixHDome(), pixHMT(), pixHMTDwa_1(), pixHolesByFilling(), pixHShearLI(), pixHtmlViewer(), pixIntersectionOfMorphOps(), pixItalicWords(), pixLocalExtrema(), pixLocateBarcodes(), pixMakeHistoHS(), pixMakeHistoHV(), pixMakeHistoSV(), pixMakeRangeMaskHS(), pixMakeRangeMaskHV(), pixMakeRangeMaskSV(), pixMaskedThreshOnBackgroundNorm(), pixMaskOverColorPixels(), pixMedianCutQuantMixed(), pixMinMaxTiles(), pixMirrorDetect(), pixMirrorDetectDwa(), pixMirroredTiling(), pixMorphCompSequence(), pixMorphCompSequenceDwa(), pixMorphDwa_1(), pixMorphDwa_2(), pixMorphDwa_3(), pixMorphGradient(), pixMorphSequence(), pixMorphSequenceByComponent(), pixMorphSequenceByRegion(), pixMorphSequenceDwa(), pixOctreeColorQuantGeneral(), pixOpen(), pixOpenBrick(), pixOpenBrickDwa(), pixOpenCompBrick(), pixOpenCompBrickDwa(), pixOpenCompBrickExtendDwa(), pixOpenGeneralized(), pixOpenGray(), pixOpenGray3(), pixOrientDetect(), pixOrientDetectDwa(), pixOtsuAdaptiveThreshold(), pixOtsuThreshOnBackgroundNorm(), pixPaintSelfThroughMask(), pixPaintThroughMask(), pixPlotAlongPta(), pixProcessBarcodes(), pixProjective(), pixProjectivePta(), pixProjectivePtaGammaXform(), pixProjectivePtaWithAlpha(), pixQuadraticVShearLI(), pixQuadraticVShearSampled(), pixQuadtreeMean(), pixQuadtreeVariance(), pixQualifyLocalMinima(), pixQuantizeIfFewColors(), pixRankFilterGray(), pixRankFilterRGB(), pixRankHaustest(), pixRasteropHip(), pixRasteropVip(), pixReadBarcodes(), pixReadFromTiffStream(), pixReadHeader(), pixReadHeaderMem(), pixReadStreamBmp(), pixReadStreamJpeg(), pixReadStreamWebP(), pixReduceRankBinaryCascade(), pixRemoveMatchedPattern(), pixRemoveSeededComponents(), pixRemoveWithIndicator(), pixReversalProfile(), pixRotate(), pixRotate2Shear(), pixRotate3Shear(), pixRotateAM(), pixRotateAMColorFast2(), pixRotateAMCorner(), pixRotateBinaryNice(), pixRotateGammaXform(), pixRotateWithAlpha(), pixRunHistogramMorph(), pixRunlengthTransform(), pixSauvolaBinarize(), pixSauvolaBinarizeTiled(), PixSave(), PixSave32(), PixSavePlots1(), PixSavePlots2(), pixSaveTiledOutline(), pixSaveTiledWithText(), pixScaleAreaMap(), pixScaleAreaMap2(), pixScaleColor4xLI(), pixScaleGammaXform(), pixScaleGeneral(), pixScaleGrayRankCascade(), pixScaleLI(), pixScaleSmooth(), pixScaleToGray(), pixScaleToGrayFast(), pixScaleToGrayMipmap(), pixScaleWithAlpha(), pixSearchBinaryMaze(), pixSearchGrayMaze(), pixSeedfillBinary(), pixSeedfillBinaryRestricted(), pixSeedfillGrayBasin(), pixSeedfillGrayInvSimple(), pixSeedfillGraySimple(), pixSeedfillMorph(), pixSeedspread(), pixSelectedLocalExtrema(), pixSelectiveConnCompFill(), pixSelectMinInConnComp(), pixSetBlackOrWhiteBoxa(), pixSetMasked(), pixSetMaskedGeneral(), pixSetTextline(), pixSetUnderTransparency(), pixSimpleCaptcha(), pixSmoothConnectedRegions(), pixSnapColorCmap(), pixSobelEdgeFilter(), pixSplitComponentIntoBoxa(), pixSplitDistributionFgBg(), pixSplitIntoBoxa(), pixStretchHorizontalLI(), pixStretchHorizontalSampled(), pixSubsampleBoundaryPixels(), PixTest1(), PixTest2(), PixTest3(), PixTestEqual(), pixThinExamples(), pixThinGeneral(), pixThresholdForFgBg(), pixThresholdGrayArb(), pixThresholdSpreadNorm(), pixThresholdTo2bpp(), pixThresholdTo4bpp(), pixThresholdToBinary(), pixTilingDestroy(), pixTilingGetTile(), pixTophat(), pixTransferAllData(), pixUnionOfMorphOps(), pixUnsharpMasking(), pixUnsharpMaskingFast(), pixUnsharpMaskingGray(), pixUpDownDetectGeneral(), pixUpDownDetectGeneralDwa(), pixVShearLI(), pixWarpStereoscopic(), pixWindowedMean(), pixWindowedMeanSquare(), pixWindowedStats(), pixWordMaskByDilation(), pixWritePSEmbed(), pixWriteSegmentedPageToPS(), pixWriteStreamAsciiPnm(), pixWriteStreamGif(), pixWriteStreamPng(), pixWriteStreamPnm(), pixWriteStreamPS(), pixWriteStreamWebP(), pixWriteStringPS(), pixWriteToTiffStream(), pixWriteTTFText(), pixWriteWebPwithTargetPSNR(), ptaaGetBoundaryPixels(), ptaaRemoveShortLines(), ptaGetBoundaryPixels(), QuantizeNonImageRegion(), RotateOrthTest(), rotateTest(), RotateTest(), saConvertFilesToPdfData(), selaAddCrossJunctions(), selaAddTJunctions(), selaDisplayInPix(), selDisplayInPix(), selReadFromColorImage(), shearTest(), test_gif(), test_mem_gif(), test_mem_png(), test_writemem(), testcomp(), testcomp_mem(), TestDistance(), TestHardlight(), TestImage(), TestProjection(), TestTiling(), TranslateAndSave1(), writeMultipageTiffSA(), wshedApply(), wshedDestroy(), wshedRenderColors(), and wshedRenderFill().

PIX* pixCopy ( PIX pixd,
PIX pixs 
)

pixCopy()

Input: pixd (<optional>; can be null, or equal to pixs, or different from pixs) pixs Return: pixd, or null on error

Notes: (1) There are three cases: (a) pixd == null (makes a new pix; refcount = 1) (b) pixd == pixs (no-op) (c) pixd != pixs (data copy; no change in refcount) If the refcount of pixd > 1, case (c) will side-effect these handles. (2) The general pattern of use is: pixd = pixCopy(pixd, pixs); This will work for all three cases. For clarity when the case is known, you can use: (a) pixd = pixCopy(NULL, pixs); (c) pixCopy(pixd, pixs); (3) For case (c), we check if pixs and pixd are the same size (w,h,d). If so, the data is copied directly. Otherwise, the data is reallocated to the correct size and the copy proceeds. The refcount of pixd is unchanged. (4) This operation, like all others that may involve a pre-existing pixd, will side-effect any existing clones of pixd.

Definition at line 548 of file pix1.c.

References ERROR_PTR, NULL, pixCopyColormap(), pixCopyInputFormat(), pixCopyResolution(), pixCopyText(), pixCreateTemplate(), pixGetData(), pixGetHeight(), pixGetWpl(), pixResizeImageData(), and PROCNAME.

Referenced by CopyPtras(), CopyStoreClean(), finalPositioningForAlignment(), GeneratePattern(), main(), pixaAddPix(), pixAddGray(), pixAddMinimalGrayColormap8(), pixAddSingleTextblock(), pixAffineSequential(), pixaGenerateFont(), pixaGetPix(), pixaInitFull(), pixAnd(), pixBackgroundNorm(), pixBlendBoxaRandom(), pixBlendColor(), pixBlendColorByChannel(), pixBlendGray(), pixBlendGrayAdapt(), pixBlendHardLight(), pixBlendMask(), pixBlendWithGrayMask(), pixBlockconv(), pixBlockconvGray(), pixBlockconvGrayTile(), pixBlockconvGrayUnnormalized(), pixBlockconvTiled(), pixBlockrank(), pixBlocksum(), pixCloseBrick(), pixCloseBrickDwa(), pixCloseCompBrick(), pixCloseCompBrickDwa(), pixCloseGray(), pixCloseGray3(), pixCloseSafe(), pixCloseSafeBrick(), pixCloseSafeCompBrick(), pixColorizeGray(), pixColorMorph(), pixColorMorphSequence(), pixColorsForQuantization(), pixCompareGray(), pixConformsToRectangle(), pixConnCompBB(), pixConnCompPixa(), pixContrastTRC(), pixContrastTRCMasked(), pixConvertGrayToColormap(), pixConvertGrayToColormap8(), pixConvertGrayToFalseColor(), pixConvertHSVToRGB(), pixConvertLossless(), pixConvertRGBToHSV(), pixConvertRGBToYUV(), pixConvertTo1(), pixConvertTo32(), pixConvertTo8(), pixConvertTo8Or32(), pixConvertYUVToRGB(), pixCountConnComp(), pixDilateBrick(), pixDilateBrickDwa(), pixDilateCompBrick(), pixDilateCompBrickDwa(), pixDilateGray(), pixDilateGray3(), pixDrawBoxa(), pixDrawBoxaRandom(), pixEqualizeTRC(), pixErodeBrick(), pixErodeBrickDwa(), pixErodeCompBrick(), pixErodeCompBrickDwa(), pixErodeGray(), pixErodeGray3(), pixExpandBinaryPower2(), pixExpandBinaryReplicate(), pixExpandReplicate(), pixExtendByReplication(), pixFadeWithGray(), pixFHMTGen_1(), pixFillHolesToBoundingRect(), pixFillMapHoles(), pixFindOverlapFraction(), pixFlipFHMTGen(), pixFlipLR(), pixFlipTB(), pixFMorphopGen_1(), pixFMorphopGen_2(), pixFMorphopGen_3(), pixGammaTRC(), pixGammaTRCMasked(), pixGammaTRCWithAlpha(), pixGenHalftoneMask(), pixGlobalNormRGB(), pixGrayMorphSequence(), pixGrayQuantFromCmap(), pixHDome(), pixHMTDwa_1(), pixHShear(), pixHShearLI(), pixInvert(), pixLinearMapToTargetColor(), pixLinearTRCTiled(), pixMaskBoxa(), pixMedianCutQuantMixed(), pixMinOrMax(), pixModifyHue(), pixModifySaturation(), pixMorphCompSequence(), pixMorphCompSequenceDwa(), pixMorphDwa_1(), pixMorphDwa_2(), pixMorphDwa_3(), pixMorphSequence(), pixMorphSequenceDwa(), pixMultConstantColor(), pixMultMatrixColor(), pixOpenBrick(), pixOpenBrickDwa(), pixOpenCompBrick(), pixOpenCompBrickDwa(), pixOpenGray(), pixOpenGray3(), pixOr(), pixPaintBoxa(), pixPaintBoxaRandom(), pixPaintSelfThroughMask(), pixQuadraticVShear(), pixQuadraticVShearLI(), pixQuadraticVShearSampled(), pixRankFilter(), pixRankFilterGray(), pixRankFilterRGB(), pixReduceRankBinaryCascade(), pixRemoveColormap(), pixRemoveSeededComponents(), pixRenderContours(), pixResizeToMatch(), pixRotate180(), pixRotateOrth(), pixRunHistogramMorph(), pixScaleBinary(), pixScaleByIntSubsampling(), pixScaleBySampling(), pixScaleColorLI(), pixScaleGeneral(), pixScaleGrayLI(), pixScaleGrayRankCascade(), pixSeedfillBinary(), pixSeedfillGrayBasin(), pixSeedfillGrayInvSimple(), pixSeedfillGraySimple(), pixSeedfillMorph(), pixSelectByAreaFraction(), pixSelectByAreaPerimRatio(), pixSelectBySize(), pixSelectByWidthHeightRatio(), pixSelectiveConnCompFill(), pixSetBlackOrWhiteBoxa(), pixSetUnderTransparency(), pixSnapColor(), pixSnapColorCmap(), pixSplitComponentIntoBoxa(), pixSubsampleBoundaryPixels(), pixSubtract(), pixSubtractGray(), PixTestEqual(), pixThinGeneral(), pixThresholdOn8bpp(), pixThresholdToValue(), pixTranslate(), pixVShear(), pixVShearLI(), pixWordMaskByDilation(), pixWriteSegmentedPageToPS(), pixWriteTTFText(), pixXor(), processMorphArgs1(), ptaaRemoveShortLines(), shearTest(), wshedRenderColors(), and wshedRenderFill().

l_int32 pixResizeImageData ( PIX pixd,
PIX pixs 
)

pixResizeImageData()

Input: pixd (gets new uninitialized buffer for image data) pixs (determines the size of the buffer; not changed) Return: 0 if OK, 1 on error

Notes: (1) This removes any existing image data from pixd and allocates an uninitialized buffer that will hold the amount of image data that is in pixs.

Definition at line 605 of file pix1.c.

References ERROR_INT, NULL, pix_malloc(), pixFreeData(), pixGetDimensions(), pixGetWpl(), pixSetData(), pixSetDepth(), pixSetHeight(), pixSetWidth(), pixSetWpl(), pixSizesEqual(), and PROCNAME.

Referenced by pixCopy(), pixFHMTGen_1(), pixFMorphopGen_1(), pixFMorphopGen_2(), pixFMorphopGen_3(), pixHShear(), pixTransferAllData(), pixVShear(), processMorphArgs1(), and processMorphArgs2().

l_int32 pixTransferAllData ( PIX pixd,
PIX **  ppixs,
l_int32  copytext,
l_int32  copyformat 
)

pixTransferAllData()

Input: pixd (must be different from pixs) &pixs (will be nulled if refcount goes to 0) copytext (1 to copy the text field; 0 to skip) copyformat (1 to copy the informat field; 0 to skip) Return: 0 if OK, 1 on error

Notes: (1) This does a complete data transfer from pixs to pixd, followed by the destruction of pixs (refcount permitting). (2) If the refcount of pixs is 1, pixs is destroyed. Otherwise, the data in pixs is copied (rather than transferred) to pixd. (3) This operation, like all others with a pre-existing pixd, will side-effect any existing clones of pixd. The pixd refcount does not change. (4) When might you use this? Suppose you have an in-place Pix function (returning void) with the typical signature: void function-inplace(PIX *pix, ...) where "..." are non-pointer input parameters, and suppose further that you sometimes want to return an arbitrary Pix in place of the input Pix. There are two ways you can do this: (a) The straightforward way is to change the function signature to take the address of the Pix ptr: void function-inplace(PIX **ppix, ...) { PIX *pixt = function-makenew(*ppix); pixDestroy(ppix); *ppix = pixt; return; } Here, the input and returned pix are different, as viewed by the calling function, and the inplace function is expected to destroy the input pix to avoid a memory leak. (b) Keep the signature the same and use pixTransferAllData() to return the new Pix in the input Pix struct: void function-inplace(PIX *pix, ...) { PIX *pixt = function-makenew(pix); pixTransferAllData(pix, &pixt, 0, 0); // pixDestroy() is called on pixt return; } Here, the input and returned pix are the same, as viewed by the calling function, and the inplace function must never destroy the input pix, because the calling function maintains an unchanged handle to it.

Definition at line 748 of file pix1.c.

References Pix::colormap, Pix::data, ERROR_INT, NULL, pixCopyColormap(), pixCopyDimensions(), pixCopyInputFormat(), pixCopyResolution(), pixCopyText(), pixDestroy(), pixFreeData(), pixGetColormap(), pixGetData(), pixGetHeight(), pixGetRefcount(), pixGetText(), pixGetWpl(), pixResizeImageData(), pixSetColormap(), pixSetData(), pixSetText(), and PROCNAME.

Referenced by main(), pixCloseBrickDwa(), pixCloseCompBrickDwa(), pixCloseCompBrickExtendDwa(), pixColorGray(), pixColorGrayCmap(), pixDilateBrickDwa(), pixDilateCompBrickDwa(), pixDilateCompBrickExtendDwa(), pixErodeBrickDwa(), pixErodeCompBrickDwa(), pixErodeCompBrickExtendDwa(), pixOpenBrickDwa(), pixOpenCompBrickDwa(), and pixReadStreamGif().

l_int32 pixGetWidth ( PIX pix)

Definition at line 803 of file pix1.c.

References ERROR_INT, PROCNAME, UNDEF, and Pix::w.

Referenced by AddScaledImages(), adjacentOnPixelInRaster(), bmfGetWidth(), ccbaCreate(), ccbaWriteStream(), convertTiffMultipageToPS(), finalPositioningForAlignment(), findSimilarSizedTemplatesInit(), findSimilarSizedTemplatesNext(), fpixaDisplayQuadtree(), getCutPathForHole(), jbAddPage(), jbClassifyCorrelation(), jbClassifyRankHaus(), jbDataRender(), main(), pixaaDisplayByPixa(), pixaDisplayTiled(), pixaGenerateFont(), pixAnd(), pixApplyInvBackgroundRGBMap(), pixaSizeRange(), pixAssignToNearestColor(), pixBlendMask(), pixClearAll(), pixColorContent(), pixColorSegmentCluster(), pixColorSegmentTryCluster(), pixConvert1To16(), pixConvert1To2(), pixConvert1To32(), pixConvert1To4(), pixConvert1To8(), pixCopyDimensions(), pixDitherOctindexWithCmap(), pixEqualWithCmap(), pixExtractBarcodeCrossings(), pixFHMTGen_1(), pixFindBaselines(), pixFindCornerPixels(), pixFindDifferentialSquareSum(), pixFindSkewSweepAndSearchScorePivot(), pixFlipFHMTGen(), pixFMorphopGen_1(), pixFMorphopGen_2(), pixFMorphopGen_3(), pixGenerateSelBoundary(), pixGenerateSelRandom(), pixGenerateSelWithRuns(), pixGetBackgroundGrayMap(), pixGetBackgroundGrayMapMorph(), pixGetBackgroundRGBMap(), pixGetBackgroundRGBMapMorph(), pixGetCCBorders(), pixGetHoleBorder(), pixGetLocalSkewAngles(), pixGetLocalSkewTransform(), pixGetOuterBorder(), pixGetOuterBorderPta(), pixGetRunCentersOnLine(), pixGetRunsOnLine(), pixHaustest(), pixHtmlViewer(), pixInvert(), pixOr(), pixPlotAlongPta(), pixPrintStreamInfo(), pixRankHaustest(), pixRasterop(), pixRasteropFullImage(), pixReduceBinary2(), pixReduceRankBinary2(), pixRemoveMatchedPattern(), pixRotate90(), pixRotateAMColorFast2(), pixRotateShearCenter(), pixRotateShearCenterIP(), PixSave(), pixScaleAreaMap2(), pixScaleMipmap(), pixScaleRGBToGray2(), pixSetAll(), pixSetRGBComponent(), pixSetSelectMaskedCmap(), pixSetTextline(), pixShiftRGB258(), pixSizesEqual(), pixVShearCenter(), pixWriteMixedToPS(), pixWritePSEmbed(), pixWriteStreamBmp(), pixWriteStreamPng(), pixWriteTTFText(), pixXor(), pixZero(), and wshedCreate().

l_int32 pixSetWidth ( PIX pix,
l_int32  width 
)

Definition at line 815 of file pix1.c.

References ERROR_INT, PROCNAME, and Pix::w.

Referenced by pixCopyDimensions(), pixCreateHeader(), pixResizeImageData(), and pixSetDimensions().

l_int32 pixGetHeight ( PIX pix)

Definition at line 833 of file pix1.c.

References ERROR_INT, Pix::h, PROCNAME, and UNDEF.

Referenced by adjacentOnPixelInRaster(), bmfMakeAsciiTables(), ccbaCreate(), ccbaWriteStream(), convertTiffMultipageToPS(), finalPositioningForAlignment(), findSimilarSizedTemplatesInit(), findSimilarSizedTemplatesNext(), getCutPathForHole(), jbAddPage(), jbClassifyCorrelation(), jbClassifyRankHaus(), jbDataRender(), jbGetLLCorners(), main(), pixaaDisplayByPixa(), pixaDisplayTiled(), pixaGenerateFont(), pixAnd(), pixApplyInvBackgroundRGBMap(), pixaSizeRange(), pixAssignToNearestColor(), pixBlendMask(), pixClearAll(), pixColorContent(), pixColorSegmentCluster(), pixColorSegmentTryCluster(), pixConnCompBB(), pixConnCompPixa(), pixConvert1To16(), pixConvert1To2(), pixConvert1To32(), pixConvert1To4(), pixConvert1To8(), pixCopy(), pixCopyDimensions(), pixCountPixelsByRow(), pixDitherOctindexWithCmap(), pixEndianByteSwap(), pixEndianByteSwapNew(), pixEndianTwoByteSwap(), pixEndianTwoByteSwapNew(), pixEqualWithCmap(), pixExtractData(), pixFHMTGen_1(), pixFindBaselines(), pixFindCornerPixels(), pixFindDifferentialSquareSum(), pixFindSkewSweepAndSearchScorePivot(), pixFlipFHMTGen(), pixFMorphopGen_1(), pixFMorphopGen_2(), pixFMorphopGen_3(), pixGenerateSelBoundary(), pixGenerateSelRandom(), pixGenerateSelWithRuns(), pixGetBackgroundGrayMap(), pixGetBackgroundGrayMapMorph(), pixGetBackgroundRGBMap(), pixGetBackgroundRGBMapMorph(), pixGetHoleBorder(), pixGetLinePtrs(), pixGetLocalSkewAngles(), pixGetLocalSkewTransform(), pixGetOuterBorder(), pixGetOuterBorderPta(), pixGetRunCentersOnLine(), pixGetRunsOnLine(), pixHaustest(), pixHShearCenter(), pixInvert(), pixOr(), pixPlotAlongPta(), pixPrintStreamInfo(), pixRankHaustest(), pixRasterop(), pixRasteropFullImage(), pixReduceBinary2(), pixReduceRankBinary2(), pixRemoveMatchedPattern(), pixRotate90(), pixRotateAMColorFast2(), pixRotateShearCenter(), pixRotateShearCenterIP(), pixScaleAreaMap2(), pixScaleMipmap(), pixScaleRGBToGray2(), pixSeedfillBinary(), pixSetAll(), pixSetRGBComponent(), pixSetSelectMaskedCmap(), pixShiftRGB258(), pixSizesEqual(), pixTransferAllData(), pixWarpStereoscopic(), pixWriteMixedToPS(), pixWritePSEmbed(), pixWriteStreamBmp(), pixWriteStreamPng(), pixWriteTTFText(), pixXor(), pixZero(), and wshedCreate().

l_int32 pixSetHeight ( PIX pix,
l_int32  height 
)

Definition at line 845 of file pix1.c.

References ERROR_INT, Pix::h, and PROCNAME.

Referenced by pixCopyDimensions(), pixCreateHeader(), pixResizeImageData(), and pixSetDimensions().

l_int32 pixGetDepth ( PIX pix)

Definition at line 863 of file pix1.c.

References Pix::d, ERROR_INT, PROCNAME, and UNDEF.

Referenced by adjacentOnPixelInRaster(), ccbCreate(), convertFilesTo1bpp(), convertToPSEmbed(), dewarpCreate(), ioFormatTest(), jbAccumulateComposites(), jbAddPage(), jbAddPages(), main(), numaEqualizeTRC(), octreeGenerateAndPrune(), pixaaDisplay(), pixaaDisplayByPixa(), pixAbsDifference(), pixAccumulate(), pixacompAddPix(), pixaCountPixels(), pixAddBlackBorder(), pixAddGray(), pixAddGrayColormap8(), pixAddMinimalGrayColormap8(), pixaDisplay(), pixaDisplayRandomCmap(), pixaDisplayTiled(), pixaExtractColumnFromEachPix(), pixAffine(), pixAffineGray(), pixAffinePta(), pixAffinePtaColor(), pixAffinePtaGammaXform(), pixAffinePtaGray(), pixAffinePtaWithAlpha(), pixaMorphSequenceByRegion(), pixAnd(), pixApplyInvBackgroundGrayMap(), pixApplyInvBackgroundRGBMap(), pixApplyLocalThreshold(), pixAssignToNearestColor(), pixAverageRasterScans(), pixaWriteCompressedToPS(), pixBackgroundNorm(), pixBackgroundNormFlex(), pixBackgroundNormGrayArray(), pixBackgroundNormGrayArrayMorph(), pixBackgroundNormMorph(), pixBackgroundNormRGBArrays(), pixBackgroundNormRGBArraysMorph(), pixBilinear(), pixBilinearGray(), pixBilinearPta(), pixBilinearPtaColor(), pixBilinearPtaGammaXform(), pixBilinearPtaGray(), pixBilinearPtaWithAlpha(), pixBlend(), pixBlendColor(), pixBlendColorByChannel(), pixBlendGray(), pixBlendGrayAdapt(), pixBlendHardLight(), pixBlendInRect(), pixBlendMask(), pixBlendWithGrayMask(), pixBlockconv(), pixBlockconvGray(), pixBlockconvGrayTile(), pixBlockconvTiled(), pixBlocksum(), pixCensusTransform(), pixChooseOutputFormat(), pixClipBoxToEdges(), pixClipBoxToForeground(), pixClipMasked(), pixClipToForeground(), pixCloseBrick(), pixCloseBrickDwa(), pixCloseCompBrick(), pixCloseCompBrickDwa(), pixCloseCompBrickExtendDwa(), pixCloseGray(), pixCloseGray3(), pixCloseSafe(), pixCloseSafeBrick(), pixCloseSafeCompBrick(), pixcmapGenerateFromHisto(), pixColorFraction(), pixColorGrayCmap(), pixColorizeGray(), pixColorMorph(), pixColorSegment(), pixColorSegmentClean(), pixColorSegmentCluster(), pixColorSegmentRemoveColors(), pixColumnStats(), pixCompareBinary(), pixCompareGray(), pixCompareGrayOrRGB(), pixCompareRGB(), pixCompareTiled(), pixConformsToRectangle(), pixConnComp(), pixConnCompBB(), pixConnCompPixa(), pixContrastNorm(), pixContrastTRC(), pixContrastTRCMasked(), pixConvert16To8(), pixConvert1To16(), pixConvert1To2(), pixConvert1To2Cmap(), pixConvert1To32(), pixConvert1To4(), pixConvert1To4Cmap(), pixConvert1To8(), pixConvert2To8(), pixConvert4To8(), pixConvert8To32(), pixConvertColorToSubpixelRGB(), pixConvertForPSWrap(), pixConvertGrayToColormap(), pixConvertGrayToColormap8(), pixConvertGrayToFalseColor(), pixConvertGrayToSubpixelRGB(), pixConvertHSVToRGB(), pixConvertRGBToColormap(), pixConvertRGBToGray(), pixConvertRGBToGrayFast(), pixConvertRGBToGrayMinMax(), pixConvertRGBToHSV(), pixConvertRGBToYUV(), pixConvertTo1(), pixConvertTo16(), pixConvertTo32(), pixConvertTo8(), pixConvertTo8Or32(), pixConvertToFPix(), pixConvertToPdfData(), pixConvertToPdfDataSegmented(), pixConvertToSubpixelRGB(), pixConvertYUVToRGB(), pixConvolveRGB(), pixConvolveRGBSep(), pixConvolveSep(), pixCopyDimensions(), pixCorrelationScore(), pixCorrelationScoreSimple(), pixCorrelationScoreThresholded(), pixCountConnComp(), pixCountPixels(), pixCountPixelsByColumn(), pixCountPixelsByRow(), pixCountPixelsInRow(), pixDeskewBarcode(), pixDeskewGeneral(), pixDilateBrick(), pixDilateBrickDwa(), pixDilateCompBrick(), pixDilateCompBrickDwa(), pixDilateCompBrickExtendDwa(), pixDilateGray(), pixDilateGray3(), pixDilateGray3h(), pixDilateGray3v(), pixDisplayDiffBinary(), pixDisplayHitMissSel(), pixDisplayMatchedPattern(), pixDisplayPta(), pixDisplayWithTitle(), pixDisplayWriteFormat(), pixDistanceFunction(), pixDitherOctindexWithCmap(), pixDitherTo2bpp(), pixDitherToBinary(), pixDrawBoxa(), pixDrawBoxaRandom(), pixEqual(), pixEqualizeTRC(), pixEqualWithCmap(), pixErodeBrick(), pixErodeBrickDwa(), pixErodeCompBrick(), pixErodeCompBrickDwa(), pixErodeCompBrickExtendDwa(), pixErodeGray(), pixErodeGray3(), pixErodeGray3h(), pixErodeGray3v(), pixExtendByReplication(), pixExtractBarcodeCrossings(), pixExtractBarcodes(), pixExtractBarcodeWidths1(), pixExtractBarcodeWidths2(), pixExtractBorderConnComps(), pixFadeWithGray(), pixFastTophat(), pixFewColorsMedianCutQuantMixed(), pixFewColorsOctcubeQuant1(), pixFewColorsOctcubeQuant2(), pixFewColorsOctcubeQuantMixed(), pixFHMTGen_1(), pixFillClosedBorders(), pixFillHolesToBoundingRect(), pixFillMapHoles(), pixFinalAccumulate(), pixFinalAccumulateThreshold(), pixFindAreaPerimRatio(), pixFindCornerPixels(), pixFindEqualValues(), pixFindHistoPeaksHSV(), pixFindNormalizedSquareSum(), pixFindOverlapFraction(), pixFindPerimSizeRatio(), pixFindRectangleComps(), pixFindSkew(), pixFindSkewOrthogonalRange(), pixFindSkewSweep(), pixFindSkewSweepAndSearchScorePivot(), pixFixedOctcubeQuant256(), pixFixedOctcubeQuantGenRGB(), pixFlipFHMTGen(), pixFMorphopGen_1(), pixFMorphopGen_2(), pixFMorphopGen_3(), pixGammaTRC(), pixGammaTRCMasked(), pixGammaTRCWithAlpha(), pixGenerateBarcodeMask(), pixGenerateFlateData(), pixGenerateG4Data(), pixGenerateJpegData(), pixGenerateMaskByBand(), pixGenerateMaskByValue(), pixGenerateSelBoundary(), pixGenerateSelRandom(), pixGenerateSelWithRuns(), pixGenHalftoneMask(), pixGenTextblockMask(), pixGenTextlineMask(), pixGetAllCCBorders(), pixGetAverageMasked(), pixGetAverageMaskedRGB(), pixGetAverageTiledRGB(), pixGetBackgroundGrayMap(), pixGetBackgroundGrayMapMorph(), pixGetBackgroundRGBMap(), pixGetBackgroundRGBMapMorph(), pixGetBinnedComponentRange(), pixGetCCBorders(), pixGetColumnStats(), pixGetComponentRange(), pixGetDifferenceHistogram(), pixGetEdgeProfile(), pixGetGrayHistogram(), pixGetGrayHistogramMasked(), pixGetInvBackgroundMap(), pixGetLastOffPixelInRun(), pixGetLastOnPixelInRun(), pixGetMeanVerticals(), pixGetOuterBorderPta(), pixGetOuterBordersPtaa(), pixGetRankColorArray(), pixGetRankValueMasked(), pixGetRankValueMaskedRGB(), pixGetRegionsBinary(), pixGetRGBComponent(), pixGetRGBComponentCmap(), pixGetRGBLine(), pixGetRowStats(), pixGetRunCentersOnLine(), pixGetRunsOnLine(), pixGetTextlineCenters(), pixGlobalNormNoSatRGB(), pixGrayQuantFromHisto(), pixHalfEdgeByBandpass(), pixHDome(), pixHMTDwa_1(), pixHolesByFilling(), pixHShearLI(), pixIntersectionOfMorphOps(), pixLinearMapToTargetColor(), pixLinearTRCTiled(), pixLocalExtrema(), pixLocateBarcodes(), pixMakeHistoHS(), pixMakeHistoHV(), pixMakeHistoSV(), pixMakeRangeMaskHS(), pixMakeRangeMaskHV(), pixMakeRangeMaskSV(), pixMaskConnComp(), pixMaskedThreshOnBackgroundNorm(), pixMaxDynamicRange(), pixMeanInRectangle(), pixMeanSquareAccum(), pixMeasureEdgeSmoothness(), pixMedianCutHisto(), pixMedianCutQuantGeneral(), pixMedianCutQuantMixed(), pixMinMaxTiles(), pixMinOrMax(), pixMorphDwa_1(), pixMorphDwa_2(), pixMorphDwa_3(), pixMorphGradient(), pixMorphSequenceByRegion(), pixMultConstAccumulate(), pixNumSignificantGrayColors(), pixOctcubeHistogram(), pixOctcubeQuantFromCmap(), pixOctcubeQuantFromCmapLUT(), pixOctcubeQuantMixedWithGray(), pixOctreeColorQuant(), pixOctreeColorQuantGeneral(), pixOctreeQuantByPopulation(), pixOctreeQuantizePixels(), pixOctreeQuantNumColors(), pixOpenBrick(), pixOpenBrickDwa(), pixOpenCompBrick(), pixOpenCompBrickDwa(), pixOpenCompBrickExtendDwa(), pixOpenGray(), pixOpenGray3(), pixOr(), pixOrientDetect(), pixOrientDetectDwa(), pixOtsuAdaptiveThreshold(), pixOtsuThreshOnBackgroundNorm(), pixPaintBoxa(), pixPaintBoxaRandom(), pixPaintThroughMask(), pixPlotAlongPta(), pixPrintStreamInfo(), pixProcessBarcodes(), pixProjective(), pixProjectiveGray(), pixProjectivePta(), pixProjectivePtaColor(), pixProjectivePtaGammaXform(), pixProjectivePtaGray(), pixProjectivePtaWithAlpha(), pixQuadraticVShearLI(), pixQuadtreeMean(), pixQuadtreeVariance(), pixQualifyLocalMinima(), pixQuantFromCmap(), pixQuantizeIfFewColors(), pixQuantizeWithColormap(), pixRankColumnTransform(), pixRankFilter(), pixRankFilterRGB(), pixRankRowTransform(), pixRasterop(), pixReadBarcodeWidths(), pixReadMem(), pixReduceBinary2(), pixReduceRankBinary2(), pixReduceRankBinaryCascade(), pixRemoveBorderConnComps(), pixRemoveMatchedPattern(), pixRemoveSeededComponents(), pixRemoveUnusedColors(), pixRenderPtaArb(), pixRenderPtaBlend(), pixRotate(), pixRotate180(), pixRotate90(), pixRotateAM(), pixRotateAMColor(), pixRotateAMColorCorner(), pixRotateAMColorFast(), pixRotateAMColorFast2(), pixRotateAMCorner(), pixRotateAMGray(), pixRotateAMGrayCorner(), pixRotateBinaryNice(), pixRotateGammaXform(), pixRotateWithAlpha(), pixRowStats(), pixRunHistogramMorph(), pixRunlengthTransform(), pixSauvolaBinarize(), pixSauvolaBinarizeTiled(), pixSauvolaGetThreshold(), pixSaveTiledOutline(), pixScaleAreaMap(), pixScaleAreaMap2(), pixScaleBinary(), pixScaleBySampling(), pixScaleColor2xLI(), pixScaleColor4xLI(), pixScaleColorLI(), pixScaleGammaXform(), pixScaleGeneral(), pixScaleGray2xLI(), pixScaleGray2xLIDither(), pixScaleGray2xLIThresh(), pixScaleGray4xLI(), pixScaleGray4xLIDither(), pixScaleGray4xLIThresh(), pixScaleGrayLI(), pixScaleGrayRankCascade(), pixScaleGrayToBinaryFast(), pixScaleLI(), pixScaleRGBToBinaryFast(), pixScaleRGBToGray2(), pixScaleRGBToGrayFast(), pixScaleSmooth(), pixScaleToGray(), pixScaleToGray16(), pixScaleToGray2(), pixScaleToGray3(), pixScaleToGray4(), pixScaleToGray6(), pixScaleToGray8(), pixScaleToGrayFast(), pixScaleToGrayMipmap(), pixScaleWithAlpha(), pixScanForEdge(), pixScanForForeground(), pixSearchForRectangle(), pixSeedfill(), pixSeedfill4(), pixSeedfill4BB(), pixSeedfill8(), pixSeedfill8BB(), pixSeedfillBB(), pixSeedfillBinary(), pixSeedfillGray(), pixSeedfillGrayBasin(), pixSeedfillGrayInv(), pixSeedfillGrayInvSimple(), pixSeedfillGraySimple(), pixSeedfillMorph(), pixSeedspread(), pixSelectedLocalExtrema(), pixSelectiveConnCompFill(), pixSelectMinInConnComp(), pixSetBlackOrWhite(), pixSetBlackOrWhiteBoxa(), pixSetMasked(), pixSetMaskedCmap(), pixSetMaskedGeneral(), pixSetPixelColumn(), pixSetRGBComponent(), pixSetSelectCmap(), pixSetSelectMaskedCmap(), pixSetTextline(), pixSetUnderTransparency(), pixSetupByteProcessing(), pixShiftRGB258(), pixSizesEqual(), pixSmoothConnectedRegions(), pixSnapColor(), pixSplitComponentIntoBoxa(), pixSplitIntoBoxa(), pixStereoFromPair(), pixStretchHorizontal(), pixSubsampleBoundaryPixels(), pixSubtract(), pixSubtractGray(), pixThin(), pixThinExamples(), pixThinGeneral(), pixThreshold8(), pixThresholdOn8bpp(), pixThresholdPixelSum(), pixThresholdSpreadNorm(), pixThresholdToValue(), pixTophat(), pixTRCMap(), pixUnionOfMorphOps(), pixUnpackBinary(), pixUnsharpMasking(), pixUnsharpMaskingFast(), pixUnsharpMaskingGrayFast(), pixVarianceInRectangle(), pixVShearLI(), pixWindowedMean(), pixWindowedMeanSquare(), pixWindowedStats(), pixWindowedVariance(), pixWriteImpliedFormat(), pixWriteMemTiffCustom(), pixWriteSegmentedPageToPS(), pixWriteStreamAsciiPnm(), pixWriteStreamBmp(), pixWriteStreamGif(), pixWriteStreamPdf(), pixWriteStreamPng(), pixWriteStreamPnm(), pixWriteStreamTiff(), pixWriteStreamWebP(), pixWriteTTFText(), pixWriteWebPwithTargetPSNR(), pixXor(), pixZero(), processMorphArgs1(), processMorphArgs2(), ptaaGetBoundaryPixels(), ptaaRemoveShortLines(), ptaGetBoundaryPixels(), ptaGetPixelsFromPix(), RotateTest(), test_gif(), TestHardlight(), writeMultipageTiffSA(), and wshedCreate().

l_int32 pixSetDepth ( PIX pix,
l_int32  depth 
)

Definition at line 875 of file pix1.c.

References Pix::d, ERROR_INT, and PROCNAME.

Referenced by pixCopyDimensions(), pixCreateHeader(), pixResizeImageData(), and pixSetDimensions().

l_int32 pixGetDimensions ( PIX pix,
l_int32 pw,
l_int32 ph,
l_int32 pd 
)

pixGetDimensions()

Input: pix &w, &h, &d (<optional return>="">; each can be null) Return: 0 if OK, 1 on error

Definition at line 898 of file pix1.c.

References Pix::d, ERROR_INT, Pix::h, PROCNAME, and Pix::w.

Referenced by AdaptiveGrayBlend(), BoxaSortTest(), ColorBlend(), dewarpCreate(), extractJpegHeaderDataFallback(), findTilePatchCenter(), GrayBlend(), identifyWatershedBasin(), jbWordsInTextlines(), kernelCreateFromPix(), localSearchForBackground(), main(), make_24_bpp_pix(), makeGrayQuantColormapArb(), nextOnPixelInRaster(), octreeGenerateAndPrune(), pixAbsDifference(), pixaccCreateWithPix(), pixaccMultConstAccumulate(), pixAccumulate(), pixacompDisplayTiledAndScaled(), pixaCreateFromBoxa(), pixaCreateFromPix(), pixAddBorderGeneral(), pixAddConstantGray(), pixAddGray(), pixAddMinimalGrayColormap8(), pixAddMirroredBorder(), pixAddMixedBorder(), pixAddRepeatedBorder(), pixAddSingleTextblock(), pixaDisplayOnLattice(), pixaDisplayTiled(), pixaDisplayTiledAndScaled(), pixaDisplayTiledInRows(), pixaExtractColumnFromEachPix(), pixAffineColor(), pixAffineGray(), pixAffinePtaWithAlpha(), pixAffineSampled(), pixaFindDimensions(), pixaFindWidthHeightProduct(), pixaFindWidthHeightRatio(), pixaGetPixDimensions(), pixApplyHorizontalDisparity(), pixApplyInvBackgroundGrayMap(), pixApplyLocalThreshold(), pixApplyVariableGrayMap(), pixApplyVerticalDisparity(), pixaSplitPix(), pixAverageIntensityProfile(), pixAverageOnLine(), pixAverageRasterScans(), pixBilinearColor(), pixBilinearGray(), pixBilinearPtaWithAlpha(), pixBilinearSampled(), pixBlend(), pixBlendCmap(), pixBlendColor(), pixBlendColorByChannel(), pixBlendGray(), pixBlendGrayAdapt(), pixBlendHardLight(), pixBlendInRect(), pixBlendMask(), pixBlendWithGrayMask(), pixBlockconv(), pixBlockconvAccum(), pixBlockconvGray(), pixBlockconvGrayTile(), pixBlockconvGrayUnnormalized(), pixBlockconvTiled(), pixBlockrank(), pixBlocksum(), pixCensusTransform(), pixCentroid(), pixClearPixel(), pixClipBoxToEdges(), pixClipBoxToForeground(), pixClipMasked(), pixClipRectangle(), pixClipToForeground(), pixCloseGray(), pixColorContent(), pixColorFraction(), pixColorGray(), pixColorGrayCmap(), pixColorizeGray(), pixColorMagnitude(), pixColorsForQuantization(), pixColumnStats(), pixCombineMasked(), pixCombineMaskedGeneral(), pixCompareBinary(), pixCompareTiled(), pixcompCreateFromPix(), pixConformsToRectangle(), pixConvert16To8(), pixConvert1To2(), pixConvert1To32(), pixConvert1To4(), pixConvert1To8(), pixConvert24To32(), pixConvert2To8(), pixConvert32To24(), pixConvert4To8(), pixConvert8To16(), pixConvert8To32(), pixConvertColorToSubpixelRGB(), pixConvertGrayToColormap8(), pixConvertGrayToSubpixelRGB(), pixConvertHSVToRGB(), pixConvertLossless(), pixConvertRGBToGray(), pixConvertRGBToGrayFast(), pixConvertRGBToGrayMinMax(), pixConvertRGBToHSV(), pixConvertRGBToHue(), pixConvertRGBToSaturation(), pixConvertRGBToValue(), pixConvertRGBToYUV(), pixConvertToFPix(), pixConvertYUVToRGB(), pixConvolve(), pixCopyBorder(), pixCorrelationScore(), pixCorrelationScoreSimple(), pixCorrelationScoreThresholded(), pixCountPixels(), pixCountPixelsByColumn(), pixCountPixelsInRow(), pixCreateFromPixcomp(), pixCreateRGBImage(), pixCreateTemplateNoInit(), pixDilate(), pixDilateGray(), pixDilateGray3h(), pixDilateGray3v(), pixDisplayDiffBinary(), pixDisplayWithTitle(), pixDistanceFunction(), pixDitherOctindexWithCmap(), pixDitherTo2bppSpec(), pixDitherToBinaryLUT(), pixDitherToBinarySpec(), pixEmbedForRotation(), pixEqual(), pixErode(), pixErodeGray(), pixErodeGray3h(), pixErodeGray3v(), pixExpandBinaryPower2(), pixExpandBinaryReplicate(), pixExpandReplicate(), pixExtendByReplication(), pixExtractOnLine(), pixFadeWithGray(), pixFewColorsOctcubeQuant1(), pixFewColorsOctcubeQuant2(), pixFewColorsOctcubeQuantMixed(), pixFillMapHoles(), pixFinalAccumulate(), pixFinalAccumulateThreshold(), pixFindAreaFraction(), pixFindEqualValues(), pixFindHorizontalRuns(), pixFindLargestRectangle(), pixFindNormalizedSquareSum(), pixFindOverlapFraction(), pixFindPerimSizeRatio(), pixFindRectangleComps(), pixFindVerticalRuns(), pixFixedOctcubeQuant256(), pixFixedOctcubeQuantGenRGB(), pixFlipLR(), pixFlipPixel(), pixFlipTB(), pixGenerateFlateData(), pixGenerateMaskByBand(), pixGenerateMaskByBand32(), pixGenerateMaskByDiscr32(), pixGenerateMaskByValue(), pixGetAverageMasked(), pixGetAverageTiled(), pixGetBinnedColor(), pixGetCmapHistogram(), pixGetCmapHistogramMasked(), pixGetColorHistogram(), pixGetColorHistogramMasked(), pixGetColorRegion(), pixGetColumnStats(), pixGetDifferenceHistogram(), pixGetEdgeProfile(), pixGetExtremeValue(), pixGetGrayHistogram(), pixGetGrayHistogramMasked(), pixGetInvBackgroundMap(), pixGetLastOffPixelInRun(), pixGetLastOnPixelInRun(), pixGetMaxValueInRect(), pixGetMeanVerticals(), pixGetPixel(), pixGetPSNR(), pixGetRandomPixel(), pixGetRasterData(), pixGetRegionsBinary(), pixGetRGBComponent(), pixGetRGBComponentCmap(), pixGetRGBLine(), pixGetRGBPixel(), pixGetRowStats(), pixGetTextlineCenters(), pixGlobalNormRGB(), pixGrayQuantFromCmap(), pixGrayQuantFromHisto(), pixHMT(), pixHShear(), pixHShearIP(), pixHShearLI(), pixInterlaceGIF(), pixLinearMapToTargetColor(), pixLinearTRCTiled(), pixMakeHistoHS(), pixMakeHistoHV(), pixMakeHistoSV(), pixMakeMaskFromLUT(), pixMakeRangeMaskHS(), pixMakeRangeMaskHV(), pixMakeRangeMaskSV(), pixMaskedThreshOnBackgroundNorm(), pixMaskOverColorPixels(), pixMaxDynamicRange(), pixMeanInRectangle(), pixMeanSquareAccum(), pixMeasureSaturation(), pixMedianCutHisto(), pixMedianCutQuantGeneral(), pixMedianCutQuantMixed(), pixMinMaxTiles(), pixMinOrMax(), pixMirroredTiling(), pixModifyHue(), pixModifySaturation(), pixMultConstAccumulate(), pixMultConstantColor(), pixMultConstantGray(), pixMultMatrixColor(), pixNumberOccupiedOctcubes(), pixNumColors(), pixNumSignificantGrayColors(), pixOctcubeHistogram(), pixOctcubeQuantFromCmapLUT(), pixOctcubeQuantMixedWithGray(), pixOctreeColorQuantGeneral(), pixOctreeQuantByPopulation(), pixOctreeQuantizePixels(), pixOctreeQuantNumColors(), pixOpenGray(), pixOtsuAdaptiveThreshold(), pixOtsuThreshOnBackgroundNorm(), pixPaintSelfThroughMask(), pixPaintThroughMask(), pixProjectiveColor(), pixProjectiveGray(), pixProjectivePtaWithAlpha(), pixProjectiveSampled(), pixQuadraticVShear(), pixQuadraticVShearLI(), pixQuadraticVShearSampled(), pixQuadtreeMean(), pixQuadtreeVariance(), pixQualifyLocalMinima(), pixQuantizeWithColormap(), pixRandomHarmonicWarp(), pixRankColumnTransform(), pixRankFilterGray(), pixRankRowTransform(), pixRasteropHip(), pixRasteropIP(), pixRasteropVip(), pixReadHeader(), pixReadHeaderMem(), pixRemoveBorderGeneral(), pixRemoveColormap(), pixRemoveUnusedColors(), pixRenderContours(), pixRenderPta(), pixRenderPtaArb(), pixRenderPtaBlend(), pixResizeImageData(), pixResizeToMatch(), pixReversalProfile(), pixRotate(), pixRotateAMColor(), pixRotateAMColorCorner(), pixRotateAMColorFast(), pixRotateAMGray(), pixRotateAMGrayCorner(), pixRotateBySampling(), pixRotateWithAlpha(), pixRowStats(), pixRunlengthTransform(), pixSauvolaBinarize(), pixSauvolaBinarizeTiled(), pixSauvolaGetThreshold(), pixSaveTiledOutline(), pixScaleAreaMap(), pixScaleBinary(), pixScaleBySampling(), pixScaleColor2xLI(), pixScaleColorLI(), pixScaleGray2xLI(), pixScaleGray2xLIDither(), pixScaleGray2xLIThresh(), pixScaleGray4xLI(), pixScaleGray4xLIDither(), pixScaleGray4xLIThresh(), pixScaleGrayLI(), pixScaleGrayMinMax(), pixScaleGrayMinMax2(), pixScaleGrayRank2(), pixScaleGrayToBinaryFast(), pixScaleMipmap(), pixScaleRGBToBinaryFast(), pixScaleRGBToGrayFast(), pixScaleSmooth(), pixScaleToGray(), pixScaleToGray16(), pixScaleToGray2(), pixScaleToGray3(), pixScaleToGray4(), pixScaleToGray6(), pixScaleToGray8(), pixScaleToGrayFast(), pixScaleToGrayMipmap(), pixScaleToSize(), pixScaleWithAlpha(), pixScanForEdge(), pixScanForForeground(), pixSearchBinaryMaze(), pixSearchGrayMaze(), pixSeedfill4(), pixSeedfill4BB(), pixSeedfill8(), pixSeedfill8BB(), pixSeedfillBinaryRestricted(), pixSeedfillGray(), pixSeedfillGrayInv(), pixSeedfillGrayInvSimple(), pixSeedfillGraySimple(), pixSeedspread(), pixSelectByAreaFraction(), pixSelectByAreaPerimRatio(), pixSelectBySize(), pixSelectByWidthHeightRatio(), pixSelectMinInConnComp(), pixSerializeToMemory(), pixSetAllArbitrary(), pixSetBorderRingVal(), pixSetBorderVal(), pixSetInRectArbitrary(), pixSetLowContrast(), pixSetMasked(), pixSetMaskedCmap(), pixSetMaskedGeneral(), pixSetMirroredBorder(), pixSetOrClearBorder(), pixSetPadBits(), pixSetPadBitsBand(), pixSetPixel(), pixSetPixelColumn(), pixSetRGBComponent(), pixSetRGBPixel(), pixSetSelectCmap(), pixSetTextblock(), pixSetupByteProcessing(), pixSnapColor(), pixSobelEdgeFilter(), pixSplitComponentIntoBoxa(), pixStereoFromPair(), pixStretchHorizontalLI(), pixStretchHorizontalSampled(), pixSubtract(), pixSubtractGray(), pixSumPixelsByColumn(), pixSumPixelsByRow(), pixSumPixelValues(), PixTest1(), PixTest2(), pixThresholdGrayArb(), pixThresholdOn8bpp(), pixThresholdPixelSum(), pixThresholdTo2bpp(), pixThresholdTo4bpp(), pixThresholdToBinary(), pixThresholdToValue(), pixTilingCreate(), pixTilingGetTile(), pixTilingPaintTile(), pixTRCMap(), pixTwoSidedEdgeFilter(), pixUnsharpMaskingGray(), pixUnsharpMaskingGray1D(), pixUnsharpMaskingGray2D(), pixVarianceInRectangle(), pixVarThresholdToBinary(), pixVShear(), pixVShearIP(), pixVShearLI(), pixWarpStereoscopic(), pixWindowedMean(), pixWindowedMeanSquare(), pixWindowedVariance(), pixWriteStreamAsciiPnm(), pixWriteStreamGif(), pixWriteStreamJpeg(), pixWriteStreamPnm(), pixWriteStreamWebP(), pixWriteStringPS(), pixWriteToTiffStream(), pixWriteWebPwithTargetPSNR(), ptaaGetBoundaryPixels(), ptaaRemoveShortLines(), ptaGetPixelsFromPix(), regTestCompareSimilarPix(), rotateTest(), RotateTest(), selaDisplayInPix(), selCreateFromColorPix(), selCreateFromPix(), selectDefaultPdfEncoding(), shearTest(), TestImage(), wshedApply(), wshedCreate(), and wshedRenderColors().

l_int32 pixSetDimensions ( PIX pix,
l_int32  w,
l_int32  h,
l_int32  d 
)

pixSetDimensions()

Input: pix w, h, d (use 0 to skip the setting for any of these) Return: 0 if OK, 1 on error

Definition at line 925 of file pix1.c.

References ERROR_INT, pixSetDepth(), pixSetHeight(), pixSetWidth(), and PROCNAME.

l_int32 pixCopyDimensions ( PIX pixd,
PIX pixs 
)

pixCopyDimensions()

Input: pixd pixd Return: 0 if OK, 1 on error

Definition at line 949 of file pix1.c.

References ERROR_INT, pixGetDepth(), pixGetHeight(), pixGetWidth(), pixGetWpl(), pixSetDepth(), pixSetHeight(), pixSetWidth(), pixSetWpl(), and PROCNAME.

Referenced by pixTransferAllData().

l_int32 pixGetWpl ( PIX pix)

Definition at line 970 of file pix1.c.

References ERROR_INT, PROCNAME, UNDEF, and Pix::wpl.

Referenced by AddTransformsRGB(), AddTransformsYUV(), fpixConvertToPix(), fpixDisplayMaxDynamicRange(), fpixRenderContours(), jbClassifyCorrelation(), main(), make_24_bpp_pix(), MakeColorWash(), makeGrayQuantColormapArb(), MakeGrayWash(), nextOnPixelInRaster(), octreeGenerateAndPrune(), pixAbsDifference(), pixAccumulate(), pixAddConstantGray(), pixAddGray(), pixAddMinimalGrayColormap8(), pixaExtractColumnFromEachPix(), pixAffineColor(), pixAffineGray(), pixAffineSampled(), pixApplyHorizontalDisparity(), pixApplyInvBackgroundGrayMap(), pixApplyInvBackgroundRGBMap(), pixApplyLocalThreshold(), pixApplyVariableGrayMap(), pixApplyVerticalDisparity(), pixAssignToNearestColor(), pixAverageOnLine(), pixAverageRasterScans(), pixBilinearColor(), pixBilinearGray(), pixBilinearSampled(), pixBlendCmap(), pixBlendColor(), pixBlendColorByChannel(), pixBlendGray(), pixBlendGrayAdapt(), pixBlendHardLight(), pixBlendInRect(), pixBlendMask(), pixBlendWithGrayMask(), pixBlockconvAccum(), pixBlockconvGray(), pixBlockconvGrayTile(), pixBlockconvGrayUnnormalized(), pixBlocksum(), pixCensusTransform(), pixCentroid(), pixClearPixel(), pixClipToForeground(), pixCloseGray(), pixColorContent(), pixColorFraction(), pixColorGray(), pixColorGrayCmap(), pixColorizeGray(), pixColorMagnitude(), pixColorSegmentTryCluster(), pixColumnStats(), pixCombineMasked(), pixCombineMaskedGeneral(), pixConvert16To8(), pixConvert1To16(), pixConvert1To2(), pixConvert1To32(), pixConvert1To4(), pixConvert1To8(), pixConvert24To32(), pixConvert2To8(), pixConvert32To24(), pixConvert4To8(), pixConvert8To16(), pixConvert8To32(), pixConvertColorToSubpixelRGB(), pixConvertGrayToColormap8(), pixConvertGrayToSubpixelRGB(), pixConvertHSVToRGB(), pixConvertLossless(), pixConvertRGBToGray(), pixConvertRGBToGrayFast(), pixConvertRGBToGrayMinMax(), pixConvertRGBToHSV(), pixConvertRGBToHue(), pixConvertRGBToSaturation(), pixConvertRGBToValue(), pixConvertRGBToYUV(), pixConvertToFPix(), pixConvertYUVToRGB(), pixConvolve(), pixCopy(), pixCopyDimensions(), pixCorrelationScore(), pixCorrelationScoreThresholded(), pixCountPixels(), pixCountPixelsByColumn(), pixCountPixelsInRow(), pixCreateNoInit(), pixDilateGray(), pixDilateGray3h(), pixDilateGray3v(), pixDistanceFunction(), pixDitherOctindexWithCmap(), pixDitherTo2bppSpec(), pixDitherToBinaryLUT(), pixDitherToBinarySpec(), pixEndianByteSwap(), pixEndianByteSwapNew(), pixEndianTwoByteSwap(), pixEndianTwoByteSwapNew(), pixEqual(), pixEqualWithCmap(), pixErodeGray(), pixErodeGray3h(), pixErodeGray3v(), pixExpandBinaryPower2(), pixExpandBinaryReplicate(), pixExpandReplicate(), pixExtractData(), pixFadeWithGray(), pixFewColorsOctcubeQuant1(), pixFewColorsOctcubeQuant2(), pixFewColorsOctcubeQuantMixed(), pixFHMTGen_1(), pixFinalAccumulate(), pixFinalAccumulateThreshold(), pixFindCornerPixels(), pixFindEqualValues(), pixFindHorizontalRuns(), pixFindLargestRectangle(), pixFindVerticalRuns(), pixFixedOctcubeQuant256(), pixFixedOctcubeQuantGenRGB(), pixFlipFHMTGen(), pixFlipLR(), pixFlipPixel(), pixFlipTB(), pixFMorphopGen_1(), pixFMorphopGen_2(), pixFMorphopGen_3(), pixGenerateMaskByBand(), pixGenerateMaskByBand32(), pixGenerateMaskByDiscr32(), pixGenerateMaskByValue(), pixGetAverageMasked(), pixGetAverageTiled(), pixGetBackgroundGrayMap(), pixGetBackgroundRGBMap(), pixGetBinnedColor(), pixGetCmapHistogram(), pixGetCmapHistogramMasked(), pixGetColorHistogram(), pixGetColorHistogramMasked(), pixGetColorRegion(), pixGetColumnStats(), pixGetDifferenceHistogram(), pixGetExtremeValue(), pixGetGrayHistogram(), pixGetGrayHistogramMasked(), pixGetHoleBorder(), pixGetInvBackgroundMap(), pixGetLinePtrs(), pixGetMaxValueInRect(), pixGetMeanVerticals(), pixGetOuterBorder(), pixGetPixel(), pixGetPSNR(), pixGetRasterData(), pixGetRGBComponent(), pixGetRGBComponentCmap(), pixGetRGBLine(), pixGetRGBPixel(), pixGetRowStats(), pixGlobalNormRGB(), pixGrayQuantFromCmap(), pixGrayQuantFromHisto(), pixHShearLI(), pixInterlaceGIF(), pixLinearMapToTargetColor(), pixLinearTRCTiled(), pixMakeHistoHS(), pixMakeHistoHV(), pixMakeHistoSV(), pixMakeMaskFromLUT(), pixMakeRangeMaskHS(), pixMakeRangeMaskHV(), pixMakeRangeMaskSV(), pixMaskOverColorPixels(), pixMaxDynamicRange(), pixMeanSquareAccum(), pixMeasureSaturation(), pixMedianCutHisto(), pixMedianCutQuantMixed(), pixMinOrMax(), pixModifyHue(), pixModifySaturation(), pixMultConstAccumulate(), pixMultConstantColor(), pixMultConstantGray(), pixMultMatrixColor(), pixNumberOccupiedOctcubes(), pixNumColors(), pixOctcubeHistogram(), pixOctcubeQuantFromCmapLUT(), pixOctcubeQuantMixedWithGray(), pixOctreeQuantByPopulation(), pixOctreeQuantizePixels(), pixOctreeQuantNumColors(), pixOpenGray(), pixPaintThroughMask(), pixPrintStreamInfo(), pixProjectiveColor(), pixProjectiveGray(), pixProjectiveSampled(), pixQuadraticVShearLI(), pixQuadraticVShearSampled(), pixQualifyLocalMinima(), pixQuantizeWithColormap(), pixRandomHarmonicWarp(), pixRankColumnTransform(), pixRankFilterGray(), pixRankRowTransform(), pixRasterop(), pixRasteropHip(), pixRasteropVip(), pixReadFromTiffStream(), pixReadStreamBmp(), pixReadStreamGif(), pixReadStreamJpeg(), pixReadStreamPng(), pixReadStreamPnm(), pixReadStreamWebP(), pixReduceBinary2(), pixReduceRankBinary2(), pixRemoveColormap(), pixRemoveUnusedColors(), pixRenderContours(), pixResizeImageData(), pixRotate90(), pixRotateAMColor(), pixRotateAMColorCorner(), pixRotateAMColorFast(), pixRotateAMColorFast2(), pixRotateAMGray(), pixRotateAMGrayCorner(), pixRotateBySampling(), pixRowStats(), pixRunlengthTransform(), pixSauvolaGetThreshold(), pixScaleAreaMap(), pixScaleAreaMap2(), pixScaleBinary(), pixScaleBySampling(), pixScaleColor2xLI(), pixScaleColorLI(), pixScaleGray2xLI(), pixScaleGray2xLIDither(), pixScaleGray2xLIThresh(), pixScaleGray4xLI(), pixScaleGray4xLIDither(), pixScaleGray4xLIThresh(), pixScaleGrayLI(), pixScaleGrayMinMax(), pixScaleGrayMinMax2(), pixScaleGrayRank2(), pixScaleGrayToBinaryFast(), pixScaleMipmap(), pixScaleRGBToBinaryFast(), pixScaleRGBToGray2(), pixScaleRGBToGrayFast(), pixScaleSmooth(), pixScaleToGray16(), pixScaleToGray2(), pixScaleToGray3(), pixScaleToGray4(), pixScaleToGray6(), pixScaleToGray8(), pixScanForEdge(), pixScanForForeground(), pixSeedfill4(), pixSeedfill4BB(), pixSeedfill8(), pixSeedfill8BB(), pixSeedfillBinary(), pixSeedfillGray(), pixSeedfillGrayInv(), pixSeedfillGrayInvSimple(), pixSeedfillGraySimple(), pixSeedspread(), pixSelectMinInConnComp(), pixSerializeToMemory(), pixSetAllArbitrary(), pixSetBorderVal(), pixSetInRectArbitrary(), pixSetLowContrast(), pixSetMasked(), pixSetMaskedCmap(), pixSetPadBits(), pixSetPadBitsBand(), pixSetPixel(), pixSetPixelColumn(), pixSetRGBComponent(), pixSetRGBPixel(), pixSetSelectCmap(), pixSetSelectMaskedCmap(), pixShiftRGB258(), pixSnapColor(), pixSobelEdgeFilter(), pixStereoFromPair(), pixStretchHorizontalLI(), pixStretchHorizontalSampled(), pixSubtractGray(), pixSumPixelsByColumn(), pixSumPixelsByRow(), pixSumPixelValues(), pixThresholdGrayArb(), pixThresholdOn8bpp(), pixThresholdPixelSum(), pixThresholdTo2bpp(), pixThresholdTo4bpp(), pixThresholdToBinary(), pixThresholdToValue(), pixTransferAllData(), pixTRCMap(), pixTwoSidedEdgeFilter(), pixUnsharpMaskingGray1D(), pixUnsharpMaskingGray2D(), pixVarThresholdToBinary(), pixVShearLI(), pixWindowedMean(), pixWindowedMeanSquare(), pixWindowedVariance(), pixWriteStreamBmp(), pixWriteStreamGif(), pixWriteStreamJpeg(), pixWriteStreamPng(), pixWriteStreamPnm(), pixWriteStreamWebP(), pixWriteStringPS(), pixWriteToTiffStream(), pixWriteWebPwithTargetPSNR(), pixZero(), and ptaGetPixelsFromPix().

l_int32 pixSetWpl ( PIX pix,
l_int32  wpl 
)

Definition at line 981 of file pix1.c.

References ERROR_INT, PROCNAME, and Pix::wpl.

Referenced by pixCopyDimensions(), pixCreateHeader(), and pixResizeImageData().

l_int32 pixGetRefcount ( PIX pix)

Definition at line 995 of file pix1.c.

References ERROR_INT, PROCNAME, Pix::refcount, and UNDEF.

Referenced by pixExtractData(), pixFree(), pixPrintStreamInfo(), and pixTransferAllData().

l_int32 pixChangeRefcount ( PIX pix,
l_int32  delta 
)

Definition at line 1006 of file pix1.c.

References ERROR_INT, PROCNAME, and Pix::refcount.

Referenced by pixClone(), and pixFree().

l_int32 pixSetXRes ( PIX pix,
l_int32  res 
)
l_int32 pixGetYRes ( PIX pix)
l_int32 pixSetYRes ( PIX pix,
l_int32  res 
)
l_int32 pixGetResolution ( PIX pix,
l_int32 pxres,
l_int32 pyres 
)

pixGetResolution()

Input: pix &xres, &yres (<optional return>="">; each can be null) Return: 0 if OK, 1 on error

Definition at line 1077 of file pix1.c.

References ERROR_INT, PROCNAME, Pix::xres, and Pix::yres.

Referenced by pixcompCreateFromPix().

l_int32 pixSetResolution ( PIX pix,
l_int32  xres,
l_int32  yres 
)

pixSetResolution()

Input: pix xres, yres (use 0 to skip the setting for either of these) Return: 0 if OK, 1 on error

Definition at line 1099 of file pix1.c.

References ERROR_INT, PROCNAME, Pix::xres, and Pix::yres.

Referenced by GetImageMask(), main(), and pixCreateFromPixcomp().

l_int32 pixCopyResolution ( PIX pixd,
PIX pixs 
)

Definition at line 1114 of file pix1.c.

References ERROR_INT, pixGetXRes(), pixGetYRes(), pixSetXRes(), pixSetYRes(), and PROCNAME.

Referenced by pixAbsDifference(), pixAddBorderGeneral(), pixAddMinimalGrayColormap8(), pixBlocksum(), pixClipRectangle(), pixColorizeGray(), pixColorSegmentCluster(), pixConvert16To8(), pixConvert1To16(), pixConvert1To2(), pixConvert1To32(), pixConvert1To4(), pixConvert1To8(), pixConvert24To32(), pixConvert2To8(), pixConvert32To24(), pixConvert4To8(), pixConvert8To32(), pixConvertGrayToColormap8(), pixConvertGrayToFalseColor(), pixConvertLossless(), pixConvertRGBToGray(), pixConvertRGBToGrayFast(), pixConvertRGBToGrayMinMax(), pixConvertRGBToHue(), pixConvertRGBToSaturation(), pixConvertRGBToValue(), pixCopy(), pixCreateRGBImage(), pixCreateTemplateNoInit(), pixDitherTo2bppSpec(), pixDitherToBinaryLUT(), pixDitherToBinarySpec(), pixEmbedForRotation(), pixExpandBinaryPower2(), pixExpandBinaryReplicate(), pixExpandReplicate(), pixFewColorsOctcubeQuant1(), pixFewColorsOctcubeQuant2(), pixFinalAccumulate(), pixFinalAccumulateThreshold(), pixFixedOctcubeQuant256(), pixFixedOctcubeQuantGenRGB(), pixGenerateMaskByBand(), pixGenerateMaskByBand32(), pixGenerateMaskByDiscr32(), pixGenerateMaskByValue(), pixGetRGBComponent(), pixGetRGBComponentCmap(), pixGrayQuantFromCmap(), pixMaxDynamicRange(), pixOctcubeQuantFromCmapLUT(), pixOctcubeQuantMixedWithGray(), pixOctreeColorQuantGeneral(), pixOctreeQuantByPopulation(), pixOctreeQuantizePixels(), pixOctreeQuantNumColors(), pixQuantizeWithColormap(), pixReduceBinary2(), pixReduceRankBinary2(), pixRemoveBorderGeneral(), pixRemoveColormap(), pixRenderContours(), pixResizeToMatch(), pixRotate90(), pixScaleAreaMap(), pixScaleAreaMap2(), pixScaleBinary(), pixScaleBySampling(), pixScaleColor2xLI(), pixScaleColorLI(), pixScaleGray2xLI(), pixScaleGray2xLIDither(), pixScaleGray2xLIThresh(), pixScaleGray4xLI(), pixScaleGray4xLIDither(), pixScaleGray4xLIThresh(), pixScaleGrayLI(), pixScaleGrayToBinaryFast(), pixScaleMipmap(), pixScaleRGBToBinaryFast(), pixScaleRGBToGray2(), pixScaleRGBToGrayFast(), pixScaleSmooth(), pixScaleToGray16(), pixScaleToGray2(), pixScaleToGray3(), pixScaleToGray4(), pixScaleToGray6(), pixScaleToGray8(), pixSelectByAreaFraction(), pixSelectByAreaPerimRatio(), pixSelectBySize(), pixSelectByWidthHeightRatio(), pixThresholdGrayArb(), pixThresholdTo2bpp(), pixThresholdTo4bpp(), pixThresholdToBinary(), and pixTransferAllData().

l_int32 pixSetInputFormat ( PIX pix,
l_int32  informat 
)
char* pixGetText ( PIX pix)

pixGetText()

Input: pix Return: ptr to existing text string

Notes: (1) The text string belongs to the pix. The caller must NOT free it!

Definition at line 1204 of file pix1.c.

References ERROR_PTR, NULL, PROCNAME, and Pix::text.

Referenced by main(), pixAddSingleTextblock(), pixAddText(), pixcompCreateFromPix(), pixCopyText(), pixFree(), pixTransferAllData(), pixWriteStreamGif(), pixWriteStreamJpeg(), pixWriteStreamPng(), and pixWriteToTiffStream().

l_int32 pixSetText ( PIX pix,
const char *  textstring 
)

pixSetText()

Input: pix textstring (can be null) Return: 0 if OK, 1 on error

Notes: (1) This removes any existing textstring and puts a copy of the input textstring there.

Definition at line 1226 of file pix1.c.

References ERROR_INT, PROCNAME, stringReplace(), and Pix::text.

Referenced by main(), pixCopyText(), pixCreateFromPixcomp(), pixReadStreamJpeg(), pixReadStreamPng(), and pixTransferAllData().

l_int32 pixAddText ( PIX pix,
const char *  textstring 
)

pixAddText()

Input: pix textstring Return: 0 if OK, 1 on error

Notes: (1) This adds the new textstring to any existing text. (2) Either or both the existing text and the new text string can be null.

Definition at line 1252 of file pix1.c.

References ERROR_INT, FREE, pixGetText(), PROCNAME, stringJoin(), stringReplace(), and Pix::text.

PIXCMAP* pixGetColormap ( PIX pix)

Definition at line 1288 of file pix1.c.

References Pix::colormap, ERROR_PTR, NULL, and PROCNAME.

Referenced by convertToPSEmbed(), DoPageSegmentation(), ioFormatTest(), main(), pixaAnyColormaps(), pixacompAddPix(), pixAddBlackBorder(), pixAddGrayColormap8(), pixAddMinimalGrayColormap8(), pixAddSingleTextblock(), pixAffinePtaWithAlpha(), pixAffineSampled(), pixApplyInvBackgroundGrayMap(), pixApplyLocalThreshold(), pixAssignToNearestColor(), pixAverageIntensityProfile(), pixAverageOnLine(), pixaWriteCompressedToPS(), pixBackgroundNormFlex(), pixBackgroundNormGrayArray(), pixBilinearPtaWithAlpha(), pixBilinearSampled(), pixBlendCmap(), pixBlendGray(), pixBlendGrayAdapt(), pixBlendHardLight(), pixBlendMask(), pixBlendWithGrayMask(), pixBlockconv(), pixBlockconvTiled(), pixClipMasked(), pixCloseGray3(), pixColorContent(), pixColorGray(), pixColorGrayCmap(), pixColorizeGray(), pixColorMagnitude(), pixColorSegmentClean(), pixColorSegmentRemoveColors(), pixColorSegmentTryCluster(), pixColorsForQuantization(), pixCombineMasked(), pixCombineMaskedGeneral(), pixCompareGray(), pixCompareGrayOrRGB(), pixcompCreateFromPix(), pixContrastNorm(), pixContrastTRC(), pixContrastTRCMasked(), pixConvert2To8(), pixConvert4To8(), pixConvert8To16(), pixConvert8To32(), pixConvertColorToSubpixelRGB(), pixConvertForPSWrap(), pixConvertGrayToColormap(), pixConvertGrayToColormap8(), pixConvertGrayToFalseColor(), pixConvertGrayToSubpixelRGB(), pixConvertHSVToRGB(), pixConvertLossless(), pixConvertRGBToHSV(), pixConvertRGBToHue(), pixConvertRGBToSaturation(), pixConvertRGBToValue(), pixConvertRGBToYUV(), pixConvertTo1(), pixConvertTo8(), pixConvertTo8Or32(), pixConvertToFPix(), pixConvertToPdfData(), pixConvertToPdfDataSegmented(), pixConvertToSubpixelRGB(), pixConvertYUVToRGB(), pixConvolve(), pixCopyColormap(), pixCreateFromPixcomp(), pixDilateGray3(), pixDisplayWriteFormat(), pixDitherOctindexWithCmap(), pixDrawBoxa(), pixEqual(), pixEqualizeTRC(), pixEqualWithCmap(), pixErodeGray3(), pixExtractBarcodes(), pixExtractOnLine(), pixFadeWithGray(), pixFewColorsOctcubeQuantMixed(), pixFillMapHoles(), pixGammaTRC(), pixGammaTRCMasked(), pixGenerateFlateData(), pixGenerateJpegData(), pixGenerateMaskByBand(), pixGenerateMaskByValue(), pixGetAverageMasked(), pixGetAverageMaskedRGB(), pixGetAverageTiled(), pixGetAverageTiledRGB(), pixGetBackgroundGrayMap(), pixGetBackgroundGrayMapMorph(), pixGetCmapHistogram(), pixGetCmapHistogramMasked(), pixGetColorHistogram(), pixGetColorHistogramMasked(), pixGetComponentRange(), pixGetDifferenceHistogram(), pixGetEdgeProfile(), pixGetExtremeValue(), pixGetGrayHistogram(), pixGetGrayHistogramMasked(), pixGetInvBackgroundMap(), pixGetMaxValueInRect(), pixGetPSNR(), pixGetRandomPixel(), pixGetRankColorArray(), pixGetRankValueMasked(), pixGetRegionsBinary(), pixGetRGBComponentCmap(), pixGlobalNormRGB(), pixGrayQuantFromCmap(), pixGrayQuantFromHisto(), pixHShear(), pixHShearIP(), pixHShearLI(), pixLinearTRCTiled(), pixLocateBarcodes(), pixMaskBoxa(), pixMaskedThreshOnBackgroundNorm(), pixMaskOverColorPixels(), pixMedianCutQuantMixed(), pixMinMaxTiles(), pixModifyHue(), pixMultConstantColor(), pixMultMatrixColor(), pixNumColors(), pixOpenGray3(), pixOtsuThreshOnBackgroundNorm(), pixPaintBoxa(), pixPaintSelfThroughMask(), pixPaintThroughMask(), pixPrintStreamInfo(), pixProcessBarcodes(), pixProjectivePtaWithAlpha(), pixProjectiveSampled(), pixQuadraticVShearLI(), pixQuantizeIfFewColors(), pixRankColumnTransform(), pixRankFilter(), pixRankFilterGray(), pixRankRowTransform(), pixRasteropHip(), pixRasteropVip(), pixRemoveColormap(), pixRemoveUnusedColors(), pixRenderContours(), pixRenderPtaArb(), pixReversalProfile(), pixRotate(), pixRotateShearIP(), pixRotateWithAlpha(), pixSauvolaBinarize(), pixSauvolaBinarizeTiled(), pixSauvolaGetThreshold(), pixScaleAreaMap(), pixScaleAreaMap2(), pixScaleGray2xLI(), pixScaleGray2xLIDither(), pixScaleGray2xLIThresh(), pixScaleGray4xLI(), pixScaleGray4xLIDither(), pixScaleGray4xLIThresh(), pixScaleGrayLI(), pixScaleMipmap(), pixScaleSmooth(), pixScaleWithAlpha(), pixSerializeToMemory(), pixSetAll(), pixSetAllArbitrary(), pixSetBlackOrWhite(), pixSetBlackOrWhiteBoxa(), pixSetInRect(), pixSetInRectArbitrary(), pixSetMasked(), pixSetMaskedCmap(), pixSetSelectCmap(), pixSetSelectMaskedCmap(), pixSetTextblock(), pixSetTextline(), pixSetupByteProcessing(), pixSmoothConnectedRegions(), pixSnapColor(), pixSnapColorCmap(), pixSumPixelsByColumn(), pixSumPixelsByRow(), pixSumPixelValues(), pixThresholdOn8bpp(), pixThresholdSpreadNorm(), pixThresholdToBinary(), pixTransferAllData(), pixTRCMap(), pixUnsharpMaskingGray(), pixUnsharpMaskingGray1D(), pixUnsharpMaskingGray2D(), pixUnsharpMaskingGrayFast(), pixUsesCmapColor(), pixVShear(), pixVShearIP(), pixVShearLI(), pixWriteStreamAsciiPnm(), pixWriteStreamBmp(), pixWriteStreamGif(), pixWriteStreamJpeg(), pixWriteStreamPdf(), pixWriteStreamPng(), pixWriteStreamPnm(), pixWriteToTiffStream(), pixZero(), RotateOrthTest(), rotateTest(), RotateTest(), selCreateFromColorPix(), selectDefaultPdfEncoding(), shearTest(), and writeMultipageTiffSA().

l_int32 pixSetColormap ( PIX pix,
PIXCMAP colormap 
)

pixSetColormap()

Input: pix colormap (to be assigned) Return: 0 if OK, 1 on error.

Notes: (1) Unlike with the pix data field, pixSetColormap() destroys any existing colormap before assigning the new one. Because colormaps are not ref counted, it is important that the new colormap does not belong to any other pix.

Definition at line 1312 of file pix1.c.

References Pix::colormap, ERROR_INT, pixDestroyColormap(), and PROCNAME.

Referenced by boxaaDisplay(), jbDataRender(), main(), pixAddGrayColormap8(), pixAddMinimalGrayColormap8(), pixAddSingleTextblock(), pixaDisplayRandomCmap(), pixBlendCmap(), pixColorizeGray(), pixColorSegmentCluster(), pixConvert1To2Cmap(), pixConvert1To4Cmap(), pixConvert2To8(), pixConvert4To8(), pixConvertGrayToColormap(), pixConvertGrayToColormap8(), pixConvertGrayToFalseColor(), pixConvertTo8(), pixCopyColormap(), pixDeserializeFromMemory(), pixDisplayDiffBinary(), pixDisplayHitMissSel(), pixDisplayMatchedPattern(), pixDitherTo2bppSpec(), pixFewColorsOctcubeQuant1(), pixFewColorsOctcubeQuant2(), pixFewColorsOctcubeQuantMixed(), pixFixedOctcubeQuant256(), pixGrayQuantFromCmap(), pixGrayQuantFromHisto(), pixOctcubeQuantFromCmapLUT(), pixOctcubeQuantMixedWithGray(), pixOctreeColorQuantGeneral(), pixOctreeQuantByPopulation(), pixOctreeQuantNumColors(), pixPaintBoxaRandom(), pixQuantizeWithColormap(), pixReadFromTiffStream(), pixReadStreamBmp(), pixReadStreamGif(), pixReadStreamJpeg(), pixReadStreamPng(), pixRemoveUnusedColors(), pixRenderRandomCmapPtaa(), pixThreshold8(), pixThresholdGrayArb(), pixThresholdOn8bpp(), pixThresholdTo2bpp(), pixThresholdTo4bpp(), pixTransferAllData(), and pixWriteStreamGif().

l_int32 pixDestroyColormap ( PIX pix)

pixDestroyColormap()

Input: pix Return: 0 if OK, 1 on error

Definition at line 1333 of file pix1.c.

References Pix::colormap, ERROR_INT, NULL, pixcmapDestroy(), and PROCNAME.

Referenced by pixConvertTo1(), pixCopyColormap(), pixFree(), pixRemoveColormap(), and pixSetColormap().

l_uint32* pixGetData ( PIX pix)

pixGetData()

Notes: (1) This gives a new handle for the data. The data is still owned by the pix, so do not call FREE() on it.

Definition at line 1358 of file pix1.c.

References Pix::data, ERROR_PTR, NULL, and PROCNAME.

Referenced by AddTransformsRGB(), AddTransformsYUV(), fpixConvertToPix(), fpixDisplayMaxDynamicRange(), fpixRenderContours(), jbClassifyCorrelation(), main(), make_24_bpp_pix(), MakeColorWash(), makeGrayQuantColormapArb(), MakeGrayWash(), nextOnPixelInRaster(), octreeGenerateAndPrune(), pixAbsDifference(), pixAccumulate(), pixAddConstantGray(), pixAddGray(), pixAddMinimalGrayColormap8(), pixaExtractColumnFromEachPix(), pixAffineColor(), pixAffineGray(), pixAffineSampled(), pixApplyHorizontalDisparity(), pixApplyInvBackgroundGrayMap(), pixApplyInvBackgroundRGBMap(), pixApplyLocalThreshold(), pixApplyVariableGrayMap(), pixApplyVerticalDisparity(), pixAssignToNearestColor(), pixAverageOnLine(), pixAverageRasterScans(), pixBilinearColor(), pixBilinearGray(), pixBilinearSampled(), pixBlendCmap(), pixBlendColor(), pixBlendColorByChannel(), pixBlendGray(), pixBlendGrayAdapt(), pixBlendHardLight(), pixBlendInRect(), pixBlendMask(), pixBlendWithGrayMask(), pixBlockconvAccum(), pixBlockconvGray(), pixBlockconvGrayTile(), pixBlockconvGrayUnnormalized(), pixBlocksum(), pixCensusTransform(), pixCentroid(), pixClearPixel(), pixClipToForeground(), pixCloseGray(), pixColorContent(), pixColorFraction(), pixColorGray(), pixColorGrayCmap(), pixColorizeGray(), pixColorMagnitude(), pixColorSegmentTryCluster(), pixColumnStats(), pixCombineMasked(), pixCombineMaskedGeneral(), pixConvert16To8(), pixConvert1To16(), pixConvert1To2(), pixConvert1To32(), pixConvert1To4(), pixConvert1To8(), pixConvert24To32(), pixConvert2To8(), pixConvert32To24(), pixConvert4To8(), pixConvert8To16(), pixConvert8To32(), pixConvertColorToSubpixelRGB(), pixConvertGrayToColormap8(), pixConvertGrayToSubpixelRGB(), pixConvertHSVToRGB(), pixConvertLossless(), pixConvertRGBToGray(), pixConvertRGBToGrayFast(), pixConvertRGBToGrayMinMax(), pixConvertRGBToHSV(), pixConvertRGBToHue(), pixConvertRGBToSaturation(), pixConvertRGBToValue(), pixConvertRGBToYUV(), pixConvertToFPix(), pixConvertYUVToRGB(), pixConvolve(), pixCopy(), pixCorrelationScore(), pixCorrelationScoreThresholded(), pixCountPixels(), pixCountPixelsByColumn(), pixCountPixelsInRow(), pixDeserializeFromMemory(), pixDilateGray(), pixDilateGray3h(), pixDilateGray3v(), pixDistanceFunction(), pixDitherOctindexWithCmap(), pixDitherTo2bppSpec(), pixDitherToBinaryLUT(), pixDitherToBinarySpec(), pixEndianByteSwap(), pixEndianByteSwapNew(), pixEndianTwoByteSwap(), pixEndianTwoByteSwapNew(), pixEqual(), pixEqualWithCmap(), pixErodeGray(), pixErodeGray3h(), pixErodeGray3v(), pixExpandBinaryPower2(), pixExpandBinaryReplicate(), pixExpandReplicate(), pixExtractData(), pixFadeWithGray(), pixFewColorsOctcubeQuant1(), pixFewColorsOctcubeQuant2(), pixFewColorsOctcubeQuantMixed(), pixFHMTGen_1(), pixFinalAccumulate(), pixFinalAccumulateThreshold(), pixFindCornerPixels(), pixFindEqualValues(), pixFindHorizontalRuns(), pixFindLargestRectangle(), pixFindVerticalRuns(), pixFixedOctcubeQuant256(), pixFixedOctcubeQuantGenRGB(), pixFlipFHMTGen(), pixFlipLR(), pixFlipPixel(), pixFlipTB(), pixFMorphopGen_1(), pixFMorphopGen_2(), pixFMorphopGen_3(), pixFree(), pixFreeData(), pixGenerateMaskByBand(), pixGenerateMaskByBand32(), pixGenerateMaskByDiscr32(), pixGenerateMaskByValue(), pixGetAverageMasked(), pixGetAverageTiled(), pixGetBackgroundGrayMap(), pixGetBackgroundRGBMap(), pixGetBinnedColor(), pixGetCmapHistogram(), pixGetCmapHistogramMasked(), pixGetColorHistogram(), pixGetColorHistogramMasked(), pixGetColorRegion(), pixGetColumnStats(), pixGetDifferenceHistogram(), pixGetExtremeValue(), pixGetGrayHistogram(), pixGetGrayHistogramMasked(), pixGetHoleBorder(), pixGetInvBackgroundMap(), pixGetLinePtrs(), pixGetMaxValueInRect(), pixGetMeanVerticals(), pixGetOuterBorder(), pixGetPixel(), pixGetPSNR(), pixGetRasterData(), pixGetRGBComponent(), pixGetRGBComponentCmap(), pixGetRGBLine(), pixGetRGBPixel(), pixGetRowStats(), pixGlobalNormRGB(), pixGrayQuantFromCmap(), pixGrayQuantFromHisto(), pixHShearLI(), pixInterlaceGIF(), pixLinearMapToTargetColor(), pixLinearTRCTiled(), pixMakeHistoHS(), pixMakeHistoHV(), pixMakeHistoSV(), pixMakeMaskFromLUT(), pixMakeRangeMaskHS(), pixMakeRangeMaskHV(), pixMakeRangeMaskSV(), pixMaskOverColorPixels(), pixMaxDynamicRange(), pixMeanSquareAccum(), pixMeasureSaturation(), pixMedianCutHisto(), pixMedianCutQuantMixed(), pixMinOrMax(), pixModifyHue(), pixModifySaturation(), pixMultConstAccumulate(), pixMultConstantColor(), pixMultConstantGray(), pixMultMatrixColor(), pixNumberOccupiedOctcubes(), pixNumColors(), pixOctcubeHistogram(), pixOctcubeQuantFromCmapLUT(), pixOctcubeQuantMixedWithGray(), pixOctreeQuantByPopulation(), pixOctreeQuantizePixels(), pixOctreeQuantNumColors(), pixOpenGray(), pixPaintThroughMask(), pixPrintStreamInfo(), pixProjectiveColor(), pixProjectiveGray(), pixProjectiveSampled(), pixQuadraticVShearLI(), pixQuadraticVShearSampled(), pixQualifyLocalMinima(), pixQuantizeWithColormap(), pixRandomHarmonicWarp(), pixRankColumnTransform(), pixRankFilterGray(), pixRankRowTransform(), pixRasterop(), pixRasteropHip(), pixRasteropVip(), pixReadFromTiffStream(), pixReadStreamBmp(), pixReadStreamGif(), pixReadStreamJpeg(), pixReadStreamPng(), pixReadStreamPnm(), pixReadStreamWebP(), pixReduceBinary2(), pixReduceRankBinary2(), pixRemoveColormap(), pixRemoveUnusedColors(), pixRenderContours(), pixRotate90(), pixRotateAMColor(), pixRotateAMColorCorner(), pixRotateAMColorFast(), pixRotateAMColorFast2(), pixRotateAMGray(), pixRotateAMGrayCorner(), pixRotateBySampling(), pixRowStats(), pixRunlengthTransform(), pixSauvolaGetThreshold(), pixScaleAreaMap(), pixScaleAreaMap2(), pixScaleBinary(), pixScaleBySampling(), pixScaleColor2xLI(), pixScaleColorLI(), pixScaleGray2xLI(), pixScaleGray2xLIDither(), pixScaleGray2xLIThresh(), pixScaleGray4xLI(), pixScaleGray4xLIDither(), pixScaleGray4xLIThresh(), pixScaleGrayLI(), pixScaleGrayMinMax(), pixScaleGrayMinMax2(), pixScaleGrayRank2(), pixScaleGrayToBinaryFast(), pixScaleMipmap(), pixScaleRGBToBinaryFast(), pixScaleRGBToGray2(), pixScaleRGBToGrayFast(), pixScaleSmooth(), pixScaleToGray16(), pixScaleToGray2(), pixScaleToGray3(), pixScaleToGray4(), pixScaleToGray6(), pixScaleToGray8(), pixScanForEdge(), pixScanForForeground(), pixSeedfill4(), pixSeedfill4BB(), pixSeedfill8(), pixSeedfill8BB(), pixSeedfillBinary(), pixSeedfillGray(), pixSeedfillGrayInv(), pixSeedfillGrayInvSimple(), pixSeedfillGraySimple(), pixSeedspread(), pixSelectMinInConnComp(), pixSerializeToMemory(), pixSetAllArbitrary(), pixSetBorderVal(), pixSetInRectArbitrary(), pixSetLowContrast(), pixSetMasked(), pixSetMaskedCmap(), pixSetPadBits(), pixSetPadBitsBand(), pixSetPixel(), pixSetPixelColumn(), pixSetRGBComponent(), pixSetRGBPixel(), pixSetSelectCmap(), pixSetSelectMaskedCmap(), pixShiftRGB258(), pixSnapColor(), pixSobelEdgeFilter(), pixStereoFromPair(), pixStretchHorizontalLI(), pixStretchHorizontalSampled(), pixSubtractGray(), pixSumPixelsByColumn(), pixSumPixelsByRow(), pixSumPixelValues(), pixThresholdGrayArb(), pixThresholdOn8bpp(), pixThresholdPixelSum(), pixThresholdTo2bpp(), pixThresholdTo4bpp(), pixThresholdToBinary(), pixThresholdToValue(), pixTransferAllData(), pixTRCMap(), pixTwoSidedEdgeFilter(), pixUnsharpMaskingGray1D(), pixUnsharpMaskingGray2D(), pixVarThresholdToBinary(), pixVShearLI(), pixWindowedMean(), pixWindowedMeanSquare(), pixWindowedVariance(), pixWriteStreamBmp(), pixWriteStreamGif(), pixWriteStreamJpeg(), pixWriteStreamPng(), pixWriteStreamPnm(), pixWriteStreamWebP(), pixWriteStringPS(), pixWriteToTiffStream(), pixWriteTTFText(), pixWriteWebPwithTargetPSNR(), pixZero(), and ptaGetPixelsFromPix().

l_int32 pixSetData ( PIX pix,
l_uint32 data 
)

pixSetData()

Notes: (1) This does not free any existing data. To free existing data, use pixFreeData() before pixSetData().

Definition at line 1376 of file pix1.c.

References Pix::data, ERROR_INT, and PROCNAME.

Referenced by main(), pixCreateNoInit(), pixExtractData(), pixResizeImageData(), and pixTransferAllData().

l_uint32* pixExtractData ( PIX pixs)

pixExtractData()

Notes: (1) This extracts the pix image data for use in another context. The caller still needs to use pixDestroy() on the input pix. (2) If refcount == 1, the data is extracted and the pix->data ptr is set to NULL. (3) If refcount > 1, this simply returns a copy of the data, using the pix allocator, and leaving the input pix unchanged.

Definition at line 1401 of file pix1.c.

References ERROR_PTR, NULL, pix_malloc(), pixGetData(), pixGetHeight(), pixGetRefcount(), pixGetWpl(), pixSetData(), and PROCNAME.

Referenced by main().

l_int32 pixFreeData ( PIX pix)

pixFreeData()

Notes: (1) This frees the data and sets the pix data ptr to null. It should be used before pixSetData() in the situation where you want to free any existing data before doing a subsequent assignment with pixSetData().

Definition at line 1438 of file pix1.c.

References Pix::data, ERROR_INT, NULL, pix_free(), pixGetData(), and PROCNAME.

Referenced by main(), pixResizeImageData(), and pixTransferAllData().

void** pixGetLinePtrs ( PIX pix,
l_int32 psize 
)

pixGetLinePtrs()

Input: pix &size (<optional return>=""> array size, which is the pix height) Return: array of line ptrs, or null on error

Notes: (1) This is intended to be used for fast random pixel access. For example, for an 8 bpp image, val = GET_DATA_BYTE(lines8[i], j); is equivalent to, but much faster than, pixGetPixel(pix, j, i, &val); (2) How much faster? For 1 bpp, it's from 6 to 10x faster. For 8 bpp, it's an amazing 30x faster. So if you are doing random access over a substantial part of the image, use this line ptr array. (3) When random access is used in conjunction with a stack, queue or heap, the overall computation time depends on the operations performed on each struct that is popped or pushed, and whether we are using a priority queue (O(logn)) or a queue or stack (O(1)). For example, for maze search, the overall ratio of time for line ptrs vs. pixGet/Set* is Maze type Type Time ratio binary queue 0.4 gray heap (priority queue) 0.6 (4) Because this returns a void** and the accessors take void*, the compiler cannot check the pointer types. It is strongly recommended that you adopt a naming scheme for the returned ptr arrays that indicates the pixel depth. (This follows the original intent of Simonyi's "Hungarian" application notation, where naming is used proactively to make errors visibly obvious.) By doing this, you can tell by inspection if the correct accessor is used. For example, for an 8 bpp pixg: void **lineg8 = pixGetLinePtrs(pixg, NULL); val = GET_DATA_BYTE(lineg8[i], j); // fast access; BYTE, 8 ... FREE(lineg8); // don't forget this (5) These are convenient for accessing bytes sequentially in an 8 bpp grayscale image. People who write image processing code on 8 bpp images are accustomed to grabbing pixels directly out of the raster array. Note that for little endians, you first need to reverse the byte order in each 32-bit word. Here's a typical usage pattern: pixEndianByteSwap(pix); // always safe; no-op on big-endians l_uint8 **lineptrs = (l_uint8 **)pixGetLinePtrs(pix, NULL); pixGetDimensions(pix, &w, &h, NULL); for (i = 0; i < h; i++) { l_uint8 *line = lineptrs[i]; for (j = 0; j < w; j++) { val = line[j]; ... } } pixEndianByteSwap(pix); // restore big-endian order FREE(lineptrs); This can be done even more simply as follows: l_uint8 **lineptrs = pixSetupByteProcessing(pix, &w, &h); for (i = 0; i < h; i++) { l_uint8 *line = lineptrs[i]; for (j = 0; j < w; j++) { val = line[j]; ... } } pixCleanupByteProcessing(pix, lineptrs);

Definition at line 1527 of file pix1.c.

References CALLOC, ERROR_PTR, NULL, pixGetData(), pixGetHeight(), pixGetWpl(), and PROCNAME.

Referenced by main(), pixApplyVerticalDisparity(), pixFindLargestRectangle(), pixMakeHistoHS(), pixMakeHistoHV(), pixMakeHistoSV(), pixRankColumnTransform(), pixRotateBySampling(), pixSearchBinaryMaze(), pixSearchForRectangle(), pixSearchGrayMaze(), pixSetupByteProcessing(), and wshedCreate().

l_int32 pixPrintStreamInfo ( FILE *  fp,
PIX pix,
const char *  text 
)

pixPrintStreamInfo()

Input: fp (file stream) pix text (<optional> identifying string; can be null) Return: 0 if OK, 1 on error

Definition at line 1566 of file pix1.c.

References ERROR_INT, NULL, pixcmapWriteStream(), pixGetColormap(), pixGetData(), pixGetDepth(), pixGetHeight(), pixGetInputFormat(), pixGetRefcount(), pixGetWidth(), pixGetWpl(), and PROCNAME.

Referenced by main().


Variable Documentation

Initial value:
 {
    &malloc,
    &free
}

Definition at line 194 of file pix1.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines