![]() |
Leptonica
1.73
Image processing and image analysis suite
|
#include <string.h>#include "allheaders.h"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_int32 | ptaEmpty (PTA *pta) |
| l_int32 | ptaAddPt (PTA *pta, l_float32 x, l_float32 y) |
| l_int32 | ptaInsertPt (PTA *pta, l_int32 index, l_int32 x, l_int32 y) |
| l_int32 | ptaRemovePt (PTA *pta, l_int32 index) |
| l_int32 | ptaGetRefcount (PTA *pta) |
| l_int32 | ptaChangeRefcount (PTA *pta, l_int32 delta) |
| l_int32 | ptaGetCount (PTA *pta) |
| l_int32 | ptaGetPt (PTA *pta, l_int32 index, l_float32 *px, l_float32 *py) |
| l_int32 | ptaGetIPt (PTA *pta, l_int32 index, l_int32 *px, l_int32 *py) |
| l_int32 | ptaSetPt (PTA *pta, l_int32 index, l_float32 x, l_float32 y) |
| l_int32 | 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_int32 | ptaWrite (const char *filename, PTA *pta, l_int32 type) |
| l_int32 | ptaWriteStream (FILE *fp, PTA *pta, l_int32 type) |
| l_int32 | ptaWriteMem (l_uint8 **pdata, size_t *psize, PTA *pta, l_int32 type) |
| PTAA * | ptaaCreate (l_int32 n) |
| void | ptaaDestroy (PTAA **pptaa) |
| l_int32 | ptaaAddPta (PTAA *ptaa, PTA *pta, l_int32 copyflag) |
| l_int32 | ptaaGetCount (PTAA *ptaa) |
| PTA * | ptaaGetPta (PTAA *ptaa, l_int32 index, l_int32 accessflag) |
| l_int32 | ptaaGetPt (PTAA *ptaa, l_int32 ipta, l_int32 jpt, l_float32 *px, l_float32 *py) |
| l_int32 | ptaaInitFull (PTAA *ptaa, PTA *pta) |
| l_int32 | ptaaReplacePta (PTAA *ptaa, l_int32 index, PTA *pta) |
| l_int32 | ptaaAddPt (PTAA *ptaa, l_int32 ipta, l_float32 x, l_float32 y) |
| l_int32 | ptaaTruncate (PTAA *ptaa) |
| PTAA * | ptaaRead (const char *filename) |
| PTAA * | ptaaReadStream (FILE *fp) |
| PTAA * | ptaaReadMem (const l_uint8 *data, size_t size) |
| l_int32 | ptaaWrite (const char *filename, PTAA *ptaa, l_int32 type) |
| l_int32 | ptaaWriteStream (FILE *fp, PTAA *ptaa, l_int32 type) |
| l_int32 | ptaaWriteMem (l_uint8 **pdata, size_t *psize, PTAA *ptaa, l_int32 type) |
Variables | |
| static const l_int32 | INITIAL_PTR_ARRAYSIZE = 20 |
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 ptaGetRefcount()
l_int32 ptaChangeRefcount()
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 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_int32 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 1201 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 970 of file ptabasic.c.
References L_CLONE, L_COPY, L_INSERT, Ptaa::n, Ptaa::nalloc, Ptaa::pta, ptaaExtendArray(), ptaaGetCount(), ptaClone(), and ptaCopy().
Referenced by ccbaGenerateGlobalLocs(), dewarpFindVertDisparity(), generatePtaaBoxa(), generatePtaaHashBoxa(), pixGetHoleBorder(), pixGetOuterBorder(), ptaaJoin(), ptaaReadStream(), 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(), ptaaReadStream(), ptaaSortByIndex(), and recogTrainingFinished().
| l_int32 ptaAddPt | ( | PTA * | pta, |
| l_float32 | x, | ||
| l_float32 | y | ||
| ) |
| [in] | pta | |
| [in] | x,y |
Definition at line 341 of file ptabasic.c.
References Pta::n, Pta::nalloc, ptaExtendArrays(), and Pta::y.
Referenced by boxaExtractAsPta(), boxConvertToPta(), boxIntersectByLine(), ccbaGenerateGlobalLocs(), ccbaReadStream(), convertPtaLineTo4cc(), dewarpFindVertDisparity(), generatePtaaBoxa(), generatePtaFilledCircle(), generatePtaFilledSquare(), generatePtaLine(), makePlotPtaFromNumaGen(), numaConvertToPta1(), numaConvertToPta2(), pixaAccumulateSamples(), pixaCentroids(), pixGetHoleBorder(), pixGetOuterBorder(), ptaaAddPt(), ptaAffineTransform(), ptaCopy(), ptaCopyRange(), ptaCreateFromNuma(), ptaCyclicPerm(), ptaGetInsideBox(), ptaGetNeighborPixLocs(), ptaIntersectionByHash(), ptaJoin(), ptaNoisyLinearLSF(), ptaNoisyQuadraticLSF(), ptaReadStream(), ptaRemoveDupsByHash(), ptaReplicatePattern(), ptaReverse(), ptaRotate(), ptaScale(), ptaSelectByValue(), ptaSelectRange(), ptaSortByIndex(), ptaSubsample(), ptaTransform(), ptaTranslate(), ptaTranspose(), and recogAverageSamples().
| void ptaaDestroy | ( | PTAA ** | pptaa | ) |
| [in,out] | pptaa | to be nulled |
Definition at line 933 of file ptabasic.c.
References Ptaa::n, Ptaa::pta, and ptaDestroy().
Referenced by ccbaGenerateGlobalLocs(), ccbDestroy(), ptaaReadStream(), recogDestroy(), and recogTrainingFinished().
|
static |
| [in] | ptaa |
Definition at line 1013 of file ptabasic.c.
References Ptaa::nalloc, Ptaa::pta, and reallocNew().
Referenced by ptaaAddPta().
| l_int32 ptaaGetCount | ( | PTAA * | ptaa | ) |
| [in] | ptaa |
Definition at line 1040 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_int32 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 1091 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 1060 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 1276 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 1343 of file ptabasic.c.
References fopenReadFromMemory(), and ptaaReadStream().
| PTAA* ptaaReadStream | ( | FILE * | fp | ) |
| [in] | fp | file stream |
Definition at line 1303 of file ptabasic.c.
References L_INSERT, PTA_VERSION_NUMBER, ptaaAddPta(), ptaaCreate(), ptaaDestroy(), and ptaReadStream().
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 the index is invalid, return 1 (error)
Definition at line 1170 of file ptabasic.c.
References Ptaa::pta, ptaaGetCount(), and ptaDestroy().
Referenced by ptaaInitFull().
| l_int32 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 1236 of file ptabasic.c.
References L_CLONE, Ptaa::n, Ptaa::pta, ptaaGetCount(), ptaaGetPta(), ptaDestroy(), and ptaGetCount().
Referenced by recogTrainingFinished().
| l_int32 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 1372 of file ptabasic.c.
References fopenWriteStream(), and ptaaWriteStream().
| l_int32 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 a ptaa in memory and puts the result in a buffer.
Definition at line 1447 of file ptabasic.c.
References fopenWriteWinTempfile(), l_binaryReadStream(), and ptaaWriteStream().
| l_int32 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 1405 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 295 of file ptabasic.c.
Referenced by fpixAffinePta(), fpixProjectivePta(), generatePtaBoxa(), generatePtaHashBoxa(), generatePtaPolyline(), makePlotPtaFromNumaGen(), pixaAccumulateSamples(), pixRenderPolygon(), pixRenderRandomCmapPtaa(), ptaaAddPta(), ptaaGetPta(), and ptaReplicatePattern().
| [in] | pta |
Definition at line 224 of file ptabasic.c.
References Pta::n, Pta::nalloc, ptaAddPt(), ptaCreate(), and ptaGetPt().
Referenced by ptaaAddPta(), ptaaGetPta(), ptaaInitFull(), ptaSelectByValue(), ptaSelectRange(), ptaUnionByAset(), and ptaUnionByHash().
| [in] | ptas | |
| [in] | istart | starting index in ptas |
| [in] | iend | ending index in ptas; use 0 to copy to end |
Definition at line 256 of file ptabasic.c.
References ptaAddPt(), ptaCreate(), ptaGetCount(), and ptaGetIPt().
| PTA* ptaCreate | ( | l_int32 | n | ) |
| [in] | n | initial array sizes |
Definition at line 115 of file ptabasic.c.
Referenced by boxaConvertToPta(), boxaExtractAsPta(), boxConvertToPta(), boxIntersectByLine(), ccbaGenerateGlobalLocs(), ccbaGenerateSinglePath(), ccbaGenerateSPGlobalLocs(), convertPtaLineTo4cc(), dewarpFindVertDisparity(), generatePtaaBoxa(), generatePtaBox(), generatePtaBoxa(), generatePtaFilledCircle(), generatePtaFilledSquare(), generatePtaHashBox(), generatePtaHashBoxa(), generatePtaLine(), generatePtaPolyline(), makePlotPtaFromNumaGen(), numaConvertToPta1(), numaConvertToPta2(), pixaAccumulateSamples(), pixaCentroids(), pixGetHoleBorder(), pixGetOuterBorder(), ptaAffineTransform(), ptaCopy(), ptaCopyRange(), ptaCreateFromNuma(), ptaCyclicPerm(), ptaGetInsideBox(), ptaGetNeighborPixLocs(), ptaIntersectionByAset(), ptaIntersectionByHash(), ptaNoisyLinearLSF(), ptaNoisyQuadraticLSF(), ptaReadStream(), ptaRemoveDupsByHash(), ptaReplicatePattern(), ptaReverse(), ptaRotate(), ptaScale(), ptaSelectByValue(), ptaSelectRange(), ptaSortByIndex(), ptaSubsample(), ptaTransform(), ptaTranslate(), ptaTranspose(), recogAverageSamples(), and recogTrainingFinished().
| [in] | nax | [optional] can be null |
| [in] | nay |
Definition at line 148 of file ptabasic.c.
References numaGetCount(), numaGetFValue(), numaGetParameters(), ptaAddPt(), and ptaCreate().
Referenced by dewarpFindVertDisparity().
| void ptaDestroy | ( | PTA ** | ppta | ) |
| [in,out] | ppta | to be nulled |
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.
Referenced by boxaAffineTransform(), boxaConvertToPta(), boxaLinearFit(), boxaRotate(), boxaScale(), boxaTranslate(), boxIntersectByLine(), ccbaDisplayBorder(), ccbaDisplayImage1(), ccbaDisplayImage2(), ccbaGenerateGlobalLocs(), ccbaGenerateSinglePath(), ccbaGenerateSPGlobalLocs(), ccbaGenerateStepChains(), ccbDestroy(), dewarpFindVertDisparity(), fpixAffinePta(), fpixProjectivePta(), generatePtaBox(), generatePtaBoxa(), generatePtaHashBox(), generatePtaHashBoxa(), generatePtaPolyline(), generatePtaWideLine(), 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(), ptaaDestroy(), ptaaGetPt(), ptaaReplacePta(), ptaaTruncate(), ptaaWriteStream(), ptaGetRankValue(), ptaNoisyLinearLSF(), ptaNoisyQuadraticLSF(), ptaReadStream(), ptaReplicatePattern(), ptaUnionByAset(), ptaUnionByHash(), recogAverageSamples(), recogDestroy(), recogTrainingFinished(), selaAddCrossJunctions(), selaAddTJunctions(), and wshedDestroy().
| l_int32 ptaEmpty | ( | PTA * | pta | ) |
| [in] | pta |
Notes:
This only resets the Pta::n field, for reuse
Definition at line 319 of file ptabasic.c.
References Pta::n.
|
static |
| [in] | pta |
Definition at line 370 of file ptabasic.c.
References Pta::nalloc, reallocNew(), and Pta::y.
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 615 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 503 of file ptabasic.c.
References Pta::n.
Referenced by boxIntersectByLine(), ccbaDisplayBorder(), ccbaDisplayImage1(), ccbaDisplayImage2(), ccbaDisplaySPBorder(), ccbaGenerateGlobalLocs(), ccbaGenerateSPGlobalLocs(), ccbaGenerateStepChains(), ccbaWriteSVGString(), convertPtaLineTo4cc(), dewarpQuadraticLSF(), generatePtaPolyline(), l_dnaHashCreateFromPta(), pixaAccumulateSamples(), pixAffinePta(), pixAffineSampledPta(), pixAffineSequential(), pixBilinearPta(), pixBilinearSampledPta(), pixDisplayPtaa(), pixGenerateFromPta(), pixProjectivePta(), pixProjectiveSampledPta(), ptaAffineTransform(), ptaaTruncate(), ptaContainsPt(), ptaConvertToBox(), ptaConvertToBoxa(), ptaConvertToNuma(), ptaCopyRange(), ptaCyclicPerm(), ptaGetArrays(), ptaGetBoundingRegion(), ptaGetCubicLSF(), ptaGetInsideBox(), ptaGetLinearLSF(), ptaGetMinMax(), ptaGetQuadraticLSF(), ptaGetQuarticLSF(), ptaGetRange(), ptaGetRankValue(), ptaGetSortIndex(), ptaInsertPt(), ptaIntersectionByAset(), ptaIntersectionByHash(), ptaJoin(), ptaNoisyLinearLSF(), ptaNoisyQuadraticLSF(), ptaPtInsidePolygon(), ptaRemoveDupsByHash(), ptaRemovePt(), ptaReplicatePattern(), ptaReverse(), ptaRotate(), ptaScale(), ptaSelectByValue(), ptaSelectRange(), ptaSubsample(), ptaTestIntersection(), ptaTransform(), ptaTranslate(), ptaTranspose(), ptaWriteStream(), selCreateFromPta(), and wshedApply().
| l_int32 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 554 of file ptabasic.c.
References Pta::n, and Pta::y.
Referenced by boxIntersectByLine(), ccbaDisplayBorder(), ccbaDisplayImage1(), ccbaDisplayImage2(), ccbaDisplaySPBorder(), ccbaGenerateGlobalLocs(), ccbaGenerateStepChains(), ccbaWriteSVGString(), convertPtaLineTo4cc(), generatePtaPolyline(), identifyWatershedBasin(), l_dnaHashCreateFromPta(), pixAffineSequential(), pixDisplayPtaa(), pixGenerateFromPta(), ptaContainsPt(), ptaConvertToBox(), ptaConvertToBoxa(), ptaCopyRange(), ptaCyclicPerm(), ptaFindPtByHash(), ptaGetBoundingRegion(), ptaIntersectionByHash(), ptaJoin(), ptaRemoveDupsByHash(), ptaReplicatePattern(), ptaReverse(), ptaTestIntersection(), ptaTransform(), ptaWriteStream(), recogMakeDecodingArray(), selCreateFromPta(), and wshedApply().
| l_int32 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 524 of file ptabasic.c.
References Pta::n, and Pta::y.
Referenced by dewarpQuadraticLSF(), getAffineXformCoeffs(), getBilinearXformCoeffs(), getProjectiveXformCoeffs(), pixaAccumulateSamples(), ptaAffineTransform(), ptaaGetPt(), ptaConvertToNuma(), ptaCopy(), ptaGetInsideBox(), ptaGetMinMax(), ptaGetRange(), ptaGetRankValue(), ptaGetSortIndex(), ptaNoisyLinearLSF(), ptaNoisyQuadraticLSF(), ptaPtInsidePolygon(), ptaReverse(), ptaRotate(), ptaScale(), ptaSelectByValue(), ptaSelectRange(), ptaSortByIndex(), ptaSubsample(), ptaTranslate(), ptaTranspose(), ptaWriteStream(), and recogShowAverageTemplates().
| l_int32 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 403 of file ptabasic.c.
References Pta::n, Pta::nalloc, ptaExtendArrays(), ptaGetCount(), and Pta::y.
| PTA* ptaRead | ( | const char * | filename | ) |
| [in] | filename |
Definition at line 663 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 743 of file ptabasic.c.
References fopenReadFromMemory(), and ptaReadStream().
| PTA* ptaReadStream | ( | FILE * | fp | ) |
| [in] | fp | file stream |
Definition at line 690 of file ptabasic.c.
References PTA_VERSION_NUMBER, ptaAddPt(), ptaCreate(), and ptaDestroy().
Referenced by ptaaReadStream(), ptaRead(), and ptaReadMem().
| l_int32 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 446 of file ptabasic.c.
References Pta::n, ptaGetCount(), and Pta::y.
| l_int32 ptaSetPt | ( | PTA * | pta, |
| l_int32 | index, | ||
| l_float32 | x, | ||
| l_float32 | y | ||
| ) |
| [in] | pta | |
| [in] | index | into arrays |
| [in] | x,y |
Definition at line 583 of file ptabasic.c.
| l_int32 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 772 of file ptabasic.c.
References fopenWriteStream(), and ptaWriteStream().
Referenced by boxaLinearFit().
| l_int32 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 854 of file ptabasic.c.
References fopenWriteWinTempfile(), l_binaryReadStream(), and ptaWriteStream().
| l_int32 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 805 of file ptabasic.c.
References PTA_VERSION_NUMBER, ptaGetCount(), ptaGetIPt(), and ptaGetPt().
Referenced by ptaaWriteStream(), ptaWrite(), and ptaWriteMem().
1.8.14