![]() |
Leptonica
1.82.0
Image processing and image analysis suite
|
#include <string.h>
#include "allheaders.h"
Go to the source code of this file.
Functions | |
static l_int32 | fpixaExtendArray (FPIXA *fpixa) |
static l_int32 | fpixaExtendArrayToSize (FPIXA *fpixa, l_int32 size) |
FPIX * | fpixCreate (l_int32 width, l_int32 height) |
FPIX * | fpixCreateTemplate (FPIX *fpixs) |
FPIX * | fpixClone (FPIX *fpix) |
FPIX * | fpixCopy (FPIX *fpixs) |
void | fpixDestroy (FPIX **pfpix) |
l_ok | fpixGetDimensions (FPIX *fpix, l_int32 *pw, l_int32 *ph) |
l_ok | fpixSetDimensions (FPIX *fpix, l_int32 w, l_int32 h) |
l_int32 | fpixGetWpl (FPIX *fpix) |
l_ok | fpixSetWpl (FPIX *fpix, l_int32 wpl) |
l_int32 | fpixGetRefcount (FPIX *fpix) |
l_ok | fpixChangeRefcount (FPIX *fpix, l_int32 delta) |
l_ok | fpixGetResolution (FPIX *fpix, l_int32 *pxres, l_int32 *pyres) |
l_ok | fpixSetResolution (FPIX *fpix, l_int32 xres, l_int32 yres) |
l_ok | fpixCopyResolution (FPIX *fpixd, FPIX *fpixs) |
l_float32 * | fpixGetData (FPIX *fpix) |
l_ok | fpixSetData (FPIX *fpix, l_float32 *data) |
l_ok | fpixGetPixel (FPIX *fpix, l_int32 x, l_int32 y, l_float32 *pval) |
l_ok | fpixSetPixel (FPIX *fpix, l_int32 x, l_int32 y, l_float32 val) |
FPIXA * | fpixaCreate (l_int32 n) |
FPIXA * | fpixaCopy (FPIXA *fpixa, l_int32 copyflag) |
void | fpixaDestroy (FPIXA **pfpixa) |
l_ok | fpixaAddFPix (FPIXA *fpixa, FPIX *fpix, l_int32 copyflag) |
l_int32 | fpixaGetCount (FPIXA *fpixa) |
l_ok | fpixaChangeRefcount (FPIXA *fpixa, l_int32 delta) |
FPIX * | fpixaGetFPix (FPIXA *fpixa, l_int32 index, l_int32 accesstype) |
l_ok | fpixaGetFPixDimensions (FPIXA *fpixa, l_int32 index, l_int32 *pw, l_int32 *ph) |
l_float32 * | fpixaGetData (FPIXA *fpixa, l_int32 index) |
l_ok | fpixaGetPixel (FPIXA *fpixa, l_int32 index, l_int32 x, l_int32 y, l_float32 *pval) |
l_ok | fpixaSetPixel (FPIXA *fpixa, l_int32 index, l_int32 x, l_int32 y, l_float32 val) |
DPIX * | dpixCreate (l_int32 width, l_int32 height) |
DPIX * | dpixCreateTemplate (DPIX *dpixs) |
DPIX * | dpixClone (DPIX *dpix) |
DPIX * | dpixCopy (DPIX *dpixs) |
void | dpixDestroy (DPIX **pdpix) |
l_ok | dpixGetDimensions (DPIX *dpix, l_int32 *pw, l_int32 *ph) |
l_ok | dpixSetDimensions (DPIX *dpix, l_int32 w, l_int32 h) |
l_int32 | dpixGetWpl (DPIX *dpix) |
l_ok | dpixSetWpl (DPIX *dpix, l_int32 wpl) |
l_int32 | dpixGetRefcount (DPIX *dpix) |
l_ok | dpixChangeRefcount (DPIX *dpix, l_int32 delta) |
l_ok | dpixGetResolution (DPIX *dpix, l_int32 *pxres, l_int32 *pyres) |
l_ok | dpixSetResolution (DPIX *dpix, l_int32 xres, l_int32 yres) |
l_ok | dpixCopyResolution (DPIX *dpixd, DPIX *dpixs) |
l_float64 * | dpixGetData (DPIX *dpix) |
l_ok | dpixSetData (DPIX *dpix, l_float64 *data) |
l_ok | dpixGetPixel (DPIX *dpix, l_int32 x, l_int32 y, l_float64 *pval) |
l_ok | dpixSetPixel (DPIX *dpix, l_int32 x, l_int32 y, l_float64 val) |
FPIX * | fpixRead (const char *filename) |
FPIX * | fpixReadStream (FILE *fp) |
FPIX * | fpixReadMem (const l_uint8 *data, size_t size) |
l_ok | fpixWrite (const char *filename, FPIX *fpix) |
l_ok | fpixWriteStream (FILE *fp, FPIX *fpix) |
l_ok | fpixWriteMem (l_uint8 **pdata, size_t *psize, FPIX *fpix) |
FPIX * | fpixEndianByteSwap (FPIX *fpixd, FPIX *fpixs) |
DPIX * | dpixRead (const char *filename) |
DPIX * | dpixReadStream (FILE *fp) |
DPIX * | dpixReadMem (const l_uint8 *data, size_t size) |
l_ok | dpixWrite (const char *filename, DPIX *dpix) |
l_ok | dpixWriteStream (FILE *fp, DPIX *dpix) |
l_ok | dpixWriteMem (l_uint8 **pdata, size_t *psize, DPIX *dpix) |
DPIX * | dpixEndianByteSwap (DPIX *dpixd, DPIX *dpixs) |
l_ok | fpixPrintStream (FILE *fp, FPIX *fpix, l_int32 factor) |
Variables | |
static const size_t | MaxPtrArraySize = 100000 |
static const size_t | InitialPtrArraySize = 20 |
--------------------------------------------------- This file has these FPix, FPixa and DPix utilities:
Definition in file fpix1.c.
l_ok dpixChangeRefcount | ( | DPIX * | dpix, |
l_int32 | delta | ||
) |
[in] | dpix | |
[in] | delta |
Definition at line 1354 of file fpix1.c.
References DPix::refcount.
Referenced by dpixClone(), and dpixDestroy().
[in] | dpix |
Notes: (1) See pixClone() for definition and usage.
Definition at line 1159 of file fpix1.c.
References dpixChangeRefcount().
Referenced by dpixEndianByteSwap().
[in] | dpixs |
Definition at line 1177 of file fpix1.c.
References dpixCreateTemplate(), dpixGetData(), and dpixGetDimensions().
Referenced by dpixEndianByteSwap(), and dpixLinearCombination().
[in] | dpixd,dpixs |
Definition at line 1419 of file fpix1.c.
References dpixGetResolution(), and dpixSetResolution().
Referenced by dpixCreateTemplate().
DPIX* dpixCreate | ( | l_int32 | width, |
l_int32 | height | ||
) |
[in] | width,height |
Notes: (1) Makes a DPix of specified size, with the data array allocated and initialized to 0. (2) The number of pixels must be less than 2^28.
Definition at line 1080 of file fpix1.c.
References dpixDestroy(), dpixSetData(), dpixSetDimensions(), dpixSetWpl(), and DPix::refcount.
Referenced by dpixCreateTemplate(), dpixReadStream(), dpixScaleByInteger(), and fpixConvertToDPix().
[in] | dpixs |
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 1130 of file fpix1.c.
References dpixCopyResolution(), dpixCreate(), and dpixGetDimensions().
Referenced by dpixCopy().
void dpixDestroy | ( | DPIX ** | pdpix | ) |
[in,out] | pdpix | will be set to null before returning |
Notes: (1) Decrements the ref count and, if 0, destroys the dpix. (2) Always nulls the input ptr.
Definition at line 1214 of file fpix1.c.
References dpixChangeRefcount(), dpixGetData(), and dpixGetRefcount().
Referenced by dpixCreate(), dpixReadStream(), and dpixWriteStream().
[in] | dpixd | [optional] can be either NULL, or equal to dpixs |
[in] | dpixs |
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 2104 of file fpix1.c.
References dpixClone(), dpixCopy(), dpixGetData(), and dpixGetDimensions().
Referenced by dpixReadStream(), and dpixWriteStream().
l_float64* dpixGetData | ( | DPIX * | dpix | ) |
[in] | dpix |
Definition at line 1441 of file fpix1.c.
References DPix::data.
Referenced by dpixAddMultConstant(), dpixConvertToFPix(), dpixConvertToPix(), dpixCopy(), dpixDestroy(), dpixEndianByteSwap(), dpixGetMax(), dpixGetMin(), dpixLinearCombination(), dpixReadStream(), dpixScaleByInteger(), dpixSetAllArbitrary(), dpixWriteStream(), and fpixConvertToDPix().
l_ok dpixGetDimensions | ( | DPIX * | dpix, |
l_int32 * | pw, | ||
l_int32 * | ph | ||
) |
[in] | dpix | |
[out] | pw,ph | [optional] each can be null |
Definition at line 1251 of file fpix1.c.
References DPix::h, and DPix::w.
Referenced by dpixAddMultConstant(), dpixConvertToFPix(), dpixConvertToPix(), dpixCopy(), dpixCreateTemplate(), dpixEndianByteSwap(), dpixGetMax(), dpixGetMin(), dpixGetPixel(), dpixLinearCombination(), dpixScaleByInteger(), dpixSetAllArbitrary(), dpixSetPixel(), and dpixWriteStream().
l_ok dpixGetPixel | ( | DPIX * | dpix, |
l_int32 | x, | ||
l_int32 | y, | ||
l_float64 * | pval | ||
) |
[in] | dpix | |
[in] | x,y | pixel coords |
[out] | pval | pixel value |
Notes: (1) If the point is outside the image, this returns an error (2), with 0.0 in pval. To avoid spamming output, it fails silently.
Definition at line 1485 of file fpix1.c.
References DPix::data, and dpixGetDimensions().
l_int32 dpixGetRefcount | ( | DPIX * | dpix | ) |
[in] | dpix |
Definition at line 1336 of file fpix1.c.
References DPix::refcount.
Referenced by dpixDestroy().
l_ok dpixGetResolution | ( | DPIX * | dpix, |
l_int32 * | pxres, | ||
l_int32 * | pyres | ||
) |
[in] | dpix | |
[out] | pxres,pyres | [optional] x and y resolution |
Definition at line 1375 of file fpix1.c.
References DPix::xres, and DPix::yres.
Referenced by dpixCopyResolution(), and dpixWriteStream().
l_int32 dpixGetWpl | ( | DPIX * | dpix | ) |
[in] | dpix |
Definition at line 1298 of file fpix1.c.
References DPix::wpl.
Referenced by dpixAddMultConstant(), dpixConvertToFPix(), dpixConvertToPix(), dpixGetMax(), dpixGetMin(), dpixLinearCombination(), dpixScaleByInteger(), and fpixConvertToDPix().
DPIX* dpixRead | ( | const char * | filename | ) |
[in] | filename |
Definition at line 1855 of file fpix1.c.
References dpixReadStream(), and fopenReadStream().
DPIX* dpixReadMem | ( | const l_uint8 * | data, |
size_t | size | ||
) |
[in] | data | of serialized dpix |
[in] | size | of data in bytes |
Definition at line 1935 of file fpix1.c.
References dpixReadStream(), and fopenReadFromMemory().
DPIX* dpixReadStream | ( | FILE * | fp | ) |
[in] | fp | file stream |
Definition at line 1882 of file fpix1.c.
References DPIX_VERSION_NUMBER, dpixCreate(), dpixDestroy(), dpixEndianByteSwap(), dpixGetData(), and dpixSetResolution().
Referenced by dpixRead(), and dpixReadMem().
l_ok dpixSetData | ( | DPIX * | dpix, |
l_float64 * | data | ||
) |
[in] | dpix | |
[in] | data |
Definition at line 1459 of file fpix1.c.
References DPix::data.
Referenced by dpixCreate().
l_ok dpixSetDimensions | ( | DPIX * | dpix, |
l_int32 | w, | ||
l_int32 | h | ||
) |
[in] | dpix | |
[in] | w,h |
Definition at line 1277 of file fpix1.c.
References DPix::h, and DPix::w.
Referenced by dpixCreate().
l_ok dpixSetPixel | ( | DPIX * | dpix, |
l_int32 | x, | ||
l_int32 | y, | ||
l_float64 | val | ||
) |
[in] | dpix | |
[in] | x,y | pixel coords |
[in] | val | pixel value |
Notes: (1) If the point is outside the image, this returns an error (2), with 0.0 in pval. To avoid spamming output, it fails silently.
Definition at line 1522 of file fpix1.c.
References DPix::data, and dpixGetDimensions().
l_ok dpixSetResolution | ( | DPIX * | dpix, |
l_int32 | xres, | ||
l_int32 | yres | ||
) |
[in] | dpix | |
[in] | xres,yres | x and y resolution |
Definition at line 1397 of file fpix1.c.
References DPix::xres, and DPix::yres.
Referenced by dpixCopyResolution(), and dpixReadStream().
l_ok dpixSetWpl | ( | DPIX * | dpix, |
l_int32 | wpl | ||
) |
[in] | dpix | |
[in] | wpl |
Definition at line 1316 of file fpix1.c.
References DPix::wpl.
Referenced by dpixCreate().
l_ok dpixWrite | ( | const char * | filename, |
DPIX * | dpix | ||
) |
[in] | filename | |
[in] | dpix |
Definition at line 1963 of file fpix1.c.
References dpixWriteStream(), and fopenWriteStream().
l_ok dpixWriteMem | ( | l_uint8 ** | pdata, |
size_t * | psize, | ||
DPIX * | dpix | ||
) |
[out] | pdata | data of serialized dpix |
[out] | psize | size of returned data |
[in] | dpix |
Notes: (1) Serializes a dpix in memory and puts the result in a buffer.
Definition at line 2041 of file fpix1.c.
References dpixWriteStream(), fopenWriteWinTempfile(), and l_binaryReadStream().
l_ok dpixWriteStream | ( | FILE * | fp, |
DPIX * | dpix | ||
) |
[in] | fp | file stream opened for "wb" |
[in] | dpix |
Definition at line 1994 of file fpix1.c.
References DPIX_VERSION_NUMBER, dpixDestroy(), dpixEndianByteSwap(), dpixGetData(), dpixGetDimensions(), and dpixGetResolution().
Referenced by dpixWrite(), and dpixWriteMem().
[in] | fpixa | |
[in] | fpix | to be added |
[in] | copyflag | L_INSERT, L_COPY, L_CLONE |
Definition at line 751 of file fpix1.c.
References FPixa::fpix, fpixaExtendArray(), fpixaGetCount(), fpixClone(), fpixCopy(), fpixDestroy(), L_CLONE, L_COPY, L_INSERT, FPixa::n, and FPixa::nalloc.
Referenced by fpixaConvertLABToXYZ(), fpixaConvertXYZToLAB(), and fpixaCopy().
l_ok fpixaChangeRefcount | ( | FPIXA * | fpixa, |
l_int32 | delta | ||
) |
[in] | fpixa | |
[in] | delta |
Definition at line 885 of file fpix1.c.
References FPixa::refcount.
Referenced by fpixaCopy(), and fpixaDestroy().
[in] | fpixa | |
[in] | copyflag | L_COPY, L_CLODE or L_COPY_CLONE |
Notes: copyflag may be one of ~ 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
Definition at line 665 of file fpix1.c.
References fpixaAddFPix(), fpixaChangeRefcount(), fpixaCreate(), fpixaGetFPix(), L_CLONE, L_COPY, L_COPY_CLONE, L_INSERT, and FPixa::n.
FPIXA* fpixaCreate | ( | l_int32 | n | ) |
[in] | n | initial number of ptrs |
Definition at line 631 of file fpix1.c.
Referenced by fpixaConvertLABToXYZ(), fpixaConvertXYZToLAB(), and fpixaCopy().
void fpixaDestroy | ( | FPIXA ** | pfpixa | ) |
[in,out] | pfpixa | will be set to null before returning |
Notes: (1) Decrements the ref count and, if 0, destroys the fpixa. (2) Always nulls the input ptr.
Definition at line 712 of file fpix1.c.
References FPixa::fpix, fpixaChangeRefcount(), fpixDestroy(), FPixa::n, and FPixa::refcount.
|
static |
[in] | fpixa |
Notes: (1) Doubles the size of the fpixa ptr array. (2) The max number of fpix ptrs is 100000.
Definition at line 803 of file fpix1.c.
References fpixaExtendArrayToSize(), and FPixa::nalloc.
Referenced by fpixaAddFPix().
|
static |
[in] | fpixa | |
[in] | size | new ptr array size |
Notes: (1) If necessary, reallocs new fpix ptr array to size. (2) The max number of fpix ptrs is 100K.
Definition at line 828 of file fpix1.c.
References FPixa::nalloc.
Referenced by fpixaExtendArray().
l_int32 fpixaGetCount | ( | FPIXA * | fpixa | ) |
[in] | fpixa |
Definition at line 866 of file fpix1.c.
References FPixa::n.
Referenced by fpixaAddFPix(), fpixaConvertLABToRGB(), fpixaConvertLABToXYZ(), fpixaConvertXYZToLAB(), fpixaConvertXYZToRGB(), fpixaDisplayQuadtree(), fpixaGetData(), fpixaGetPixel(), fpixaSetPixel(), quadtreeGetChildren(), and quadtreeGetParent().
l_float32* fpixaGetData | ( | FPIXA * | fpixa, |
l_int32 | index | ||
) |
[in] | fpixa | |
[in] | index | into fpixa array |
Definition at line 970 of file fpix1.c.
References fpixaGetCount(), fpixaGetFPix(), fpixDestroy(), fpixGetData(), and L_CLONE.
Referenced by fpixaConvertLABToXYZ(), and fpixaConvertXYZToLAB().
[in] | fpixa | |
[in] | index | to the index-th fpix |
[in] | accesstype | L_COPY or L_CLONE |
Definition at line 907 of file fpix1.c.
References FPixa::fpix, fpixClone(), fpixCopy(), L_CLONE, L_COPY, and FPixa::n.
Referenced by fpixaCopy(), fpixaDisplayQuadtree(), fpixaGetData(), fpixaGetFPixDimensions(), fpixaGetPixel(), and fpixaSetPixel().
l_ok fpixaGetFPixDimensions | ( | FPIXA * | fpixa, |
l_int32 | index, | ||
l_int32 * | pw, | ||
l_int32 * | ph | ||
) |
[in] | fpixa | |
[in] | index | to the index-th box |
[out] | pw,ph | [optional] each can be null |
Definition at line 936 of file fpix1.c.
References fpixaGetFPix(), fpixDestroy(), fpixGetDimensions(), L_CLONE, and FPixa::n.
Referenced by fpixaConvertLABToRGB(), fpixaConvertLABToXYZ(), fpixaConvertXYZToLAB(), and fpixaConvertXYZToRGB().
l_ok fpixaGetPixel | ( | FPIXA * | fpixa, |
l_int32 | index, | ||
l_int32 | x, | ||
l_int32 | y, | ||
l_float32 * | pval | ||
) |
[in] | fpixa | |
[in] | index | into fpixa array |
[in] | x,y | pixel coords |
[out] | pval | pixel value |
Definition at line 1002 of file fpix1.c.
References fpixaGetCount(), fpixaGetFPix(), fpixDestroy(), fpixGetPixel(), and L_CLONE.
Referenced by quadtreeGetChildren(), and quadtreeGetParent().
l_ok fpixaSetPixel | ( | FPIXA * | fpixa, |
l_int32 | index, | ||
l_int32 | x, | ||
l_int32 | y, | ||
l_float32 | val | ||
) |
[in] | fpixa | |
[in] | index | into fpixa array |
[in] | x,y | pixel coords |
[in] | val | pixel value |
Definition at line 1039 of file fpix1.c.
References fpixaGetCount(), fpixaGetFPix(), fpixDestroy(), fpixSetPixel(), and L_CLONE.
l_ok fpixChangeRefcount | ( | FPIX * | fpix, |
l_int32 | delta | ||
) |
[in] | fpix | |
[in] | delta |
Definition at line 432 of file fpix1.c.
References FPix::refcount.
Referenced by fpixClone(), and fpixDestroy().
[in] | fpix |
Notes: (1) See pixClone() for definition and usage.
Definition at line 236 of file fpix1.c.
References fpixChangeRefcount().
Referenced by fpixaAddFPix(), fpixAffinePta(), fpixaGetFPix(), fpixEndianByteSwap(), and fpixProjectivePta().
[in] | fpixs |
Definition at line 255 of file fpix1.c.
References fpixCreateTemplate(), fpixGetData(), and fpixGetDimensions().
Referenced by dewarpPopulateFullRes(), fpixaAddFPix(), fpixAddBorder(), fpixaGetFPix(), fpixEndianByteSwap(), fpixFlipLR(), fpixFlipTB(), fpixLinearCombination(), fpixRemoveBorder(), fpixRotate180(), and fpixRotateOrth().
[in] | fpixd,fpixs |
Definition at line 497 of file fpix1.c.
References fpixGetResolution(), and fpixSetResolution().
Referenced by fpixAddBorder(), fpixCreateTemplate(), fpixRemoveBorder(), and fpixRotate90().
FPIX* fpixCreate | ( | l_int32 | width, |
l_int32 | height | ||
) |
[in] | width,height |
Notes: (1) Makes a FPix of specified size, with the data array allocated and initialized to 0. (2) The number of pixels must be less than 2^29.
Definition at line 156 of file fpix1.c.
References fpixDestroy(), fpixSetData(), fpixSetDimensions(), fpixSetWpl(), and FPix::refcount.
Referenced by dpixConvertToFPix(), fpixaConvertLABToXYZ(), fpixaConvertXYZToLAB(), fpixAddBorder(), fpixCreateTemplate(), fpixReadStream(), fpixRemoveBorder(), fpixRotate90(), and fpixScaleByInteger().
[in] | fpixs |
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 206 of file fpix1.c.
References fpixCopyResolution(), fpixCreate(), and fpixGetDimensions().
Referenced by fpixAffine(), fpixCopy(), and fpixProjective().
void fpixDestroy | ( | FPIX ** | pfpix | ) |
[in,out] | pfpix | will be set to null before returning |
Notes: (1) Decrements the ref count and, if 0, destroys the fpix. (2) Always nulls the input ptr.
Definition at line 292 of file fpix1.c.
References fpixChangeRefcount(), fpixGetData(), and fpixGetRefcount().
Referenced by dewarpDestroy(), dewarpMinimize(), dewarpPopulateFullRes(), fpixaAddFPix(), fpixaDestroy(), fpixaDisplayQuadtree(), fpixAffinePta(), fpixaGetData(), fpixaGetFPixDimensions(), fpixaGetPixel(), fpixaSetPixel(), fpixCreate(), fpixProjectivePta(), fpixReadStream(), and fpixWriteStream().
[in] | fpixd | [optional] can be either NULL, or equal to fpixs |
[in] | fpixs |
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 1802 of file fpix1.c.
References fpixClone(), fpixCopy(), fpixGetData(), and fpixGetDimensions().
Referenced by fpixReadStream(), and fpixWriteStream().
l_float32* fpixGetData | ( | FPIX * | fpix | ) |
[in] | fpix |
Definition at line 519 of file fpix1.c.
References FPix::data.
Referenced by dpixConvertToFPix(), fpixAddMultConstant(), fpixAffine(), fpixaGetData(), fpixConvertToDPix(), fpixConvertToPix(), fpixCopy(), fpixDestroy(), fpixDisplayMaxDynamicRange(), fpixEndianByteSwap(), fpixFlipLR(), fpixFlipTB(), fpixGetMax(), fpixGetMin(), fpixLinearCombination(), fpixProjective(), fpixRasterop(), fpixReadStream(), fpixRenderContours(), fpixRotate90(), fpixScaleByInteger(), fpixSetAllArbitrary(), fpixThresholdToPix(), fpixWriteStream(), pixApplyHorizDisparity(), and pixApplyVertDisparity().
l_ok fpixGetDimensions | ( | FPIX * | fpix, |
l_int32 * | pw, | ||
l_int32 * | ph | ||
) |
[in] | fpix | |
[out] | pw,ph | [optional] each can be null |
Definition at line 329 of file fpix1.c.
References FPix::h, and FPix::w.
Referenced by dewarpPopulateFullRes(), fpixAddBorder(), fpixAddContinuedBorder(), fpixAddMirroredBorder(), fpixAddMultConstant(), fpixAddSlopeBorder(), fpixAffine(), fpixaGetFPixDimensions(), fpixConvertToDPix(), fpixConvertToPix(), fpixConvolve(), fpixCopy(), fpixCreateTemplate(), fpixDisplayMaxDynamicRange(), fpixEndianByteSwap(), fpixFlipLR(), fpixFlipTB(), fpixGetMax(), fpixGetMin(), fpixGetPixel(), fpixLinearCombination(), fpixPrintStream(), fpixProjective(), fpixRasterop(), fpixRemoveBorder(), fpixRenderContours(), fpixRotate90(), fpixScaleByInteger(), fpixSetAllArbitrary(), fpixSetPixel(), fpixThresholdToPix(), fpixWriteStream(), pixApplyHorizDisparity(), and pixApplyVertDisparity().
l_ok fpixGetPixel | ( | FPIX * | fpix, |
l_int32 | x, | ||
l_int32 | y, | ||
l_float32 * | pval | ||
) |
[in] | fpix | |
[in] | x,y | pixel coords |
[out] | pval | pixel value |
Notes: (1) If the point is outside the image, this returns an error (2), with 0.0 in pval. To avoid spamming output, it fails silently.
Definition at line 563 of file fpix1.c.
References FPix::data, and fpixGetDimensions().
Referenced by fpixAddSlopeBorder(), fpixaGetPixel(), and fpixPrintStream().
l_int32 fpixGetRefcount | ( | FPIX * | fpix | ) |
[in] | fpix |
Definition at line 414 of file fpix1.c.
References FPix::refcount.
Referenced by fpixDestroy().
l_ok fpixGetResolution | ( | FPIX * | fpix, |
l_int32 * | pxres, | ||
l_int32 * | pyres | ||
) |
[in] | fpix | |
[out] | pxres,pyres | [optional] x and y resolution |
Definition at line 453 of file fpix1.c.
References FPix::xres, and FPix::yres.
Referenced by fpixCopyResolution(), and fpixWriteStream().
l_int32 fpixGetWpl | ( | FPIX * | fpix | ) |
[in] | fpix |
Definition at line 376 of file fpix1.c.
References FPix::wpl.
Referenced by dpixConvertToFPix(), fpixaConvertLABToXYZ(), fpixaConvertXYZToLAB(), fpixAddMultConstant(), fpixAffine(), fpixConvertToDPix(), fpixConvertToPix(), fpixDisplayMaxDynamicRange(), fpixFlipLR(), fpixFlipTB(), fpixGetMax(), fpixGetMin(), fpixLinearCombination(), fpixProjective(), fpixRasterop(), fpixRenderContours(), fpixRotate90(), fpixScaleByInteger(), and fpixThresholdToPix().
l_ok fpixPrintStream | ( | FILE * | fp, |
FPIX * | fpix, | ||
l_int32 | factor | ||
) |
[in] | fp | file stream |
[in] | fpix | |
[in] | factor | for subsampling |
Notes: (1) Subsampled printout of fpix for debugging.
Definition at line 2164 of file fpix1.c.
References fpixGetDimensions(), and fpixGetPixel().
FPIX* fpixRead | ( | const char * | filename | ) |
[in] | filename |
Definition at line 1553 of file fpix1.c.
References fopenReadStream(), and fpixReadStream().
FPIX* fpixReadMem | ( | const l_uint8 * | data, |
size_t | size | ||
) |
[in] | data | of serialized fpix |
[in] | size | of data in bytes |
Definition at line 1633 of file fpix1.c.
References fopenReadFromMemory(), and fpixReadStream().
FPIX* fpixReadStream | ( | FILE * | fp | ) |
[in] | fp | file stream |
Definition at line 1580 of file fpix1.c.
References FPIX_VERSION_NUMBER, fpixCreate(), fpixDestroy(), fpixEndianByteSwap(), fpixGetData(), and fpixSetResolution().
Referenced by dewarpReadStream(), fpixRead(), and fpixReadMem().
l_ok fpixSetData | ( | FPIX * | fpix, |
l_float32 * | data | ||
) |
[in] | fpix | |
[in] | data |
Definition at line 537 of file fpix1.c.
References FPix::data.
Referenced by fpixCreate().
l_ok fpixSetDimensions | ( | FPIX * | fpix, |
l_int32 | w, | ||
l_int32 | h | ||
) |
[in] | fpix | |
[in] | w,h |
Definition at line 355 of file fpix1.c.
References FPix::h, and FPix::w.
Referenced by fpixCreate().
l_ok fpixSetPixel | ( | FPIX * | fpix, |
l_int32 | x, | ||
l_int32 | y, | ||
l_float32 | val | ||
) |
[in] | fpix | |
[in] | x,y | pixel coords |
[in] | val | pixel value |
Notes: (1) If the point is outside the image, this returns an error (2), with 0.0 in pval. To avoid spamming output, it fails silently.
Definition at line 600 of file fpix1.c.
References FPix::data, and fpixGetDimensions().
Referenced by fpixAddSlopeBorder(), and fpixaSetPixel().
l_ok fpixSetResolution | ( | FPIX * | fpix, |
l_int32 | xres, | ||
l_int32 | yres | ||
) |
[in] | fpix | |
[in] | xres,yres | x and y resolution |
Definition at line 475 of file fpix1.c.
References FPix::xres, and FPix::yres.
Referenced by fpixCopyResolution(), and fpixReadStream().
l_ok fpixSetWpl | ( | FPIX * | fpix, |
l_int32 | wpl | ||
) |
[in] | fpix | |
[in] | wpl |
Definition at line 394 of file fpix1.c.
References FPix::wpl.
Referenced by fpixCreate().
l_ok fpixWrite | ( | const char * | filename, |
FPIX * | fpix | ||
) |
[in] | filename | |
[in] | fpix |
Definition at line 1661 of file fpix1.c.
References fopenWriteStream(), and fpixWriteStream().
l_ok fpixWriteMem | ( | l_uint8 ** | pdata, |
size_t * | psize, | ||
FPIX * | fpix | ||
) |
[out] | pdata | data of serialized fpix |
[out] | psize | size of returned data |
[in] | fpix |
Notes: (1) Serializes a fpix in memory and puts the result in a buffer.
Definition at line 1739 of file fpix1.c.
References fopenWriteWinTempfile(), fpixWriteStream(), and l_binaryReadStream().
l_ok fpixWriteStream | ( | FILE * | fp, |
FPIX * | fpix | ||
) |
[in] | fp | file stream opened for "wb" |
[in] | fpix |
Definition at line 1692 of file fpix1.c.
References FPIX_VERSION_NUMBER, fpixDestroy(), fpixEndianByteSwap(), fpixGetData(), fpixGetDimensions(), and fpixGetResolution().
Referenced by dewarpWriteStream(), fpixWrite(), and fpixWriteMem().