Leptonica  1.82.0
Image processing and image analysis suite
ptabasic.c File Reference
#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)
 
PTAptaCreate (l_int32 n)
 
PTAptaCreateFromNuma (NUMA *nax, NUMA *nay)
 
void ptaDestroy (PTA **ppta)
 
PTAptaCopy (PTA *pta)
 
PTAptaCopyRange (PTA *ptas, l_int32 istart, l_int32 iend)
 
PTAptaClone (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 ptaGetRefcount (PTA *pta)
 
l_int32 ptaChangeRefcount (PTA *pta, l_int32 delta)
 
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)
 
PTAptaRead (const char *filename)
 
PTAptaReadStream (FILE *fp)
 
PTAptaReadMem (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)
 
PTAAptaaCreate (l_int32 n)
 
void ptaaDestroy (PTAA **pptaa)
 
l_ok ptaaAddPta (PTAA *ptaa, PTA *pta, l_int32 copyflag)
 
l_int32 ptaaGetCount (PTAA *ptaa)
 
PTAptaaGetPta (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)
 
PTAAptaaRead (const char *filename)
 
PTAAptaaReadStream (FILE *fp)
 
PTAAptaaReadMem (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
 

Detailed Description


     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         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.

Function Documentation

◆ ptaaAddPt()

l_ok ptaaAddPt ( PTAA ptaa,
l_int32  ipta,
l_float32  x,
l_float32  y 
)

ptaaAddPt()

Parameters
[in]ptaa
[in]iptato the i-th pta
[in]x,ypoint coordinates
Returns
0 if OK; 1 on error

Definition at line 1286 of file ptabasic.c.

References L_CLONE, Ptaa::n, ptaAddPt(), ptaaGetPta(), and ptaDestroy().

Referenced by recogTrainingFinished().

◆ ptaaAddPta()

l_ok ptaaAddPta ( PTAA ptaa,
PTA pta,
l_int32  copyflag 
)

ptaaAddPta()

Parameters
[in]ptaa
[in]ptato be added
[in]copyflagL_INSERT, L_COPY, L_CLONE
Returns
0 if OK, 1 on error

Definition at line 1038 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().

◆ ptaaCreate()

PTAA* ptaaCreate ( l_int32  n)

ptaaCreate()

Parameters
[in]ninitial number of ptrs
Returns
ptaa, or NULL on error

Definition at line 976 of file ptabasic.c.

Referenced by ccbaGenerateGlobalLocs(), dewarpFindVertDisparity(), generatePtaaBoxa(), generatePtaaHashBoxa(), ptaaSortByIndex(), and recogTrainingFinished().

◆ ptaAddPt()

◆ ptaaDestroy()

void ptaaDestroy ( PTAA **  pptaa)

ptaaDestroy()

Parameters
[in,out]pptaawill be set to null before returning
Returns
void

Definition at line 1003 of file ptabasic.c.

References Ptaa::n, Ptaa::pta, and ptaDestroy().

Referenced by ccbaGenerateGlobalLocs(), ccbDestroy(), recogDestroy(), and recogTrainingFinished().

◆ ptaaExtendArray()

static l_int32 ptaaExtendArray ( PTAA ptaa)
static

ptaaExtendArray()

Parameters
[in]ptaa
Returns
0 if OK, 1 on error
Notes:
     (1) This doubles the pta ptr array size.
     (2) The max number of pta ptrs is 10M.

Definition at line 1093 of file ptabasic.c.

References Ptaa::nalloc.

Referenced by ptaaAddPta().

◆ ptaaGetCount()

◆ ptaaGetPt()

l_ok ptaaGetPt ( PTAA ptaa,
l_int32  ipta,
l_int32  jpt,
l_float32 *  px,
l_float32 *  py 
)

ptaaGetPt()

Parameters
[in]ptaa
[in]iptato the i-th pta
[in]jptindex to the j-th pt in the pta
[out]px[optional] float x value
[out]py[optional] float y value
Returns
0 if OK; 1 on error

Definition at line 1176 of file ptabasic.c.

References L_CLONE, Pta::n, Ptaa::n, ptaaGetPta(), ptaDestroy(), and ptaGetPt().

Referenced by dewarpIsLineCoverageValid().

◆ ptaaGetPta()

PTA* ptaaGetPta ( PTAA ptaa,
l_int32  index,
l_int32  accessflag 
)

◆ ptaaInitFull()

l_ok ptaaInitFull ( PTAA ptaa,
PTA pta 
)

ptaaInitFull()

Parameters
[in]ptaacan have non-null ptrs in the ptr array
[in]ptato be replicated into the entire ptr array
Returns
0 if OK; 1 on error

Definition at line 1216 of file ptabasic.c.

References Ptaa::n, Ptaa::nalloc, ptaaReplacePta(), and ptaCopy().

Referenced by recogTrainingFinished().

◆ ptaaRead()

PTAA* ptaaRead ( const char *  filename)

ptaaRead()

Parameters
[in]filename
Returns
ptaa, or NULL on error

Definition at line 1361 of file ptabasic.c.

References fopenReadStream(), and ptaaReadStream().

◆ ptaaReadMem()

PTAA* ptaaReadMem ( const l_uint8 *  data,
size_t  size 
)

ptaaReadMem()

Parameters
[in]dataserialization in ascii
[in]sizeof data in bytes; can use strlen to get it
Returns
ptaa, or NULL on error

Definition at line 1438 of file ptabasic.c.

References fopenReadFromMemory(), and ptaaReadStream().

◆ ptaaReadStream()

PTAA* ptaaReadStream ( FILE *  fp)

ptaaReadStream()

Parameters
[in]fpfile stream
Returns
ptaa, or NULL on error
Notes:
     (1) It is OK for the ptaa to be empty (n == 0).

Definition at line 1393 of file ptabasic.c.

References PTA_VERSION_NUMBER.

Referenced by ptaaRead(), and ptaaReadMem().

◆ ptaaReplacePta()

l_ok ptaaReplacePta ( PTAA ptaa,
l_int32  index,
PTA pta 
)

ptaaReplacePta()

Parameters
[in]ptaa
[in]indexto the index-th pta
[in]ptainsert and replace any existing one
Returns
0 if OK, 1 on error
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 1255 of file ptabasic.c.

References Ptaa::pta, ptaaGetCount(), and ptaDestroy().

Referenced by ptaaInitFull().

◆ ptaaTruncate()

l_ok ptaaTruncate ( PTAA ptaa)

ptaaTruncate()

Parameters
[in]ptaa
Returns
0 if OK, 1 on error
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 1321 of file ptabasic.c.

References L_CLONE, Ptaa::n, Ptaa::pta, ptaaGetCount(), ptaaGetPta(), ptaDestroy(), and ptaGetCount().

Referenced by recogTrainingFinished().

◆ ptaaWrite()

l_ok ptaaWrite ( const char *  filename,
PTAA ptaa,
l_int32  type 
)

ptaaWrite()

Parameters
[in]filename
[in]ptaa
[in]type0 for float values; 1 for integer values
Returns
0 if OK, 1 on error

Definition at line 1500 of file ptabasic.c.

References fopenWriteStream(), and ptaaWriteStream().

Referenced by ptaaWriteDebug().

◆ ptaaWriteDebug()

l_ok ptaaWriteDebug ( const char *  filename,
PTAA ptaa,
l_int32  type 
)

ptaaWriteDebug()

Parameters
[in]filename
[in]ptaa
[in]type0 for float values; 1 for integer values
Returns
0 if OK, 1 on error
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 1476 of file ptabasic.c.

References ptaaWrite().

◆ ptaaWriteMem()

l_ok ptaaWriteMem ( l_uint8 **  pdata,
size_t *  psize,
PTAA ptaa,
l_int32  type 
)

ptaaWriteMem()

Parameters
[out]pdatadata of serialized ptaa; ascii
[out]psizesize of returned data
[in]ptaa
[in]type0 for float values; 1 for integer values
Returns
0 if OK, 1 on error
Notes:
     (1) Serializes ptaa in memory and puts the result in a buffer.

Definition at line 1575 of file ptabasic.c.

References fopenWriteWinTempfile(), l_binaryReadStream(), and ptaaWriteStream().

◆ ptaaWriteStream()

l_ok ptaaWriteStream ( FILE *  fp,
PTAA ptaa,
l_int32  type 
)

ptaaWriteStream()

Parameters
[in]fpfile stream
[in]ptaa
[in]type0 for float values; 1 for integer values
Returns
0 if OK; 1 on error

Definition at line 1533 of file ptabasic.c.

References L_CLONE, PTA_VERSION_NUMBER, ptaaGetCount(), ptaaGetPta(), ptaDestroy(), and ptaWriteStream().

Referenced by ptaaWrite(), and ptaaWriteMem().

◆ ptaClone()

◆ ptaCopy()

PTA* ptaCopy ( PTA pta)

ptaCopy()

Parameters
[in]pta
Returns
copy of pta, or NULL on error

Definition at line 226 of file ptabasic.c.

References Pta::n, Pta::nalloc, ptaAddPt(), ptaCreate(), and ptaGetPt().

Referenced by ptaaAddPta(), ptaaGetPta(), ptaaInitFull(), ptaSelectByValue(), ptaSelectRange(), ptaUnionByAset(), and ptaUnionByHmap().

◆ ptaCopyRange()

PTA* ptaCopyRange ( PTA ptas,
l_int32  istart,
l_int32  iend 
)

ptaCopyRange()

Parameters
[in]ptas
[in]istartstarting index in ptas
[in]iendending index in ptas; use 0 to copy to end
Returns
0 if OK, 1 on error

Definition at line 258 of file ptabasic.c.

References ptaAddPt(), ptaCreate(), ptaGetCount(), and ptaGetIPt().

◆ ptaCreate()

◆ ptaCreateFromNuma()

PTA* ptaCreateFromNuma ( NUMA nax,
NUMA nay 
)

ptaCreateFromNuma()

Parameters
[in]nax[optional] can be null
[in]nay
Returns
pta, or NULL on error.

Definition at line 152 of file ptabasic.c.

References numaGetCount(), numaGetFValue(), numaGetParameters(), ptaAddPt(), and ptaCreate().

Referenced by dewarpFindVertDisparity().

◆ ptaDestroy()

void ptaDestroy ( PTA **  ppta)

ptaDestroy()

Parameters
[in,out]pptawill be set to null before returning
Returns
void
Notes:
     (1) Decrements the ref count and, if 0, destroys the pta.
     (2) Always nulls the input ptr.

Definition at line 195 of file ptabasic.c.

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().

◆ ptaEmpty()

l_ok ptaEmpty ( PTA pta)

ptaEmpty()

Parameters
[in]pta
Returns
0 if OK, 1 on error
Notes:
     This only resets the Pta::n field, for reuse

Definition at line 321 of file ptabasic.c.

References Pta::n.

Referenced by getCutPathForHole().

◆ ptaExtendArrays()

static l_int32 ptaExtendArrays ( PTA pta)
static

ptaExtendArrays()

Parameters
[in]pta
Returns
0 if OK; 1 on error
Notes:
     (1) Doubles the size of the array.
     (2) The max number of points is 100M.

Definition at line 380 of file ptabasic.c.

References Pta::nalloc.

Referenced by ptaAddPt(), and ptaInsertPt().

◆ ptaGetArrays()

l_ok ptaGetArrays ( PTA pta,
NUMA **  pnax,
NUMA **  pnay 
)

ptaGetArrays()

Parameters
[in]pta
[out]pnax[optional] numa of x array
[out]pnay[optional] numa of y array
Returns
0 if OK; 1 on error or if pta is empty
Notes:
     (1) This copies the internal arrays into new Numas.

Definition at line 639 of file ptabasic.c.

References Numa::array, Numa::n, numaCreate(), ptaGetCount(), and Pta::y.

Referenced by dewarpFindVertDisparity().

◆ ptaGetCount()

l_int32 ptaGetCount ( PTA pta)

ptaGetCount()

Parameters
[in]pta
Returns
count, or 0 if no pta

Definition at line 527 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().

◆ ptaGetIPt()

◆ ptaGetPt()

◆ ptaInsertPt()

l_ok ptaInsertPt ( PTA pta,
l_int32  index,
l_int32  x,
l_int32  y 
)

ptaInsertPt()

Parameters
[in]pta
[in]indexat which pt is to be inserted
[in]x,ypoint values
Returns
0 if OK; 1 on error

Definition at line 421 of file ptabasic.c.

References Pta::n, Pta::nalloc, ptaExtendArrays(), ptaGetCount(), and Pta::y.

◆ ptaRead()

PTA* ptaRead ( const char *  filename)

ptaRead()

Parameters
[in]filename
Returns
pta, or NULL on error

Definition at line 687 of file ptabasic.c.

References fopenReadStream(), and ptaReadStream().

◆ ptaReadMem()

PTA* ptaReadMem ( const l_uint8 *  data,
size_t  size 
)

ptaReadMem()

Parameters
[in]dataserialization in ascii
[in]sizeof data in bytes; can use strlen to get it
Returns
pta, or NULL on error

Definition at line 778 of file ptabasic.c.

References fopenReadFromMemory(), and ptaReadStream().

◆ ptaReadStream()

PTA* ptaReadStream ( FILE *  fp)

ptaReadStream()

Parameters
[in]fpfile stream
Returns
pta, or NULL on error
Notes:
     (1) It is OK for the pta to be empty (n == 0).

Definition at line 720 of file ptabasic.c.

References PTA_VERSION_NUMBER.

Referenced by ptaRead(), and ptaReadMem().

◆ ptaRemovePt()

l_ok ptaRemovePt ( PTA pta,
l_int32  index 
)

ptaRemovePt()

Parameters
[in]pta
[in]indexof point to be removed
Returns
0 if OK, 1 on error
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 468 of file ptabasic.c.

References Pta::n, ptaGetCount(), and Pta::y.

◆ ptaSetPt()

l_ok ptaSetPt ( PTA pta,
l_int32  index,
l_float32  x,
l_float32  y 
)

ptaSetPt()

Parameters
[in]pta
[in]indexinto arrays
[in]x,y
Returns
0 if OK; 1 on error

Definition at line 607 of file ptabasic.c.

References Pta::n, and Pta::y.

◆ ptaWrite()

l_ok ptaWrite ( const char *  filename,
PTA pta,
l_int32  type 
)

ptaWrite()

Parameters
[in]filename
[in]pta
[in]type0 for float values; 1 for integer values
Returns
0 if OK, 1 on error

Definition at line 840 of file ptabasic.c.

References fopenWriteStream(), and ptaWriteStream().

Referenced by ptaWriteDebug().

◆ ptaWriteDebug()

l_ok ptaWriteDebug ( const char *  filename,
PTA pta,
l_int32  type 
)

ptaWriteDebug()

Parameters
[in]filename
[in]pta
[in]type0 for float values; 1 for integer values
Returns
0 if OK, 1 on error
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 816 of file ptabasic.c.

References ptaWrite().

◆ ptaWriteMem()

l_ok ptaWriteMem ( l_uint8 **  pdata,
size_t *  psize,
PTA pta,
l_int32  type 
)

ptaWriteMem()

Parameters
[out]pdatadata of serialized pta; ascii
[out]psizesize of returned data
[in]pta
[in]type0 for float values; 1 for integer values
Returns
0 if OK, 1 on error
Notes:
     (1) Serializes a pta in memory and puts the result in a buffer.

Definition at line 922 of file ptabasic.c.

References fopenWriteWinTempfile(), l_binaryReadStream(), and ptaWriteStream().

◆ ptaWriteStream()

l_ok ptaWriteStream ( FILE *  fp,
PTA pta,
l_int32  type 
)

ptaWriteStream()

Parameters
[in]fpfile stream
[in]pta
[in]type0 for float values; 1 for integer values
Returns
0 if OK; 1 on error

Definition at line 873 of file ptabasic.c.

References PTA_VERSION_NUMBER, ptaGetCount(), ptaGetIPt(), and ptaGetPt().

Referenced by ptaaWriteStream(), ptaWrite(), and ptaWriteMem().

Variable Documentation

◆ InitialArraySize

const l_int32 InitialArraySize = 50
static

n'importe quoi

Definition at line 104 of file ptabasic.c.