Leptonica 1.68
C Image Processing Library
|
Implements FPix and DPix classes (float and double images) More...
Go to the source code of this file.
Implements FPix and DPix classes (float and double images)
This file has basic constructors, destructors and field accessors for FPix, FPixa and DPix. It also has uncompressed read/write. FPix Create/copy/destroy FPIX *fpixCreate() FPIX *fpixCreateTemplate() FPIX *fpixClone() FPIX *fpixCopy() l_int32 fpixResizeImageData() void fpixDestroy() FPix accessors l_int32 fpixGetDimensions() l_int32 fpixSetDimensions() l_int32 fpixGetWpl() l_int32 fpixSetWpl() l_int32 fpixGetRefcount() l_int32 fpixChangeRefcount() l_int32 fpixGetResolution() l_int32 fpixSetResolution() l_int32 fpixCopyResolution() l_float32 *fpixGetData() l_int32 fpixSetData() l_int32 fpixGetPixel() l_int32 fpixSetPixel() FPixa Create/copy/destroy FPIXA *fpixaCreate() FPIXA *fpixaCopy() void fpixaDestroy() FPixa addition l_int32 fpixaAddFPix() l_int32 fpixaExtendArray() l_int32 fpixaExtendArrayToSize() FPixa accessors l_int32 fpixaGetCount() l_int32 fpixaChangeRefcount() FPIX *fpixaGetFPix() l_int32 fpixaGetFPixDimensions() l_int32 fpixaGetPixel() l_int32 fpixaSetPixel() DPix Create/copy/destroy DPIX *dpixCreate() DPIX *dpixCreateTemplate() DPIX *dpixClone() DPIX *dpixCopy() l_int32 dpixResizeImageData() void dpixDestroy() DPix accessors l_int32 dpixGetDimensions() l_int32 dpixSetDimensions() l_int32 dpixGetWpl() l_int32 dpixSetWpl() l_int32 dpixGetRefcount() l_int32 dpixChangeRefcount() l_int32 dpixGetResolution() l_int32 dpixSetResolution() l_int32 dpixCopyResolution() l_float64 *dpixGetData() l_int32 dpixSetData() l_int32 dpixGetPixel() l_int32 dpixSetPixel() FPix serialized I/O FPIX *fpixRead() FPIX *fpixReadStream() l_int32 fpixWrite() l_int32 fpixWriteStream() FPIX *fpixEndianByteSwap() DPix serialized I/O DPIX *dpixRead() DPIX *dpixReadStream() l_int32 dpixWrite() l_int32 dpixWriteStream() DPIX *dpixEndianByteSwap() Print FPix (subsampled, for debugging) l_int32 fpixPrintStream()
Definition in file fpix1.c.
Input: width, height Return: fpixd (with data allocated and initialized to 0), or null on error
Notes: (1) Makes a FPix of specified size, with the data array allocated and initialized to 0.
Definition at line 125 of file fpix1.c.
References CALLOC, ERROR_PTR, fpixSetData(), fpixSetDimensions(), fpixSetWpl(), NULL, PROCNAME, and FPix::refcount.
Referenced by dewarpBuildModel(), dpixConvertToFPix(), fpixAddBorder(), fpixBuildHorizontalDisparity(), fpixConvolve(), fpixCreateTemplate(), fpixReadStream(), fpixRemoveBorder(), fpixSampledDisparity(), fpixScaleByInteger(), pixConvertToFPix(), pixQuadtreeMean(), pixQuadtreeVariance(), pixUnsharpMaskingGray2D(), and pixWindowedVariance().
Input: fpixs Return: fpixd, or null on error
Notes: (1) Makes a FPix of the same size as the input FPix, with the data array allocated and initialized to 0. (2) Copies the resolution.
Definition at line 165 of file fpix1.c.
References ERROR_PTR, fpixCopyResolution(), fpixCreate(), fpixGetDimensions(), NULL, and PROCNAME.
Referenced by fpixCopy().
Input: fpix Return: same fpix (ptr), or null on error
Notes: (1) See pixClone() for definition and usage.
Definition at line 192 of file fpix1.c.
References ERROR_PTR, fpixChangeRefcount(), NULL, and PROCNAME.
Referenced by fpixaAddFPix(), fpixaGetFPix(), fpixEndianByteSwap(), and main().
Input: fpixd (<optional>; can be null, or equal to fpixs, or different from fpixs) fpixs Return: fpixd, or null on error
Notes: (1) There are three cases: (a) fpixd == null (makes a new fpix; refcount = 1) (b) fpixd == fpixs (no-op) (c) fpixd != fpixs (data copy; no change in refcount) If the refcount of fpixd > 1, case (c) will side-effect these handles. (2) The general pattern of use is: fpixd = fpixCopy(fpixd, fpixs); This will work for all three cases. For clarity when the case is known, you can use: (a) fpixd = fpixCopy(NULL, fpixs); (c) fpixCopy(fpixd, fpixs); (3) For case (c), we check if fpixs and fpixd are the same size. If so, the data is copied directly. Otherwise, the data is reallocated to the correct size and the copy proceeds. The refcount of fpixd is unchanged. (4) This operation, like all others that may involve a pre-existing fpixd, will side-effect any existing clones of fpixd.
Definition at line 233 of file fpix1.c.
References ERROR_PTR, fpixCopyResolution(), fpixCreateTemplate(), fpixGetData(), fpixGetDimensions(), fpixResizeImageData(), NULL, and PROCNAME.
Referenced by fpixaAddFPix(), fpixAddBorder(), fpixaGetFPix(), fpixEndianByteSwap(), fpixLinearCombination(), and fpixRemoveBorder().
Input: fpixd, fpixs Return: 0 if OK, 1 on error
Notes: (1) If the data sizes differ, this destroys the existing data in fpixd and allocates a new, uninitialized, data array of the same size as the data in fpixs. Otherwise, this doesn't do anything.
Definition at line 285 of file fpix1.c.
References ERROR_INT, fpixGetData(), fpixGetDimensions(), fpixSetData(), fpixSetDimensions(), fpixSetWpl(), FREE, MALLOC, NULL, and PROCNAME.
Referenced by fpixCopy().
void fpixDestroy | ( | FPIX ** | pfpix | ) |
Input: &fpix <will be="" nulled>=""> Return: void
Notes: (1) Decrements the ref count and, if 0, destroys the fpix. (2) Always nulls the input ptr.
Definition at line 326 of file fpix1.c.
References fpixChangeRefcount(), fpixGetData(), fpixGetRefcount(), FREE, L_WARNING, NULL, and PROCNAME.
Referenced by dewarpDestroy(), dewarpMinimize(), fpixaDestroy(), fpixaDisplayQuadtree(), fpixaGetFPixDimensions(), fpixaGetPixel(), fpixaSetPixel(), fpixConvolve(), fpixConvolveSep(), fpixWriteStream(), main(), and pixUnsharpMaskingGray2D().
Input: fpix &w, &h (<optional return>="">; each can be null) Return: 0 if OK, 1 on error
Definition at line 365 of file fpix1.c.
References ERROR_INT, FPix::h, PROCNAME, and FPix::w.
Referenced by fpixAddBorder(), fpixAddMirroredBorder(), fpixAddMultConstant(), fpixaGetFPixDimensions(), fpixBuildHorizontalDisparity(), fpixConvertToDPix(), fpixConvertToPix(), fpixConvolve(), fpixCopy(), fpixCreateTemplate(), fpixDisplayMaxDynamicRange(), fpixEndianByteSwap(), fpixGetMax(), fpixGetMin(), fpixGetPixel(), fpixLinearCombination(), fpixPrintStream(), fpixRasterop(), fpixRemoveBorder(), fpixRenderContours(), fpixResizeImageData(), fpixSampledDisparity(), fpixScaleByInteger(), fpixSetPixel(), fpixWriteStream(), pixApplyHorizontalDisparity(), and pixApplyVerticalDisparity().
Input: fpix w, h Return: 0 if OK, 1 on error
Definition at line 387 of file fpix1.c.
References ERROR_INT, FPix::h, PROCNAME, and FPix::w.
Referenced by fpixCreate(), and fpixResizeImageData().
Definition at line 402 of file fpix1.c.
References ERROR_INT, PROCNAME, and FPix::wpl.
Referenced by dpixConvertToFPix(), fpixAddMultConstant(), fpixBuildHorizontalDisparity(), fpixConvertToDPix(), fpixConvertToPix(), fpixConvolve(), fpixDisplayMaxDynamicRange(), fpixGetMax(), fpixGetMin(), fpixLinearCombination(), fpixRasterop(), fpixRenderContours(), fpixScaleByInteger(), fpixWriteStream(), pixApplyHorizontalDisparity(), pixApplyVerticalDisparity(), pixConvertToFPix(), pixUnsharpMaskingGray2D(), and pixWindowedVariance().
Definition at line 413 of file fpix1.c.
References ERROR_INT, PROCNAME, and FPix::wpl.
Referenced by fpixCreate(), and fpixResizeImageData().
Definition at line 427 of file fpix1.c.
References ERROR_INT, PROCNAME, FPix::refcount, and UNDEF.
Referenced by fpixDestroy().
Definition at line 438 of file fpix1.c.
References ERROR_INT, PROCNAME, and FPix::refcount.
Referenced by fpixClone(), and fpixDestroy().
Definition at line 452 of file fpix1.c.
References ERROR_INT, PROCNAME, FPix::xres, and FPix::yres.
Referenced by fpixCopyResolution().
Definition at line 467 of file fpix1.c.
References ERROR_INT, PROCNAME, FPix::xres, and FPix::yres.
Referenced by fpixCopyResolution().
Definition at line 483 of file fpix1.c.
References ERROR_INT, fpixGetResolution(), fpixSetResolution(), and PROCNAME.
Referenced by fpixAddBorder(), fpixCopy(), fpixCreateTemplate(), and fpixRemoveBorder().
Definition at line 499 of file fpix1.c.
References FPix::data, ERROR_PTR, NULL, and PROCNAME.
Referenced by dpixConvertToFPix(), fpixAddMultConstant(), fpixBuildHorizontalDisparity(), fpixConvertToDPix(), fpixConvertToPix(), fpixConvolve(), fpixCopy(), fpixDestroy(), fpixDisplayMaxDynamicRange(), fpixEndianByteSwap(), fpixGetMax(), fpixGetMin(), fpixLinearCombination(), fpixRasterop(), fpixReadStream(), fpixRenderContours(), fpixResizeImageData(), fpixScaleByInteger(), fpixWriteStream(), pixApplyHorizontalDisparity(), pixApplyVerticalDisparity(), pixConvertToFPix(), pixUnsharpMaskingGray2D(), and pixWindowedVariance().
Definition at line 510 of file fpix1.c.
References FPix::data, ERROR_INT, and PROCNAME.
Referenced by fpixCreate(), and fpixResizeImageData().
Input: fpix (x,y) pixel coords &val (<return> pixel value) Return: 0 if OK; 1 on error
Definition at line 532 of file fpix1.c.
References FPix::data, ERROR_INT, fpixGetDimensions(), and PROCNAME.
Referenced by fpixaGetPixel(), fpixBuildHorizontalDisparity(), fpixPrintStream(), and fpixSampledDisparity().
Input: fpix (x,y) pixel coords val (pixel value) Return: 0 if OK; 1 on error
Definition at line 567 of file fpix1.c.
References FPix::data, ERROR_INT, fpixGetDimensions(), and PROCNAME.
Referenced by dewarpBuildModel(), fpixaSetPixel(), fpixSampledDisparity(), pixQuadtreeMean(), and pixQuadtreeVariance().
Input: n (initial number of ptrs) Return: fpixa, or null on error
Definition at line 600 of file fpix1.c.
References CALLOC, ERROR_PTR, FPixa::fpix, INITIAL_PTR_ARRAYSIZE, FPixa::n, FPixa::nalloc, NULL, PROCNAME, and FPixa::refcount.
Referenced by fpixaCopy(), pixQuadtreeMean(), and pixQuadtreeVariance().
Input: fpixas copyflag: L_COPY makes a new fpixa and copies each fpix L_CLONE gives a new ref-counted handle to the input fpixa L_COPY_CLONE makes a new fpixa with clones of all fpix Return: new fpixa, or null on error
Definition at line 633 of file fpix1.c.
References ERROR_PTR, fpixaAddFPix(), fpixaChangeRefcount(), fpixaCreate(), fpixaGetFPix(), L_CLONE, L_COPY, L_COPY_CLONE, L_INSERT, FPixa::n, NULL, and PROCNAME.
void fpixaDestroy | ( | FPIXA ** | pfpixa | ) |
Input: &fpixa (<can be="" nulled>="">) Return: void
Notes: (1) Decrements the ref count and, if 0, destroys the fpixa. (2) Always nulls the input ptr.
Definition at line 678 of file fpix1.c.
References FPixa::fpix, fpixaChangeRefcount(), fpixDestroy(), FREE, L_WARNING, FPixa::n, NULL, PROCNAME, and FPixa::refcount.
Referenced by main().
Input: fpixa fpix (to be added) copyflag (L_INSERT, L_COPY, L_CLONE) Return: 0 if OK; 1 on error
Definition at line 719 of file fpix1.c.
References ERROR_INT, FPixa::fpix, fpixaExtendArray(), fpixaGetCount(), fpixClone(), fpixCopy(), L_CLONE, L_COPY, L_INSERT, FPixa::n, FPixa::nalloc, NULL, and PROCNAME.
Referenced by fpixaCopy(), pixQuadtreeMean(), and pixQuadtreeVariance().
Input: fpixa Return: 0 if OK; 1 on error
Notes: (1) Doubles the size of the fpixa ptr array.
Definition at line 764 of file fpix1.c.
References ERROR_INT, fpixaExtendArrayToSize(), FPixa::nalloc, and PROCNAME.
Referenced by fpixaAddFPix().
Input: fpixa Return: 0 if OK; 1 on error
Notes: (1) If necessary, reallocs new fpixa ptrs array to .
Definition at line 785 of file fpix1.c.
References ERROR_INT, FPixa::fpix, FPixa::nalloc, NULL, PROCNAME, reallocNew(), and size.
Referenced by fpixaExtendArray().
Input: fpixa Return: count, or 0 if no pixa
Definition at line 814 of file fpix1.c.
References ERROR_INT, FPixa::n, and PROCNAME.
Referenced by fpixaAddFPix(), fpixaDisplayQuadtree(), fpixaGetPixel(), fpixaSetPixel(), quadtreeGetChildren(), and quadtreeGetParent().
Input: fpixa Return: 0 if OK, 1 on error
Definition at line 832 of file fpix1.c.
References ERROR_INT, PROCNAME, and FPixa::refcount.
Referenced by fpixaCopy(), and fpixaDestroy().
Input: fpixa index (to the index-th fpix) accesstype (L_COPY or L_CLONE) Return: fpix, or null on error
Definition at line 854 of file fpix1.c.
References ERROR_PTR, FPixa::fpix, fpixClone(), fpixCopy(), L_CLONE, L_COPY, FPixa::n, NULL, and PROCNAME.
Referenced by fpixaCopy(), fpixaDisplayQuadtree(), fpixaGetFPixDimensions(), fpixaGetPixel(), and fpixaSetPixel().
Input: fpixa index (to the index-th box) &w, &h (<optional return>="">; each can be null) Return: 0 if OK, 1 on error
Definition at line 883 of file fpix1.c.
References ERROR_INT, fpixaGetFPix(), fpixDestroy(), fpixGetDimensions(), L_CLONE, FPixa::n, NULL, and PROCNAME.
Referenced by main().
Input: fpixa index (into fpixa array) (x,y) pixel coords &val (<return> pixel value) Return: 0 if OK; 1 on error
Definition at line 915 of file fpix1.c.
References ERROR_INT, fpixaGetCount(), fpixaGetFPix(), fpixDestroy(), fpixGetPixel(), L_CLONE, and PROCNAME.
Referenced by main(), quadtreeGetChildren(), and quadtreeGetParent().
Input: fpixa index (into fpixa array) (x,y) pixel coords val (pixel value) Return: 0 if OK; 1 on error
Definition at line 952 of file fpix1.c.
References ERROR_INT, fpixaGetCount(), fpixaGetFPix(), fpixDestroy(), fpixSetPixel(), L_CLONE, and PROCNAME.
Input: width, height Return: dpix (with data allocated and initialized to 0), or null on error
Notes: (1) Makes a DPix of specified size, with the data array allocated and initialized to 0.
Definition at line 991 of file fpix1.c.
References CALLOC, dpixSetData(), dpixSetDimensions(), dpixSetWpl(), ERROR_PTR, NULL, PROCNAME, and DPix::refcount.
Referenced by dpixCreateTemplate(), dpixReadStream(), dpixScaleByInteger(), fpixConvertToDPix(), and pixMeanSquareAccum().
Input: dpixs Return: dpixd, or null on error
Notes: (1) Makes a DPix of the same size as the input DPix, with the data array allocated and initialized to 0. (2) Copies the resolution.
Definition at line 1031 of file fpix1.c.
References dpixCopyResolution(), dpixCreate(), dpixGetDimensions(), ERROR_PTR, NULL, and PROCNAME.
Referenced by dpixCopy().
Input: dpix Return: same dpix (ptr), or null on error
Notes: (1) See pixClone() for definition and usage.
Definition at line 1058 of file fpix1.c.
References dpixChangeRefcount(), ERROR_PTR, NULL, and PROCNAME.
Referenced by dpixEndianByteSwap(), and pixQuadtreeVariance().
Input: dpixd (<optional>; can be null, or equal to dpixs, or different from dpixs) dpixs Return: dpixd, or null on error
Notes: (1) There are three cases: (a) dpixd == null (makes a new dpix; refcount = 1) (b) dpixd == dpixs (no-op) (c) dpixd != dpixs (data copy; no change in refcount) If the refcount of dpixd > 1, case (c) will side-effect these handles. (2) The general pattern of use is: dpixd = dpixCopy(dpixd, dpixs); This will work for all three cases. For clarity when the case is known, you can use: (a) dpixd = dpixCopy(NULL, dpixs); (c) dpixCopy(dpixd, dpixs); (3) For case (c), we check if dpixs and dpixd are the same size. If so, the data is copied directly. Otherwise, the data is reallocated to the correct size and the copy proceeds. The refcount of dpixd is unchanged. (4) This operation, like all others that may involve a pre-existing dpixd, will side-effect any existing clones of dpixd.
Definition at line 1099 of file fpix1.c.
References dpixCopyResolution(), dpixCreateTemplate(), dpixGetData(), dpixGetDimensions(), dpixResizeImageData(), ERROR_PTR, NULL, and PROCNAME.
Referenced by dpixEndianByteSwap().
Input: dpixd, dpixs Return: 0 if OK, 1 on error
Definition at line 1145 of file fpix1.c.
References dpixGetData(), dpixGetDimensions(), dpixSetData(), dpixSetDimensions(), dpixSetWpl(), ERROR_INT, FREE, MALLOC, NULL, and PROCNAME.
Referenced by dpixCopy().
void dpixDestroy | ( | DPIX ** | pdpix | ) |
Input: &dpix <will be="" nulled>=""> Return: void
Notes: (1) Decrements the ref count and, if 0, destroys the dpix. (2) Always nulls the input ptr.
Definition at line 1186 of file fpix1.c.
References dpixChangeRefcount(), dpixGetData(), dpixGetRefcount(), FREE, L_WARNING, NULL, and PROCNAME.
Referenced by dpixWriteStream(), main(), pixQuadtreeVariance(), and pixWindowedMeanSquare().
Input: dpix &w, &h (<optional return>="">; each can be null) Return: 0 if OK, 1 on error
Definition at line 1225 of file fpix1.c.
References ERROR_INT, DPix::h, PROCNAME, and DPix::w.
Referenced by dpixConvertToFPix(), dpixCopy(), dpixCreateTemplate(), dpixEndianByteSwap(), dpixGetPixel(), dpixResizeImageData(), dpixScaleByInteger(), dpixSetPixel(), and dpixWriteStream().
Input: dpix w, h Return: 0 if OK, 1 on error
Definition at line 1247 of file fpix1.c.
References ERROR_INT, DPix::h, PROCNAME, and DPix::w.
Referenced by dpixCreate(), and dpixResizeImageData().
Definition at line 1262 of file fpix1.c.
References ERROR_INT, PROCNAME, and DPix::wpl.
Referenced by dpixConvertToFPix(), dpixScaleByInteger(), dpixWriteStream(), fpixConvertToDPix(), pixMeanSquareAccum(), and pixWindowedMeanSquare().
Definition at line 1273 of file fpix1.c.
References ERROR_INT, PROCNAME, and DPix::wpl.
Referenced by dpixCreate(), and dpixResizeImageData().
Definition at line 1287 of file fpix1.c.
References ERROR_INT, PROCNAME, DPix::refcount, and UNDEF.
Referenced by dpixDestroy().
Definition at line 1298 of file fpix1.c.
References ERROR_INT, PROCNAME, and DPix::refcount.
Referenced by dpixClone(), and dpixDestroy().
Definition at line 1312 of file fpix1.c.
References ERROR_INT, PROCNAME, DPix::xres, and DPix::yres.
Referenced by dpixCopyResolution().
Definition at line 1327 of file fpix1.c.
References ERROR_INT, PROCNAME, DPix::xres, and DPix::yres.
Referenced by dpixCopyResolution().
Definition at line 1343 of file fpix1.c.
References dpixGetResolution(), dpixSetResolution(), ERROR_INT, and PROCNAME.
Referenced by dpixCopy(), and dpixCreateTemplate().
Definition at line 1359 of file fpix1.c.
References DPix::data, ERROR_PTR, NULL, and PROCNAME.
Referenced by dpixConvertToFPix(), dpixCopy(), dpixDestroy(), dpixEndianByteSwap(), dpixReadStream(), dpixResizeImageData(), dpixScaleByInteger(), dpixWriteStream(), fpixConvertToDPix(), pixMeanSquareAccum(), and pixWindowedMeanSquare().
Definition at line 1370 of file fpix1.c.
References DPix::data, ERROR_INT, and PROCNAME.
Referenced by dpixCreate(), and dpixResizeImageData().
Input: dpix (x,y) pixel coords &val (<return> pixel value) Return: 0 if OK; 1 on error
Definition at line 1392 of file fpix1.c.
References DPix::data, dpixGetDimensions(), ERROR_INT, and PROCNAME.
Referenced by pixVarianceInRectangle().
Input: dpix (x,y) pixel coords val (pixel value) Return: 0 if OK; 1 on error
Definition at line 1427 of file fpix1.c.
References DPix::data, dpixGetDimensions(), ERROR_INT, and PROCNAME.
FPIX* fpixRead | ( | const char * | filename | ) |
Input: filename Return: fpix, or null on error
Definition at line 1460 of file fpix1.c.
References ERROR_PTR, fopenReadStream(), fpixReadStream(), NULL, and PROCNAME.
Referenced by main().
FPIX* fpixReadStream | ( | FILE * | fp | ) |
Input: stream Return: fpix, or null on error
Definition at line 1489 of file fpix1.c.
References ERROR_PTR, FPIX_VERSION_NUMBER, fpixCreate(), fpixEndianByteSwap(), fpixGetData(), NULL, PROCNAME, and version.
Referenced by dewarpReadStream(), and fpixRead().
Input: filename fpix Return: 0 if OK, 1 on error
Definition at line 1527 of file fpix1.c.
References ERROR_INT, fopenWriteStream(), fpixWriteStream(), NULL, and PROCNAME.
Referenced by main().
Input: stream (opened for "wb") fpix Return: 0 if OK, 1 on error
Definition at line 1557 of file fpix1.c.
References ERROR_INT, FPIX_VERSION_NUMBER, fpixDestroy(), fpixEndianByteSwap(), fpixGetData(), fpixGetDimensions(), fpixGetWpl(), NULL, and PROCNAME.
Referenced by dewarpWriteStream(), and fpixWrite().
Input: fpixd (can be equal to fpixs or NULL) fpixs Return: fpixd always
Notes: (1) On big-endian hardware, this does byte-swapping on each of the 4-byte floats in the fpix data. On little-endians, the data is unchanged. This is used for serialization of fpix; the data is serialized in little-endian byte order because most hardware is little-endian. (2) The operation can be either in-place or, if fpixd == NULL, a new fpix is made. If not in-place, caller must catch the returned pointer.
Definition at line 1604 of file fpix1.c.
References ERROR_PTR, fpixClone(), fpixCopy(), fpixGetData(), fpixGetDimensions(), and PROCNAME.
Referenced by fpixReadStream(), and fpixWriteStream().
DPIX* dpixRead | ( | const char * | filename | ) |
Input: filename Return: dpix, or null on error
Definition at line 1656 of file fpix1.c.
References dpixReadStream(), ERROR_PTR, fopenReadStream(), NULL, and PROCNAME.
Referenced by main().
DPIX* dpixReadStream | ( | FILE * | fp | ) |
Input: stream Return: dpix, or null on error
Definition at line 1685 of file fpix1.c.
References DPIX_VERSION_NUMBER, dpixCreate(), dpixEndianByteSwap(), dpixGetData(), ERROR_PTR, NULL, PROCNAME, and version.
Referenced by dpixRead().
Input: filename dpix Return: 0 if OK, 1 on error
Definition at line 1723 of file fpix1.c.
References dpixWriteStream(), ERROR_INT, fopenWriteStream(), NULL, and PROCNAME.
Referenced by main().
Input: stream (opened for "wb") dpix Return: 0 if OK, 1 on error
Definition at line 1753 of file fpix1.c.
References DPIX_VERSION_NUMBER, dpixDestroy(), dpixEndianByteSwap(), dpixGetData(), dpixGetDimensions(), dpixGetWpl(), ERROR_INT, NULL, and PROCNAME.
Referenced by dpixWrite().
Input: dpixd (can be equal to dpixs or NULL) dpixs Return: dpixd always
Notes: (1) On big-endian hardware, this does byte-swapping on each of the 4-byte words in the dpix data. On little-endians, the data is unchanged. This is used for serialization of dpix; the data is serialized in little-endian byte order because most hardware is little-endian. (2) The operation can be either in-place or, if dpixd == NULL, a new dpix is made. If not in-place, caller must catch the returned pointer.
Definition at line 1800 of file fpix1.c.
References dpixClone(), dpixCopy(), dpixGetData(), dpixGetDimensions(), ERROR_PTR, and PROCNAME.
Referenced by dpixReadStream(), and dpixWriteStream().
Input: stream fpix factor (subsampled) Return: 0 if OK, 1 on error
Notes: (1) Subsampled printout of fpix for debugging.
Definition at line 1857 of file fpix1.c.
References ERROR_INT, fpixGetDimensions(), fpixGetPixel(), and PROCNAME.
const l_int32 INITIAL_PTR_ARRAYSIZE = 20 [static] |
Definition at line 107 of file fpix1.c.
Referenced by fpixaCreate().