![]() |
Leptonica
1.83.1
Image processing and image analysis suite
|
Go to the source code of this file.
Functions | |
static l_int32 | ptaExtendArrays (PTA *pta) |
static l_int32 | ptaaExtendArray (PTAA *ptaa) |
PTA * | ptaCreate (l_int32 n) |
PTA * | ptaCreateFromNuma (NUMA *nax, NUMA *nay) |
void | ptaDestroy (PTA **ppta) |
PTA * | ptaCopy (PTA *pta) |
PTA * | ptaCopyRange (PTA *ptas, l_int32 istart, l_int32 iend) |
PTA * | ptaClone (PTA *pta) |
l_ok | ptaEmpty (PTA *pta) |
l_ok | ptaAddPt (PTA *pta, l_float32 x, l_float32 y) |
l_ok | ptaInsertPt (PTA *pta, l_int32 index, l_int32 x, l_int32 y) |
l_ok | ptaRemovePt (PTA *pta, l_int32 index) |
l_int32 | ptaGetCount (PTA *pta) |
l_ok | ptaGetPt (PTA *pta, l_int32 index, l_float32 *px, l_float32 *py) |
l_ok | ptaGetIPt (PTA *pta, l_int32 index, l_int32 *px, l_int32 *py) |
l_ok | ptaSetPt (PTA *pta, l_int32 index, l_float32 x, l_float32 y) |
l_ok | ptaGetArrays (PTA *pta, NUMA **pnax, NUMA **pnay) |
PTA * | ptaRead (const char *filename) |
PTA * | ptaReadStream (FILE *fp) |
PTA * | ptaReadMem (const l_uint8 *data, size_t size) |
l_ok | ptaWriteDebug (const char *filename, PTA *pta, l_int32 type) |
l_ok | ptaWrite (const char *filename, PTA *pta, l_int32 type) |
l_ok | ptaWriteStream (FILE *fp, PTA *pta, l_int32 type) |
l_ok | ptaWriteMem (l_uint8 **pdata, size_t *psize, PTA *pta, l_int32 type) |
PTAA * | ptaaCreate (l_int32 n) |
void | ptaaDestroy (PTAA **pptaa) |
l_ok | ptaaAddPta (PTAA *ptaa, PTA *pta, l_int32 copyflag) |
l_int32 | ptaaGetCount (PTAA *ptaa) |
PTA * | ptaaGetPta (PTAA *ptaa, l_int32 index, l_int32 accessflag) |
l_ok | ptaaGetPt (PTAA *ptaa, l_int32 ipta, l_int32 jpt, l_float32 *px, l_float32 *py) |
l_ok | ptaaInitFull (PTAA *ptaa, PTA *pta) |
l_ok | ptaaReplacePta (PTAA *ptaa, l_int32 index, PTA *pta) |
l_ok | ptaaAddPt (PTAA *ptaa, l_int32 ipta, l_float32 x, l_float32 y) |
l_ok | ptaaTruncate (PTAA *ptaa) |
PTAA * | ptaaRead (const char *filename) |
PTAA * | ptaaReadStream (FILE *fp) |
PTAA * | ptaaReadMem (const l_uint8 *data, size_t size) |
l_ok | ptaaWriteDebug (const char *filename, PTAA *ptaa, l_int32 type) |
l_ok | ptaaWrite (const char *filename, PTAA *ptaa, l_int32 type) |
l_ok | ptaaWriteStream (FILE *fp, PTAA *ptaa, l_int32 type) |
l_ok | ptaaWriteMem (l_uint8 **pdata, size_t *psize, PTAA *ptaa, l_int32 type) |
Variables | |
static const l_uint32 | MaxArraySize = 100000000 |
static const l_uint32 | MaxPtrArraySize = 10000000 |
static const l_int32 | InitialArraySize = 50 |
Pta creation, destruction, copy, clone, empty PTA *ptaCreate() PTA *ptaCreateFromNuma() void ptaDestroy() PTA *ptaCopy() PTA *ptaCopyRange() PTA *ptaClone() l_int32 ptaEmpty() Pta array extension l_int32 ptaAddPt() static l_int32 ptaExtendArrays() Pta insertion and removal l_int32 ptaInsertPt() l_int32 ptaRemovePt() Pta accessors l_int32 ptaGetCount() l_int32 ptaGetPt() l_int32 ptaGetIPt() l_int32 ptaSetPt() l_int32 ptaGetArrays() Pta serialized for I/O PTA *ptaRead() PTA *ptaReadStream() PTA *ptaReadMem() l_int32 ptaWriteDebug() l_int32 ptaWrite() l_int32 ptaWriteStream() l_int32 ptaWriteMem() Ptaa creation, destruction PTAA *ptaaCreate() void ptaaDestroy() Ptaa array extension l_int32 ptaaAddPta() static l_int32 ptaaExtendArray() Ptaa accessors l_int32 ptaaGetCount() l_int32 ptaaGetPta() l_int32 ptaaGetPt() Ptaa array modifiers l_int32 ptaaInitFull() l_int32 ptaaReplacePta() l_int32 ptaaAddPt() l_int32 ptaaTruncate() Ptaa serialized for I/O PTAA *ptaaRead() PTAA *ptaaReadStream() PTAA *ptaaReadMem() l_int32 ptaaWrite() l_int32 ptaaWriteStream() l_int32 ptaaWriteMem()
Definition in file ptabasic.c.
l_ok ptaaAddPt | ( | PTAA * | ptaa, |
l_int32 | ipta, | ||
l_float32 | x, | ||
l_float32 | y | ||
) |
[in] | ptaa | |
[in] | ipta | to the i-th pta |
[in] | x,y | point coordinates |
Definition at line 1197 of file ptabasic.c.
References L_CLONE, Ptaa::n, ptaAddPt(), ptaaGetPta(), and ptaDestroy().
Referenced by recogTrainingFinished().
[in] | ptaa | |
[in] | pta | to be added |
[in] | copyflag | L_INSERT, L_COPY, L_CLONE |
Definition at line 963 of file ptabasic.c.
References L_CLONE, L_COPY, L_INSERT, Ptaa::n, Ptaa::nalloc, Ptaa::pta, ptaaExtendArray(), ptaaGetCount(), ptaClone(), ptaCopy(), and ptaDestroy().
Referenced by ccbaGenerateGlobalLocs(), dewarpFindVertDisparity(), generatePtaaBoxa(), generatePtaaHashBoxa(), pixGetHoleBorder(), pixGetOuterBorder(), ptaaJoin(), and ptaaSortByIndex().
PTAA* ptaaCreate | ( | l_int32 | n | ) |
[in] | n | initial number of ptrs |
Definition at line 905 of file ptabasic.c.
Referenced by ccbaGenerateGlobalLocs(), dewarpFindVertDisparity(), generatePtaaBoxa(), generatePtaaHashBoxa(), ptaaSortByIndex(), and recogTrainingFinished().
l_ok ptaAddPt | ( | PTA * | pta, |
l_float32 | x, | ||
l_float32 | y | ||
) |
[in] | pta | |
[in] | x,y |
Definition at line 328 of file ptabasic.c.
References Pta::n, Pta::nalloc, ptaExtendArrays(), and Pta::y.
Referenced by boxaExtractAsPta(), boxaExtractCorners(), boxConvertToPta(), boxIntersectByLine(), ccbaGenerateGlobalLocs(), ccbaReadStream(), convertPtaLineTo4cc(), dewarpFindVertDisparity(), generatePtaaBoxa(), generatePtaFilledCircle(), generatePtaFilledSquare(), generatePtaLine(), getCutPathForHole(), makeColorfillTestData(), makePlotPtaFromNumaGen(), numaConvertToPta1(), numaConvertToPta2(), pixaAccumulateSamples(), pixaCentroids(), pixGetHoleBorder(), pixGetOuterBorder(), ptaaAddPt(), ptaAffineTransform(), ptaCopy(), ptaCopyRange(), ptaCreateFromNuma(), ptaCyclicPerm(), ptaGetInsideBox(), ptaGetNeighborPixLocs(), ptaIntersectionByHmap(), ptaJoin(), ptaNoisyLinearLSF(), ptaNoisyQuadraticLSF(), ptaRemoveDupsByHmap(), ptaReplicatePattern(), ptaReverse(), ptaRotate(), ptaScale(), ptaSelectByValue(), ptaSelectRange(), ptaSort2d(), ptaSortByIndex(), ptaSubsample(), ptaTransform(), ptaTranslate(), ptaTranspose(), and recogAverageSamples().
void ptaaDestroy | ( | PTAA ** | pptaa | ) |
[in,out] | pptaa | will be set to null before returning |
Definition at line 930 of file ptabasic.c.
References Ptaa::n, Ptaa::pta, and ptaDestroy().
Referenced by ccbaGenerateGlobalLocs(), ccbDestroy(), recogDestroy(), and recogTrainingFinished().
|
static |
[in] | ptaa |
Notes: (1) This doubles the pta ptr array size. (2) The max number of pta ptrs is 10M.
Definition at line 1016 of file ptabasic.c.
References Ptaa::nalloc.
Referenced by ptaaAddPta().
l_int32 ptaaGetCount | ( | PTAA * | ptaa | ) |
[in] | ptaa |
Definition at line 1046 of file ptabasic.c.
References Ptaa::n.
Referenced by ccbaDisplayBorder(), ccbaDisplayImage1(), ccbaDisplayImage2(), ccbaGenerateGlobalLocs(), ccbaGenerateSinglePath(), ccbaGenerateStepChains(), dewarpFindVertDisparity(), dewarpGetLineEndPoints(), dewarpIsLineCoverageValid(), pixDisplayPtaa(), pixRenderRandomCmapPtaa(), ptaaAddPta(), ptaaJoin(), ptaaReplacePta(), ptaaSortByIndex(), ptaaTruncate(), and ptaaWriteStream().
l_ok ptaaGetPt | ( | PTAA * | ptaa, |
l_int32 | ipta, | ||
l_int32 | jpt, | ||
l_float32 * | px, | ||
l_float32 * | py | ||
) |
[in] | ptaa | |
[in] | ipta | to the i-th pta |
[in] | jpt | index to the j-th pt in the pta |
[out] | px | [optional] float x value |
[out] | py | [optional] float y value |
Definition at line 1093 of file ptabasic.c.
References L_CLONE, Pta::n, Ptaa::n, ptaaGetPta(), ptaDestroy(), and ptaGetPt().
Referenced by dewarpIsLineCoverageValid().
[in] | ptaa | |
[in] | index | to the i-th pta |
[in] | accessflag | L_COPY or L_CLONE |
Definition at line 1064 of file ptabasic.c.
References L_CLONE, L_COPY, Ptaa::n, Ptaa::pta, ptaClone(), and ptaCopy().
Referenced by ccbaDisplayBorder(), ccbaDisplayImage1(), ccbaDisplayImage2(), ccbaGenerateGlobalLocs(), ccbaGenerateSinglePath(), ccbaGenerateStepChains(), dewarpFindVertDisparity(), pixDisplayPtaa(), pixRenderRandomCmapPtaa(), ptaaAddPt(), ptaaGetPt(), ptaaJoin(), ptaaSortByIndex(), ptaaTruncate(), ptaaWriteStream(), and recogAverageSamples().
[in] | ptaa | can have non-null ptrs in the ptr array |
[in] | pta | to be replicated into the entire ptr array |
Definition at line 1131 of file ptabasic.c.
References Ptaa::n, Ptaa::nalloc, ptaaReplacePta(), and ptaCopy().
Referenced by recogTrainingFinished().
PTAA* ptaaRead | ( | const char * | filename | ) |
[in] | filename |
Definition at line 1268 of file ptabasic.c.
References fopenReadStream(), and ptaaReadStream().
PTAA* ptaaReadMem | ( | const l_uint8 * | data, |
size_t | size | ||
) |
[in] | data | serialization in ascii |
[in] | size | of data in bytes; can use strlen to get it |
Definition at line 1341 of file ptabasic.c.
References fopenReadFromMemory(), and ptaaReadStream().
PTAA* ptaaReadStream | ( | FILE * | fp | ) |
[in] | fp | file stream |
Notes: (1) It is OK for the ptaa to be empty (n == 0).
Definition at line 1298 of file ptabasic.c.
References PTA_VERSION_NUMBER.
Referenced by ptaaRead(), and ptaaReadMem().
[in] | ptaa | |
[in] | index | to the index-th pta |
[in] | pta | insert and replace any existing one |
Notes: (1) Any existing pta is destroyed, and the input one is inserted in its place. (2) If index is invalid, return 1 (error)
Definition at line 1168 of file ptabasic.c.
References Ptaa::pta, ptaaGetCount(), and ptaDestroy().
Referenced by ptaaInitFull().
l_ok ptaaTruncate | ( | PTAA * | ptaa | ) |
[in] | ptaa |
Notes: (1) This identifies the largest index containing a pta that has any points within it, destroys all pta above that index, and resets the count.
Definition at line 1230 of file ptabasic.c.
References L_CLONE, Ptaa::n, Ptaa::pta, ptaaGetCount(), ptaaGetPta(), ptaDestroy(), and ptaGetCount().
Referenced by recogTrainingFinished().
l_ok ptaaWrite | ( | const char * | filename, |
PTAA * | ptaa, | ||
l_int32 | type | ||
) |
[in] | filename | |
[in] | ptaa | |
[in] | type | 0 for float values; 1 for integer values |
Definition at line 1399 of file ptabasic.c.
References fopenWriteStream(), and ptaaWriteStream().
Referenced by ptaaWriteDebug().
l_ok ptaaWriteDebug | ( | const char * | filename, |
PTAA * | ptaa, | ||
l_int32 | type | ||
) |
[in] | filename | |
[in] | ptaa | |
[in] | type | 0 for float values; 1 for integer values |
Notes: (1) Debug version, intended for use in the library when writing to files in a temp directory with names that are compiled in. This is used instead of ptaaWrite() for all such library calls. (2) The global variable LeptDebugOK defaults to 0, and can be set or cleared by the function setLeptDebugOK().
Definition at line 1377 of file ptabasic.c.
References ptaaWrite().
l_ok ptaaWriteMem | ( | l_uint8 ** | pdata, |
size_t * | psize, | ||
PTAA * | ptaa, | ||
l_int32 | type | ||
) |
[out] | pdata | data of serialized ptaa; ascii |
[out] | psize | size of returned data |
[in] | ptaa | |
[in] | type | 0 for float values; 1 for integer values |
Notes: (1) Serializes ptaa in memory and puts the result in a buffer.
Definition at line 1470 of file ptabasic.c.
References fopenWriteWinTempfile(), l_binaryReadStream(), and ptaaWriteStream().
l_ok ptaaWriteStream | ( | FILE * | fp, |
PTAA * | ptaa, | ||
l_int32 | type | ||
) |
[in] | fp | file stream |
[in] | ptaa | |
[in] | type | 0 for float values; 1 for integer values |
Definition at line 1430 of file ptabasic.c.
References L_CLONE, PTA_VERSION_NUMBER, ptaaGetCount(), ptaaGetPta(), ptaDestroy(), and ptaWriteStream().
Referenced by ptaaWrite(), and ptaaWriteMem().
[in] | pta |
Definition at line 286 of file ptabasic.c.
References Pta::refcount.
Referenced by fpixAffinePta(), fpixProjectivePta(), generatePtaBoxa(), generatePtaHashBoxa(), generatePtaPolyline(), makePlotPtaFromNumaGen(), pixaAccumulateSamples(), pixRenderPolygon(), pixRenderRandomCmapPtaa(), ptaaAddPta(), ptaaGetPta(), and ptaReplicatePattern().
[in] | pta |
Definition at line 219 of file ptabasic.c.
References Pta::n, Pta::nalloc, ptaAddPt(), ptaCreate(), and ptaGetPt().
Referenced by ptaaAddPta(), ptaaGetPta(), ptaaInitFull(), ptaSelectByValue(), ptaSelectRange(), ptaUnionByAset(), and ptaUnionByHmap().
[in] | ptas | |
[in] | istart | starting index in ptas |
[in] | iend | ending index in ptas; use 0 to copy to end |
Definition at line 249 of file ptabasic.c.
References ptaAddPt(), ptaCreate(), ptaGetCount(), and ptaGetIPt().
PTA* ptaCreate | ( | l_int32 | n | ) |
[in] | n | initial array sizes |
Definition at line 120 of file ptabasic.c.
Referenced by boxaConvertToPta(), boxaExtractAsPta(), boxaExtractCorners(), boxConvertToPta(), boxIntersectByLine(), ccbaGenerateGlobalLocs(), ccbaGenerateSinglePath(), ccbaGenerateSPGlobalLocs(), convertPtaLineTo4cc(), dewarpFindVertDisparity(), generatePtaaBoxa(), generatePtaBox(), generatePtaBoxa(), generatePtaFilledCircle(), generatePtaFilledSquare(), generatePtaHashBox(), generatePtaHashBoxa(), generatePtaLine(), generatePtaPolyline(), getCutPathForHole(), makeColorfillTestData(), makePlotPtaFromNumaGen(), numaConvertToPta1(), numaConvertToPta2(), pixaAccumulateSamples(), pixaCentroids(), pixGetHoleBorder(), pixGetOuterBorder(), ptaAffineTransform(), ptaCopy(), ptaCopyRange(), ptaCreateFromNuma(), ptaCyclicPerm(), ptaGetInsideBox(), ptaGetNeighborPixLocs(), ptaIntersectionByAset(), ptaIntersectionByHmap(), ptaNoisyLinearLSF(), ptaNoisyQuadraticLSF(), ptaRemoveDupsByHmap(), ptaReplicatePattern(), ptaReverse(), ptaRotate(), ptaScale(), ptaSelectByValue(), ptaSelectRange(), ptaSort2d(), ptaSortByIndex(), ptaSubsample(), ptaTransform(), ptaTranslate(), ptaTranspose(), recogAverageSamples(), and recogTrainingFinished().
[in] | nax | [optional] can be null |
[in] | nay |
Definition at line 150 of file ptabasic.c.
References numaGetCount(), numaGetFValue(), numaGetParameters(), ptaAddPt(), and ptaCreate().
Referenced by dewarpFindVertDisparity().
void ptaDestroy | ( | PTA ** | ppta | ) |
[in,out] | ppta | will be set to null before returning |
Notes: (1) Decrements the ref count and, if 0, destroys the pta. (2) Always nulls the input ptr.
Definition at line 191 of file ptabasic.c.
References Pta::refcount, and Pta::y.
Referenced by boxaAffineTransform(), boxaConvertToPta(), boxaRotate(), boxaScale(), boxaTranslate(), boxIntersectByLine(), ccbaDisplayBorder(), ccbaDisplayImage1(), ccbaDisplayImage2(), ccbaGenerateGlobalLocs(), ccbaGenerateSinglePath(), ccbaGenerateSPGlobalLocs(), ccbaGenerateStepChains(), ccbDestroy(), dewarpFindVertDisparity(), fpixAffinePta(), fpixProjectivePta(), generatePtaBox(), generatePtaBoxa(), generatePtaHashBox(), generatePtaHashBoxa(), generatePtaPolyline(), generatePtaWideLine(), makeColorfillTestData(), makePlotPtaFromNumaGen(), pixDisplayPtaa(), pixRenderBox(), pixRenderBoxa(), pixRenderBoxaArb(), pixRenderBoxaBlend(), pixRenderBoxArb(), pixRenderBoxBlend(), pixRenderGridArb(), pixRenderHashBox(), pixRenderHashBoxa(), pixRenderHashBoxaArb(), pixRenderHashBoxaBlend(), pixRenderHashBoxArb(), pixRenderHashBoxBlend(), pixRenderHorizEndPoints(), pixRenderLine(), pixRenderLineArb(), pixRenderLineBlend(), pixRenderPolygon(), pixRenderPolyline(), pixRenderPolylineArb(), pixRenderPolylineBlend(), pixRenderRandomCmapPtaa(), ptaaAddPt(), ptaaAddPta(), ptaaDestroy(), ptaaGetPt(), ptaaReplacePta(), ptaaTruncate(), ptaaWriteStream(), ptaEqual(), ptaGetRankValue(), ptaNoisyLinearLSF(), ptaNoisyQuadraticLSF(), ptaReplicatePattern(), ptaSort2d(), ptaUnionByAset(), ptaUnionByHmap(), recogAverageSamples(), recogDestroy(), recogTrainingFinished(), selaAddCrossJunctions(), selaAddTJunctions(), and wshedDestroy().
l_ok ptaEmpty | ( | PTA * | pta | ) |
[in] | pta |
Notes: This only resets the Pta::n field, for reuse
Definition at line 308 of file ptabasic.c.
References Pta::n.
Referenced by getCutPathForHole().
|
static |
[in] | pta |
Notes: (1) Doubles the size of the array. (2) The max number of points is 100M.
Definition at line 363 of file ptabasic.c.
References Pta::nalloc.
Referenced by ptaAddPt(), and ptaInsertPt().
[in] | pta | |
[out] | pnax | [optional] numa of x array |
[out] | pnay | [optional] numa of y array |
Notes: (1) This copies the internal arrays into new Numas.
Definition at line 584 of file ptabasic.c.
References Numa::array, Numa::n, numaCreate(), ptaGetCount(), and Pta::y.
Referenced by dewarpFindVertDisparity().
l_int32 ptaGetCount | ( | PTA * | pta | ) |
[in] | pta |
Definition at line 480 of file ptabasic.c.
References Pta::n.
Referenced by boxaShiftWithPta(), boxIntersectByLine(), ccbaDisplayBorder(), ccbaDisplayImage1(), ccbaDisplayImage2(), ccbaDisplaySPBorder(), ccbaGenerateGlobalLocs(), ccbaGenerateSPGlobalLocs(), ccbaGenerateStepChains(), ccbaWriteSVGString(), convertPtaLineTo4cc(), dewarpLinearLSF(), dewarpQuadraticLSF(), generatePtaPolyline(), getCutPathForHole(), l_hmapCreateFromPta(), pixaAccumulateSamples(), pixAffinePta(), pixAffineSampledPta(), pixAffineSequential(), pixBilinearPta(), pixBilinearSampledPta(), pixDisplayPtaa(), pixGenerateFromPta(), pixProjectivePta(), pixProjectiveSampledPta(), ptaAffineTransform(), ptaaTruncate(), ptaContainsPt(), ptaConvertToBox(), ptaConvertToBoxa(), ptaConvertToNuma(), ptaCopyRange(), ptaCyclicPerm(), ptaEqual(), ptaGetArrays(), ptaGetBoundingRegion(), ptaGetCubicLSF(), ptaGetInsideBox(), ptaGetLinearLSF(), ptaGetMinMax(), ptaGetQuadraticLSF(), ptaGetQuarticLSF(), ptaGetRange(), ptaGetRankValue(), ptaGetSortIndex(), ptaInsertPt(), ptaIntersectionByAset(), ptaIntersectionByHmap(), ptaJoin(), ptaNoisyLinearLSF(), ptaNoisyQuadraticLSF(), ptaPolygonIsConvex(), ptaPtInsidePolygon(), ptaRemovePt(), ptaReplicatePattern(), ptaReverse(), ptaRotate(), ptaScale(), ptaSelectByValue(), ptaSelectRange(), ptaSort2d(), ptaSubsample(), ptaTestIntersection(), ptaTransform(), ptaTranslate(), ptaTranspose(), ptaWriteStream(), selCreateFromPta(), and wshedApply().
l_ok ptaGetIPt | ( | PTA * | pta, |
l_int32 | index, | ||
l_int32 * | px, | ||
l_int32 * | py | ||
) |
[in] | pta | |
[in] | index | into arrays |
[out] | px | [optional] integer x value |
[out] | py | [optional] integer y value |
Definition at line 527 of file ptabasic.c.
References Pta::n, and Pta::y.
Referenced by boxaShiftWithPta(), boxIntersectByLine(), ccbaDisplayBorder(), ccbaDisplayImage1(), ccbaDisplayImage2(), ccbaDisplaySPBorder(), ccbaGenerateGlobalLocs(), ccbaGenerateStepChains(), ccbaWriteSVGString(), convertPtaLineTo4cc(), generatePtaPolyline(), getCutPathForHole(), identifyWatershedBasin(), l_hmapCreateFromPta(), makeColorfillTestData(), pixAffineSequential(), pixDisplayPtaa(), pixGenerateFromPta(), ptaContainsPt(), ptaConvertToBox(), ptaConvertToBoxa(), ptaCopyRange(), ptaCyclicPerm(), ptaGetBoundingRegion(), ptaIntersectionByHmap(), ptaJoin(), ptaRemoveDupsByHmap(), ptaReplicatePattern(), ptaReverse(), ptaTestIntersection(), ptaTransform(), ptaWriteStream(), recogMakeDecodingArray(), selCreateFromPta(), and wshedApply().
l_ok ptaGetPt | ( | PTA * | pta, |
l_int32 | index, | ||
l_float32 * | px, | ||
l_float32 * | py | ||
) |
[in] | pta | |
[in] | index | into arrays |
[out] | px | [optional] float x value |
[out] | py | [optional] float y value |
Definition at line 499 of file ptabasic.c.
References Pta::n, and Pta::y.
Referenced by dewarpLinearLSF(), dewarpQuadraticLSF(), getAffineXformCoeffs(), getBilinearXformCoeffs(), getProjectiveXformCoeffs(), pixaAccumulateSamples(), ptaAffineTransform(), ptaaGetPt(), ptaConvertToNuma(), ptaCopy(), ptaEqual(), ptaGetInsideBox(), ptaGetMinMax(), ptaGetRange(), ptaGetRankValue(), ptaGetSortIndex(), ptaNoisyLinearLSF(), ptaNoisyQuadraticLSF(), ptaPolygonIsConvex(), ptaPtInsidePolygon(), ptaReverse(), ptaRotate(), ptaScale(), ptaSelectByValue(), ptaSelectRange(), ptaSort2d(), ptaSortByIndex(), ptaSubsample(), ptaTranslate(), ptaTranspose(), ptaWriteStream(), and recogShowAverageTemplates().
l_ok ptaInsertPt | ( | PTA * | pta, |
l_int32 | index, | ||
l_int32 | x, | ||
l_int32 | y | ||
) |
[in] | pta | |
[in] | index | at which pt is to be inserted |
[in] | x,y | point values |
Definition at line 402 of file ptabasic.c.
References Pta::n, Pta::nalloc, ptaExtendArrays(), ptaGetCount(), and Pta::y.
PTA* ptaRead | ( | const char * | filename | ) |
[in] | filename |
Definition at line 630 of file ptabasic.c.
References fopenReadStream(), and ptaReadStream().
PTA* ptaReadMem | ( | const l_uint8 * | data, |
size_t | size | ||
) |
[in] | data | serialization in ascii |
[in] | size | of data in bytes; can use strlen to get it |
Definition at line 717 of file ptabasic.c.
References fopenReadFromMemory(), and ptaReadStream().
PTA* ptaReadStream | ( | FILE * | fp | ) |
[in] | fp | file stream |
Notes: (1) It is OK for the pta to be empty (n == 0).
Definition at line 661 of file ptabasic.c.
References PTA_VERSION_NUMBER.
Referenced by ptaRead(), and ptaReadMem().
l_ok ptaRemovePt | ( | PTA * | pta, |
l_int32 | index | ||
) |
[in] | pta | |
[in] | index | of point to be removed |
Notes: (1) This shifts pta[i] --> pta[i - 1] for all i > index. (2) It should not be used repeatedly on large arrays, because the function is O(n).
Definition at line 447 of file ptabasic.c.
References Pta::n, ptaGetCount(), and Pta::y.
l_ok ptaSetPt | ( | PTA * | pta, |
l_int32 | index, | ||
l_float32 | x, | ||
l_float32 | y | ||
) |
[in] | pta | |
[in] | index | into arrays |
[in] | x,y |
Definition at line 554 of file ptabasic.c.
l_ok ptaWrite | ( | const char * | filename, |
PTA * | pta, | ||
l_int32 | type | ||
) |
[in] | filename | |
[in] | pta | |
[in] | type | 0 for float values; 1 for integer values |
Definition at line 775 of file ptabasic.c.
References fopenWriteStream(), and ptaWriteStream().
Referenced by ptaWriteDebug().
l_ok ptaWriteDebug | ( | const char * | filename, |
PTA * | pta, | ||
l_int32 | type | ||
) |
[in] | filename | |
[in] | pta | |
[in] | type | 0 for float values; 1 for integer values |
Notes: (1) Debug version, intended for use in the library when writing to files in a temp directory with names that are compiled in. This is used instead of ptaWrite() for all such library calls. (2) The global variable LeptDebugOK defaults to 0, and can be set or cleared by the function setLeptDebugOK().
Definition at line 753 of file ptabasic.c.
References ptaWrite().
l_ok ptaWriteMem | ( | l_uint8 ** | pdata, |
size_t * | psize, | ||
PTA * | pta, | ||
l_int32 | type | ||
) |
[out] | pdata | data of serialized pta; ascii |
[out] | psize | size of returned data |
[in] | pta | |
[in] | type | 0 for float values; 1 for integer values |
Notes: (1) Serializes a pta in memory and puts the result in a buffer.
Definition at line 853 of file ptabasic.c.
References fopenWriteWinTempfile(), l_binaryReadStream(), and ptaWriteStream().
l_ok ptaWriteStream | ( | FILE * | fp, |
PTA * | pta, | ||
l_int32 | type | ||
) |
[in] | fp | file stream |
[in] | pta | |
[in] | type | 0 for float values; 1 for integer values |
Definition at line 806 of file ptabasic.c.
References PTA_VERSION_NUMBER, ptaGetCount(), ptaGetIPt(), and ptaGetPt().
Referenced by ptaaWriteStream(), ptaWrite(), and ptaWriteMem().
|
static |
n'importe quoi
Definition at line 104 of file ptabasic.c.