![]() |
Leptonica
1.83.1
Image processing and image analysis suite
|
Go to the source code of this file.
Functions | |
BOX * | boxCreate (l_int32 x, l_int32 y, l_int32 w, l_int32 h) |
BOX * | boxCreateValid (l_int32 x, l_int32 y, l_int32 w, l_int32 h) |
BOX * | boxCopy (BOX *box) |
BOX * | boxClone (BOX *box) |
void | boxDestroy (BOX **pbox) |
l_ok | boxGetGeometry (const BOX *box, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph) |
l_ok | boxSetGeometry (BOX *box, l_int32 x, l_int32 y, l_int32 w, l_int32 h) |
l_ok | boxGetSideLocations (const BOX *box, l_int32 *pl, l_int32 *pr, l_int32 *pt, l_int32 *pb) |
l_ok | boxSetSideLocations (BOX *box, l_int32 l, l_int32 r, l_int32 t, l_int32 b) |
l_ok | boxIsValid (BOX *box, l_int32 *pvalid) |
BOXA * | boxaCreate (l_int32 n) |
BOXA * | boxaCopy (BOXA *boxa, l_int32 copyflag) |
void | boxaDestroy (BOXA **pboxa) |
l_ok | boxaAddBox (BOXA *boxa, BOX *box, l_int32 copyflag) |
l_ok | boxaExtendArray (BOXA *boxa) |
l_ok | boxaExtendArrayToSize (BOXA *boxa, size_t size) |
l_int32 | boxaGetCount (const BOXA *boxa) |
l_int32 | boxaGetValidCount (BOXA *boxa) |
BOX * | boxaGetBox (BOXA *boxa, l_int32 index, l_int32 accessflag) |
BOX * | boxaGetValidBox (BOXA *boxa, l_int32 index, l_int32 accessflag) |
NUMA * | boxaFindInvalidBoxes (BOXA *boxa) |
l_ok | boxaGetBoxGeometry (BOXA *boxa, l_int32 index, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph) |
l_ok | boxaIsFull (BOXA *boxa, l_int32 *pfull) |
l_ok | boxaReplaceBox (BOXA *boxa, l_int32 index, BOX *box) |
l_ok | boxaInsertBox (BOXA *boxa, l_int32 index, BOX *box) |
l_ok | boxaRemoveBox (BOXA *boxa, l_int32 index) |
l_ok | boxaRemoveBoxAndSave (BOXA *boxa, l_int32 index, BOX **pbox) |
BOXA * | boxaSaveValid (BOXA *boxas, l_int32 copyflag) |
l_ok | boxaInitFull (BOXA *boxa, BOX *box) |
l_ok | boxaClear (BOXA *boxa) |
BOXAA * | boxaaCreate (l_int32 n) |
BOXAA * | boxaaCopy (BOXAA *baas, l_int32 copyflag) |
void | boxaaDestroy (BOXAA **pbaa) |
l_ok | boxaaAddBoxa (BOXAA *baa, BOXA *ba, l_int32 copyflag) |
l_ok | boxaaExtendArray (BOXAA *baa) |
l_ok | boxaaExtendArrayToSize (BOXAA *baa, l_int32 size) |
l_int32 | boxaaGetCount (BOXAA *baa) |
l_int32 | boxaaGetBoxCount (BOXAA *baa) |
BOXA * | boxaaGetBoxa (BOXAA *baa, l_int32 index, l_int32 accessflag) |
BOX * | boxaaGetBox (BOXAA *baa, l_int32 iboxa, l_int32 ibox, l_int32 accessflag) |
l_ok | boxaaInitFull (BOXAA *baa, BOXA *boxa) |
l_ok | boxaaExtendWithInit (BOXAA *baa, l_int32 maxindex, BOXA *boxa) |
l_ok | boxaaReplaceBoxa (BOXAA *baa, l_int32 index, BOXA *boxa) |
l_ok | boxaaInsertBoxa (BOXAA *baa, l_int32 index, BOXA *boxa) |
l_ok | boxaaRemoveBoxa (BOXAA *baa, l_int32 index) |
l_ok | boxaaAddBox (BOXAA *baa, l_int32 index, BOX *box, l_int32 accessflag) |
BOXAA * | boxaaReadFromFiles (const char *dirname, const char *substr, l_int32 first, l_int32 nfiles) |
BOXAA * | boxaaRead (const char *filename) |
BOXAA * | boxaaReadStream (FILE *fp) |
BOXAA * | boxaaReadMem (const l_uint8 *data, size_t size) |
l_ok | boxaaWrite (const char *filename, BOXAA *baa) |
l_ok | boxaaWriteStream (FILE *fp, BOXAA *baa) |
l_ok | boxaaWriteMem (l_uint8 **pdata, size_t *psize, BOXAA *baa) |
BOXA * | boxaRead (const char *filename) |
BOXA * | boxaReadStream (FILE *fp) |
BOXA * | boxaReadMem (const l_uint8 *data, size_t size) |
l_ok | boxaWriteDebug (const char *filename, BOXA *boxa) |
l_ok | boxaWrite (const char *filename, BOXA *boxa) |
l_ok | boxaWriteStream (FILE *fp, BOXA *boxa) |
l_ok | boxaWriteStderr (BOXA *boxa) |
l_ok | boxaWriteMem (l_uint8 **pdata, size_t *psize, BOXA *boxa) |
l_ok | boxPrintStreamInfo (FILE *fp, BOX *box) |
Variables | |
static const size_t | MaxBoxaPtrArraySize = 10000000 |
static const size_t | MaxBoxaaPtrArraySize = 1000000 |
static const size_t | InitialPtrArraySize = 20 |
Basic 'class' functions for box, boxa and boxaa, including accessors and serialization. Box creation, copy, clone, destruction BOX *boxCreate() BOX *boxCreateValid() BOX *boxCopy() BOX *boxClone() void boxDestroy() Box accessors l_int32 boxGetGeometry() l_int32 boxSetGeometry() l_int32 boxGetSideLocations() l_int32 boxSetSideLocations() l_int32 boxIsValid() Boxa creation, copy, destruction BOXA *boxaCreate() BOXA *boxaCopy() void boxaDestroy() Boxa array extension l_int32 boxaAddBox() l_int32 boxaExtendArray() l_int32 boxaExtendArrayToSize() Boxa accessors l_int32 boxaGetCount() l_int32 boxaGetValidCount() BOX *boxaGetBox() BOX *boxaGetValidBox() NUMA *boxaFindInvalidBoxes() l_int32 boxaGetBoxGeometry() l_int32 boxaIsFull() Boxa array modifiers l_int32 boxaReplaceBox() l_int32 boxaInsertBox() l_int32 boxaRemoveBox() l_int32 boxaRemoveBoxAndSave() BOXA *boxaSaveValid() l_int32 boxaInitFull() l_int32 boxaClear() Boxaa creation, copy, destruction BOXAA *boxaaCreate() BOXAA *boxaaCopy() void boxaaDestroy() Boxaa array extension l_int32 boxaaAddBoxa() l_int32 boxaaExtendArray() l_int32 boxaaExtendArrayToSize() Boxaa accessors l_int32 boxaaGetCount() l_int32 boxaaGetBoxCount() BOXA *boxaaGetBoxa() BOX *boxaaGetBox() Boxaa array modifiers l_int32 boxaaInitFull() l_int32 boxaaExtendWithInit() l_int32 boxaaReplaceBoxa() l_int32 boxaaInsertBoxa() l_int32 boxaaRemoveBoxa() l_int32 boxaaAddBox() Boxaa serialized I/O BOXAA *boxaaReadFromFiles() BOXAA *boxaaRead() BOXAA *boxaaReadStream() BOXAA *boxaaReadMem() l_int32 boxaaWrite() l_int32 boxaaWriteStream() l_int32 boxaaWriteMem() Boxa serialized I/O BOXA *boxaRead() BOXA *boxaReadStream() BOXA *boxaReadMem() l_int32 boxaWriteDebug() l_int32 boxaWrite() l_int32 boxaWriteStream() l_int32 boxaWriteStderr() l_int32 boxaWriteMem() Box print (for debug) l_int32 boxPrintStreamInfo() Most functions use only valid boxes, which are boxes that have both width and height > 0. However, a few functions, such as boxaGetMedianVals() do not assume that all boxes are valid. For any function that can use a boxa with invalid boxes, it is convenient to use these accessors: boxaGetValidCount() : count of valid boxes boxaGetValidBox() : returns NULL for invalid boxes
Definition in file boxbasic.c.
[in] | baa | |
[in] | index | of boxa with boxaa |
[in] | box | to be added |
[in] | accessflag | L_INSERT, L_COPY or L_CLONE |
Notes: (1) Adds to an existing boxa only.
Definition at line 1667 of file boxbasic.c.
References boxaAddBox(), boxaaGetBoxa(), boxaaGetCount(), boxaDestroy(), L_CLONE, L_COPY, and L_INSERT.
Referenced by boxaSort2d().
[in] | baa | |
[in] | ba | to be added |
[in] | copyflag | L_INSERT, L_COPY, L_CLONE |
Definition at line 1241 of file boxbasic.c.
References Boxaa::boxa, boxaaExtendArray(), boxaaGetCount(), boxaCopy(), L_CLONE, L_COPY, L_INSERT, Boxaa::n, and Boxaa::nalloc.
Referenced by boxaaCopy(), boxaaExtendWithInit(), boxaaJoin(), boxaaQuadtreeRegions(), boxaaReadFromFiles(), boxaaSelectRange(), boxaaTranspose(), boxaEncapsulateAligned(), boxaSort2d(), boxaSort2dByIndex(), and recogExtractNumbers().
[in] | baas | input boxaa to be copied |
[in] | copyflag | L_COPY, L_CLONE |
Notes: (1) L_COPY makes a copy of each boxa in baas. L_CLONE makes a clone of each boxa in baas.
Definition at line 1178 of file boxbasic.c.
References boxaaAddBoxa(), boxaaCreate(), boxaaGetBoxa(), boxaaGetCount(), L_CLONE, L_COPY, and L_INSERT.
BOXAA* boxaaCreate | ( | l_int32 | n | ) |
[in] | n | size of boxa ptr array to be alloc'd; 0 for default |
Definition at line 1145 of file boxbasic.c.
Referenced by boxaaCopy(), boxaaQuadtreeRegions(), boxaaReadFromFiles(), boxaaSelectRange(), boxaaTranspose(), boxaEncapsulateAligned(), boxaSort2d(), boxaSort2dByIndex(), convertNumberedMasksToBoxaa(), and recogExtractNumbers().
[in] | boxa | |
[in] | box | to be added |
[in] | copyflag | L_INSERT, L_COPY, L_CLONE |
Definition at line 553 of file boxbasic.c.
References Boxa::box, boxaExtendArray(), boxaGetCount(), boxClone(), boxCopy(), boxDestroy(), L_CLONE, L_COPY, L_INSERT, Boxa::n, and Boxa::nalloc.
Referenced by boxaaAddBox(), boxaAdjustSides(), boxaaFlattenAligned(), boxaaFlattenToBoxa(), boxaaGetExtent(), boxaaQuadtreeRegions(), boxaaTranspose(), boxaClipToBox(), boxaContainedInBox(), boxaCopy(), boxaEncapsulateAligned(), boxaGenerateSubboxes(), boxaHandleOverlaps(), boxaIntersectsBox(), boxaJoin(), boxaMergeEvenOdd(), boxaModifyWithBoxa(), boxaPruneSortedOnOverlap(), boxaReconcileSizeByMedian(), boxaRotateOrth(), boxaSaveValid(), boxaSelectLargeULBox(), boxaSelectRange(), boxaSelectWithIndicator(), boxaShiftWithPta(), boxaSort2d(), boxaSort2dByIndex(), boxaSortByIndex(), boxaSplitEvenOdd(), boxaTransform(), boxaTransformOrdered(), boxaWindowedMedian(), ccbaReadStream(), generatePtaGrid(), makeMosaicStrips(), pixaaAddBox(), pixaAddBorderGeneral(), pixaAddBox(), pixaClipToForeground(), pixacompAddBox(), pixaSetFullSizeBoxa(), pixGetHoleBorder(), pixGetOuterBorder(), ptaConvertToBoxa(), and recogExtractNumbers().
void boxaaDestroy | ( | BOXAA ** | pbaa | ) |
[in,out] | pbaa | will be set to null before returning |
Definition at line 1207 of file boxbasic.c.
References Boxaa::boxa, boxaDestroy(), and Boxaa::n.
Referenced by boxaSort2d(), pixGetWordBoxesInTextlines(), pixGetWordsInTextlines(), and recogExtractNumbers().
l_ok boxaaExtendArray | ( | BOXAA * | baa | ) |
[in] | baa |
Notes: (1) Doubles the size of the boxa ptr array. (2) The max number of boxa ptrs is 1 million.
Definition at line 1284 of file boxbasic.c.
References boxaaExtendArrayToSize(), and Boxaa::nalloc.
Referenced by boxaaAddBoxa(), and boxaaInsertBoxa().
l_ok boxaaExtendArrayToSize | ( | BOXAA * | baa, |
l_int32 | size | ||
) |
[in] | baa | |
[in] | size | new size of boxa array |
Notes: (1) If necessary, reallocs the boxa ptr array to size. (2) size limited to 1M boxa ptrs.
Definition at line 1307 of file boxbasic.c.
References Boxaa::nalloc.
Referenced by boxaaExtendArray(), and boxaaExtendWithInit().
[in] | baa | |
[in] | maxindex | |
[in] | boxa | to be replicated into the extended ptr array |
Notes: (1) This should be used on an existing boxaa that has been fully loaded with boxa. It then extends the boxaa, loading all the additional ptrs with copies of boxa. Typically, boxa will be empty.
Definition at line 1502 of file boxbasic.c.
References boxaaAddBoxa(), boxaaExtendArrayToSize(), boxaaGetCount(), and L_COPY.
Referenced by convertSegmentedFilesToPdf().
[in] | baa | |
[in] | iboxa | index into the boxa array in the boxaa |
[in] | ibox | index into the box array in the boxa |
[in] | accessflag | L_COPY or L_CLONE |
Definition at line 1414 of file boxbasic.c.
References boxaaGetBoxa(), boxaDestroy(), boxaGetBox(), and L_CLONE.
Referenced by boxaaTranspose().
[in] | baa | |
[in] | index | to the index-th boxa |
[in] | accessflag | L_COPY or L_CLONE |
Definition at line 1386 of file boxbasic.c.
References Boxaa::boxa, boxaaGetCount(), boxaCopy(), L_CLONE, and L_COPY.
Referenced by boxaaAddBox(), boxaaAlignBox(), boxaaCopy(), boxaaFlattenAligned(), boxaaFlattenToBoxa(), boxaaGetBox(), boxaaGetBoxCount(), boxaaGetExtent(), boxaaJoin(), boxaaSelectRange(), boxaaSizeRange(), boxaaTranspose(), boxaaWriteStream(), boxaSort2d(), convertSegmentedFilesToPdf(), pixaDisplayBoxaa(), and showExtractNumbers().
l_int32 boxaaGetBoxCount | ( | BOXAA * | baa | ) |
[in] | baa |
Definition at line 1358 of file boxbasic.c.
References boxaaGetBoxa(), boxaaGetCount(), boxaDestroy(), boxaGetCount(), and L_CLONE.
l_int32 boxaaGetCount | ( | BOXAA * | baa | ) |
[in] | baa |
Definition at line 1343 of file boxbasic.c.
References Boxaa::n.
Referenced by boxaaAddBox(), boxaaAddBoxa(), boxaaAlignBox(), boxaaCopy(), boxaaExtendWithInit(), boxaaFlattenAligned(), boxaaFlattenToBoxa(), boxaaGetBoxa(), boxaaGetBoxCount(), boxaaGetExtent(), boxaaInsertBoxa(), boxaaJoin(), boxaaRemoveBoxa(), boxaaReplaceBoxa(), boxaaSelectRange(), boxaaSizeRange(), boxaaTranspose(), boxaaWriteStream(), boxaSort2d(), convertSegmentedFilesToPdf(), and pixaDisplayBoxaa().
[in] | baa | typically empty |
[in] | boxa | to be replicated into the entire ptr array |
Notes: (1) This initializes a boxaa by filling up the entire boxa ptr array with copies of boxa. Any existing boxa are destroyed. After this operation, the number of boxa is equal to the number of allocated ptrs. (2) Note that we use boxaaReplaceBoxa() which replaces a boxa, instead of boxaaInsertBoxa(), which is O(n) and shifts all the boxa pointers from the insertion point to the end. (3) Example usage. This function is useful to prepare for a random insertion (or replacement) of boxa into a boxaa. To randomly insert boxa into a boxaa, up to some index "max": Boxaa *baa = boxaaCreate(max); // initialize the boxa Boxa *boxa = boxaCreate(...); ... [optionally fill with boxes] boxaaInitFull(baa, boxa); A typical use is to initialize the array with empty boxa, and to replace only a subset that must be aligned with something else, such as a pixa.
Definition at line 1464 of file boxbasic.c.
References boxaaReplaceBoxa(), boxaCopy(), L_COPY, Boxaa::n, and Boxaa::nalloc.
Referenced by convertNumberedMasksToBoxaa().
[in] | baa | |
[in] | index | location in boxaa to insert new boxa |
[in] | boxa | new boxa to be inserted |
Notes: (1) This shifts boxa[i] --> boxa[i + 1] for all i >= index, and then inserts boxa as boxa[index]. It is typically used when baa is full of boxa. (2) To insert at the beginning of the array, set index = 0. (3) To append to the array, it is equivalent to boxaaAddBoxa(). (4) This should not be used repeatedly to insert into large arrays, because the function is O(n).
Definition at line 1582 of file boxbasic.c.
References Boxaa::boxa, boxaaExtendArray(), boxaaGetCount(), Boxaa::n, and Boxaa::nalloc.
BOXAA* boxaaRead | ( | const char * | filename | ) |
[in] | filename |
Definition at line 1755 of file boxbasic.c.
References boxaaReadStream(), and fopenReadStream().
BOXAA* boxaaReadFromFiles | ( | const char * | dirname, |
const char * | substr, | ||
l_int32 | first, | ||
l_int32 | nfiles | ||
) |
[in] | dirname | directory |
[in] | substr | [optional] substring filter on filenames; can be NULL |
[in] | first | 0-based |
[in] | nfiles | use 0 for everything from first to the end |
Notes: (1) The files must be serialized boxa files (e.g., *.ba). If some files cannot be read, warnings are issued. (2) Use substr to filter filenames in the directory. If substr == NULL, this takes all files. (3) After filtering, use first and nfiles to select a contiguous set of files, that have been lexically sorted in increasing order.
Definition at line 1713 of file boxbasic.c.
References boxaaAddBoxa(), boxaaCreate(), boxaRead(), getSortedPathnamesInDirectory(), L_INSERT, L_NOCOPY, sarrayDestroy(), sarrayGetCount(), and sarrayGetString().
BOXAA* boxaaReadMem | ( | const l_uint8 * | data, |
size_t | size | ||
) |
[in] | data | serialization of boxaa; in ascii |
[in] | size | of data in bytes; can use strlen to get it |
Definition at line 1833 of file boxbasic.c.
References boxaaReadStream(), and fopenReadFromMemory().
BOXAA* boxaaReadStream | ( | FILE * | fp | ) |
[in] | fp | input file stream |
Notes: (1) It is OK for the boxaa to be empty (n == 0).
Definition at line 1785 of file boxbasic.c.
References BOXAA_VERSION_NUMBER.
Referenced by boxaaRead(), and boxaaReadMem().
l_ok boxaaRemoveBoxa | ( | BOXAA * | baa, |
l_int32 | index | ||
) |
[in] | baa | |
[in] | index | of the boxa to be removed and destroyed |
Notes: (1) This removes boxa[index] and then shifts boxa[i] --> boxa[i - 1] for all i > index. (2) The removed boxaa is destroyed. (2) This should not be used repeatedly on large arrays, because the function is O(n).
Definition at line 1629 of file boxbasic.c.
References Boxaa::boxa, boxaaGetCount(), boxaDestroy(), and Boxaa::n.
[in] | baa | |
[in] | index | to the index-th boxa |
[in] | boxa | insert and replace any existing one |
Notes: (1) Any existing boxa is destroyed, and the input one is inserted in its place. (2) If the index is invalid, return 1 (error)
Definition at line 1542 of file boxbasic.c.
References Boxaa::boxa, boxaaGetCount(), and boxaDestroy().
Referenced by boxaaInitFull(), boxaSort2d(), and convertNumberedMasksToBoxaa().
l_ok boxaaWrite | ( | const char * | filename, |
BOXAA * | baa | ||
) |
[in] | filename | |
[in] | baa |
Definition at line 1859 of file boxbasic.c.
References boxaaWriteStream(), and fopenWriteStream().
l_ok boxaaWriteMem | ( | l_uint8 ** | pdata, |
size_t * | psize, | ||
BOXAA * | baa | ||
) |
[out] | pdata | data of serialized boxaa; ascii |
[out] | psize | size of returned data |
[in] | baa |
Notes: (1) Serializes a boxaa in memory and puts the result in a buffer.
Definition at line 1933 of file boxbasic.c.
References boxaaWriteStream(), fopenWriteWinTempfile(), and l_binaryReadStream().
l_ok boxaaWriteStream | ( | FILE * | fp, |
BOXAA * | baa | ||
) |
[in] | fp | output file stream |
[in] | baa |
Definition at line 1888 of file boxbasic.c.
References BOXAA_VERSION_NUMBER, boxaaGetBoxa(), boxaaGetCount(), boxaDestroy(), boxaGetExtent(), boxaWriteStream(), boxDestroy(), boxGetGeometry(), and L_CLONE.
Referenced by boxaaWrite(), and boxaaWriteMem().
l_ok boxaClear | ( | BOXA * | boxa | ) |
[in] | boxa |
Notes: (1) This destroys all boxes in the boxa, setting the ptrs to null. The number of allocated boxes, n, is set to 0.
Definition at line 1120 of file boxbasic.c.
References Boxa::box, boxaGetCount(), boxDestroy(), and Boxa::n.
Referenced by pixaClear().
[in] | boxa | |
[in] | copyflag | L_COPY, L_CLONE, L_COPY_CLONE |
Notes: (1) See pix.h for description of the copyflag. (2) The copy-clone makes a new boxa that holds clones of each box.
Definition at line 475 of file boxbasic.c.
References boxaAddBox(), boxaCreate(), boxaGetBox(), L_CLONE, L_COPY, L_COPY_CLONE, L_INSERT, Boxa::n, Boxa::nalloc, and Boxa::refcount.
Referenced by boxaaAddBoxa(), boxaAdjustHeightToTarget(), boxaAdjustWidthToTarget(), boxaaGetBoxa(), boxaaInitFull(), boxaBinSort(), boxaCombineOverlaps(), boxaCombineOverlapsInPair(), boxaFillSequence(), boxaHandleOverlaps(), boxaModifyWithBoxa(), boxaPermuteRandom(), boxaPruneSortedOnOverlap(), boxaReconcileAllByMedian(), boxaReconcileSidesByMedian(), boxaReconcileSizeByMedian(), boxaRotateOrth(), boxaSelectByArea(), boxaSelectBySize(), boxaSelectByWHRatio(), boxaSelectRange(), boxaSelectWithIndicator(), boxaSetSide(), boxaSmoothSequenceMedian(), boxaSort(), boxaSortByIndex(), boxaWindowedMedian(), dewarpaApplyDisparityBoxa(), pixaaGetBoxa(), pixacompGetBoxa(), pixaGetBoxa(), and pixaSetBoxa().
BOXA* boxaCreate | ( | l_int32 | n | ) |
[in] | n | initial number of ptrs; 0 for default |
Definition at line 442 of file boxbasic.c.
Referenced by boxaAdjustSides(), boxaaFlattenAligned(), boxaaFlattenToBoxa(), boxaaGetExtent(), boxaaQuadtreeRegions(), boxaaTranspose(), boxaClipToBox(), boxaContainedInBox(), boxaCopy(), boxaEncapsulateAligned(), boxaGenerateSubboxes(), boxaHandleOverlaps(), boxaIntersectsBox(), boxaMergeEvenOdd(), boxaModifyWithBoxa(), boxaPruneSortedOnOverlap(), boxaReconcileSizeByMedian(), boxaRotateOrth(), boxaSaveValid(), boxaSelectLargeULBox(), boxaSelectRange(), boxaSelectWithIndicator(), boxaShiftWithPta(), boxaSort2d(), boxaSort2dByIndex(), boxaSortByIndex(), boxaSplitEvenOdd(), boxaTransform(), boxaTransformOrdered(), boxaWindowedMedian(), convertNumberedMasksToBoxaa(), convertSegmentedFilesToPdf(), generatePtaGrid(), makeMosaicStrips(), pixaClipToForeground(), pixaDisplayTiledInRows(), pixaSetFullSizeBoxa(), ptaConvertToBoxa(), and recogExtractNumbers().
void boxaDestroy | ( | BOXA ** | pboxa | ) |
[in,out] | pboxa | will be set to null before returning |
Notes: (1) Decrements the ref count and, if 0, destroys the boxa. (2) Always nulls the input ptr.
Definition at line 519 of file boxbasic.c.
References Boxa::box, boxDestroy(), Boxa::n, and Boxa::refcount.
Referenced by boxaaAddBox(), boxaaAlignBox(), boxaaDestroy(), boxaaFlattenAligned(), boxaaFlattenToBoxa(), boxaaGetBox(), boxaaGetBoxCount(), boxaaGetExtent(), boxaaRemoveBoxa(), boxaaReplaceBoxa(), boxaaSizeRange(), boxaaTranspose(), boxaaWriteStream(), boxaCombineOverlaps(), boxaCombineOverlapsInPair(), boxaCompareRegions(), boxaDisplayTiled(), boxaFillSequence(), boxaHandleOverlaps(), boxaMedianDimensions(), boxaPlotSides(), boxaPlotSizes(), boxaReconcilePairWidth(), boxaReconcileSidesByMedian(), boxaReconcileSizeByMedian(), boxaRotateOrth(), boxaSelectLargeULBox(), boxaSizeVariation(), boxaSort2d(), boxaTransform(), boxaTransformOrdered(), ccbDestroy(), convertNumberedMasksToBoxaa(), convertSegmentedFilesToPdf(), evalColorfillData(), generatePtaGrid(), l_colorfillDestroy(), partelDestroy(), pixaAddBorderGeneral(), pixaaDestroy(), pixaaDisplay(), pixacompDestroy(), pixacompJoin(), pixaCreateFromPixacomp(), pixaDestroy(), pixaDisplay(), pixaDisplayBoxaa(), pixaDisplayRandomCmap(), pixaEqual(), pixaIsFull(), pixaJoin(), pixaSetBoxa(), pixaTranslate(), pixAutoPhotoinvert(), pixGetWordBoxesInTextlines(), pixGetWordsInTextlines(), pixMorphSequenceByComponent(), pixSelectByArea(), pixSelectByAreaFraction(), pixSelectByPerimSizeRatio(), pixSelectByPerimToAreaRatio(), pixSelectBySize(), pixSelectByWidthHeightRatio(), pixSelectLargeULComp(), recogDestroyDid(), and showExtractNumbers().
l_ok boxaExtendArray | ( | BOXA * | boxa | ) |
[in] | boxa |
Notes: (1) Reallocs with doubled size of ptr array.
Definition at line 602 of file boxbasic.c.
References boxaExtendArrayToSize(), and Boxa::nalloc.
Referenced by boxaAddBox(), boxaInsertBox(), and pixaInsertPix().
l_ok boxaExtendArrayToSize | ( | BOXA * | boxa, |
size_t | size | ||
) |
[in] | boxa | |
[in] | size | new size of boxa ptr array |
Notes: (1) If necessary, reallocs new boxa ptr array to size. (2) The max number of box ptrs is 10M.
Definition at line 625 of file boxbasic.c.
References Boxa::nalloc.
Referenced by boxaExtendArray().
[in] | boxa |
Definition at line 765 of file boxbasic.c.
References boxaGetBoxGeometry(), boxaGetCount(), boxaGetValidCount(), numaMakeConstant(), and numaSetValue().
[in] | boxa | |
[in] | index | to the index-th box |
[in] | accessflag | L_COPY or L_CLONE |
Definition at line 702 of file boxbasic.c.
References Boxa::box, boxClone(), boxCopy(), L_CLONE, L_COPY, and Boxa::n.
Referenced by boxaAdjustBoxSides(), boxaAdjustSides(), boxaaFlattenAligned(), boxaaFlattenToBoxa(), boxaaGetBox(), boxaConvertToPta(), boxaCopy(), boxaDisplayTiled(), boxaEncapsulateAligned(), boxaEqual(), boxaExtractSortedPattern(), boxaFillAll(), boxaGetBoxGeometry(), boxaGetCoverage(), boxaGetNearestToLine(), boxaGetNearestToPt(), boxaGetValidBox(), boxaHandleOverlaps(), boxaIsFull(), boxaJoin(), boxaMergeEvenOdd(), boxaPruneSortedOnOverlap(), boxaReconcilePairWidth(), boxaReconcileSizeByMedian(), boxaRemoveBoxAndSave(), boxaRotateOrth(), boxaSelectLargeULBox(), boxaSelectPivotBox(), boxaSelectRange(), boxaSelectWithIndicator(), boxaSetSide(), boxaShiftWithPta(), boxaSimilar(), boxaSort2d(), boxaSort2dByIndex(), boxaSortByIndex(), boxaSplitEvenOdd(), boxaTransform(), boxaTransformOrdered(), boxaWriteStderr(), boxaWriteStream(), boxCheckIfOverlapIsBig(), ccbaDisplayImage1(), dewarpShowResults(), generatePtaaBoxa(), generatePtaaHashBoxa(), generatePtaBoxa(), generatePtaHashBoxa(), pixaCreateFromBoxa(), pixaDisplayBoxaa(), pixAutoPhotoinvert(), pixBlendBoxaRandom(), pixClipRectangles(), recogExtractNumbers(), and recogRescoreDidResult().
l_ok boxaGetBoxGeometry | ( | BOXA * | boxa, |
l_int32 | index, | ||
l_int32 * | px, | ||
l_int32 * | py, | ||
l_int32 * | pw, | ||
l_int32 * | ph | ||
) |
[in] | boxa | |
[in] | index | to the index-th box |
[out] | px,py,pw,ph | [optional] each can be null |
Definition at line 796 of file boxbasic.c.
References boxaGetBox(), boxDestroy(), boxGetGeometry(), L_CLONE, and Boxa::n.
Referenced by boxaBinSort(), boxaExtractAsNuma(), boxaExtractAsPta(), boxaExtractCorners(), boxaFindInvalidBoxes(), boxaGetArea(), boxaGetAverageSize(), boxaGetExtent(), boxaGetNearestByDirection(), boxaGetValidCount(), boxaLocationRange(), boxaMakeAreaIndicator(), boxaMakeSizeIndicator(), boxaMakeWHRatioIndicator(), boxaMedianDimensions(), boxaPlotSides(), boxaPlotSizes(), boxaSelectLargeULBox(), boxaSelectPivotBox(), boxaSizeConsistency(), boxaSizeRange(), ccbaDisplayImage2(), ccbaGenerateGlobalLocs(), ccbaGenerateSPGlobalLocs(), pixaBinSort(), and pixCopyWithBoxa().
l_int32 boxaGetCount | ( | const BOXA * | boxa | ) |
[in] | boxa |
Definition at line 661 of file boxbasic.c.
References Boxa::n.
Referenced by boxaaAlignBox(), boxaAddBox(), boxaAdjustHeightToTarget(), boxaAdjustSides(), boxaAdjustWidthToTarget(), boxaaFlattenAligned(), boxaaFlattenToBoxa(), boxaaGetBoxCount(), boxaaTranspose(), boxaBinSort(), boxaClear(), boxaClipToBox(), boxaCombineOverlaps(), boxaCombineOverlapsInPair(), boxaCompareRegions(), boxaContainedInBox(), boxaContainedInBoxa(), boxaContainedInBoxCount(), boxaConvertToPta(), boxaDisplayTiled(), boxaEncapsulateAligned(), boxaEqual(), boxaExtractAsNuma(), boxaExtractAsPta(), boxaExtractCorners(), boxaExtractSortedPattern(), boxaFillAll(), boxaFillSequence(), boxaFindInvalidBoxes(), boxaFindNearestBoxes(), boxaGetArea(), boxaGetAverageSize(), boxaGetCoverage(), boxaGetExtent(), boxaGetNearestByDirection(), boxaGetNearestToLine(), boxaGetNearestToPt(), boxaGetValidCount(), boxaHandleOverlaps(), boxaInsertBox(), boxaIntersectsBox(), boxaIntersectsBoxCount(), boxaIsFull(), boxaJoin(), boxaLocationRange(), boxaMakeAreaIndicator(), boxaMakeSizeIndicator(), boxaMakeWHRatioIndicator(), boxaMedianDimensions(), boxaMergeEvenOdd(), boxaModifyWithBoxa(), boxaPermutePseudorandom(), boxaPermuteRandom(), boxaPlotSides(), boxaPlotSizes(), boxaPruneSortedOnOverlap(), boxaReconcilePairWidth(), boxaReconcileSizeByMedian(), boxaRemoveBoxAndSave(), boxaRotateOrth(), boxaSaveValid(), boxaSelectByArea(), boxaSelectBySize(), boxaSelectByWHRatio(), boxaSelectLargeULBox(), boxaSelectPivotBox(), boxaSelectRange(), boxaSetSide(), boxaShiftWithPta(), boxaSimilar(), boxaSizeConsistency(), boxaSizeRange(), boxaSizeVariation(), boxaSmoothSequenceMedian(), boxaSort(), boxaSort2d(), boxaSort2dByIndex(), boxaSortByIndex(), boxaSplitEvenOdd(), boxaSwapBoxes(), boxaTransform(), boxaTransformOrdered(), boxaWindowedMedian(), boxaWriteStderr(), boxaWriteStream(), boxCheckIfOverlapIsBig(), convertSegmentedFilesToPdf(), generatePtaaBoxa(), generatePtaaHashBoxa(), generatePtaBoxa(), generatePtaHashBoxa(), pixaaDisplay(), pixaBinSort(), pixacompGetBoxaCount(), pixaCreateFromBoxa(), pixaDisplayBoxaa(), pixaEqual(), pixaGetBoxaCount(), pixaRemovePix(), pixaRemovePixAndSave(), pixaSort(), pixAutoPhotoinvert(), pixBlendBoxaRandom(), pixClipRectangles(), pixCopyWithBoxa(), pixDrawBoxa(), pixDrawBoxaRandom(), pixPaintBoxa(), pixPaintBoxaRandom(), pixSelectLargeULComp(), and pixSetBlackOrWhiteBoxa().
[in] | boxa | |
[in] | index | to the index-th box |
[in] | accessflag | L_COPY or L_CLONE |
Notes: (1) This returns NULL for an invalid box in a boxa. For a box to be valid, both the width and height must be > 0. (2) We allow invalid boxes, with w = 0 or h = 0, as placeholders in boxa for which the index of the box in the boxa is important. This is an atypical situation; usually you want to put only valid boxes in a boxa.
Definition at line 739 of file boxbasic.c.
References boxaGetBox(), boxDestroy(), and boxGetGeometry().
Referenced by boxaAdjustHeightToTarget(), boxaAdjustWidthToTarget(), boxaClipToBox(), boxaCombineOverlaps(), boxaCombineOverlapsInPair(), boxaContainedInBox(), boxaContainedInBoxa(), boxaContainedInBoxCount(), boxaFillAll(), boxaGetNearestToLine(), boxaGetNearestToPt(), boxaGetSizes(), boxaHandleOverlaps(), boxaIntersectsBox(), boxaIntersectsBoxCount(), boxaModifyWithBoxa(), boxaReconcileSizeByMedian(), and boxaSaveValid().
l_int32 boxaGetValidCount | ( | BOXA * | boxa | ) |
[in] | boxa |
Definition at line 676 of file boxbasic.c.
References boxaGetBoxGeometry(), and boxaGetCount().
Referenced by boxaExtractAsNuma(), boxaExtractAsPta(), boxaFillAll(), boxaFillSequence(), boxaFindInvalidBoxes(), boxaGetMedianVals(), boxaGetRankVals(), boxaGetSizes(), boxaMedianDimensions(), boxaReconcileAllByMedian(), boxaReconcileSidesByMedian(), boxaReconcileSizeByMedian(), and boxaSizeConsistency().
[in] | boxa | typically empty |
[in] | box | [optional] to be replicated into the entire ptr array |
Notes: (1) This initializes a boxa by filling up the entire box ptr array with copies of box. If box == NULL, use a placeholder box of zero size. Any existing boxes are destroyed. After this opepration, the number of boxes is equal to the number of allocated ptrs. (2) Note that we use boxaReplaceBox() instead of boxaInsertBox(). They both have the same effect when inserting into a NULL ptr in the boxa ptr array: (3) Example usage. This function is useful to prepare for a random insertion (or replacement) of boxes into a boxa. To randomly insert boxes into a boxa, up to some index "max": Boxa *boxa = boxaCreate(max); boxaInitFull(boxa, NULL); If you want placeholder boxes of non-zero size: Boxa *boxa = boxaCreate(max); Box *box = boxCreate(...); boxaInitFull(boxa, box); boxDestroy(&box); If we have an existing boxa with a smaller ptr array, it can be reused for up to max boxes: boxaExtendArrayToSize(boxa, max); boxaInitFull(boxa, NULL); The initialization allows the boxa to always be properly filled, even if all the boxes are not later replaced. If you want to know which boxes have been replaced, and you initialized with invalid zero-sized boxes, use boxaGetValidBox() to return NULL for the invalid boxes.
Definition at line 1085 of file boxbasic.c.
References boxaReplaceBox(), boxCopy(), boxCreate(), Boxa::n, and Boxa::nalloc.
Referenced by pixaInitFull().
[in] | boxa | |
[in] | index | location in boxa to insert new value |
[in] | box | new box to be inserted; the boxa now owns it |
Notes: (1) This shifts box[i] --> box[i + 1] for all i >= index, and then inserts box as box[index]. (2) To insert at the beginning of the array, set index = 0. (3) To append to the array, it's easier to use boxaAddBox(). (4) This should not be used repeatedly to insert into large arrays, because the function is O(n).
Definition at line 911 of file boxbasic.c.
References Boxa::box, boxaExtendArray(), boxaGetCount(), Boxa::n, and Boxa::nalloc.
Referenced by pixaInsertPix().
l_ok boxaIsFull | ( | BOXA * | boxa, |
l_int32 * | pfull | ||
) |
[in] | boxa | |
[out] | pfull | 1 if boxa is full; 0 otherwise |
Definition at line 830 of file boxbasic.c.
References boxaGetBox(), boxaGetCount(), boxDestroy(), and L_CLONE.
Referenced by boxaShiftWithPta(), and pixaIsFull().
BOXA* boxaRead | ( | const char * | filename | ) |
[in] | filename |
Definition at line 1984 of file boxbasic.c.
References boxaReadStream(), and fopenReadStream().
Referenced by boxaaReadFromFiles().
BOXA* boxaReadMem | ( | const l_uint8 * | data, |
size_t | size | ||
) |
[in] | data | serialization of boxa; in ascii |
[in] | size | of data in bytes; can use strlen to get it |
Definition at line 2059 of file boxbasic.c.
References boxaReadStream(), and fopenReadFromMemory().
BOXA* boxaReadStream | ( | FILE * | fp | ) |
[in] | fp | input file stream |
Notes: (1) It is OK for the boxa to be empty (n == 0).
Definition at line 2014 of file boxbasic.c.
References BOXA_VERSION_NUMBER.
Referenced by boxaRead(), and boxaReadMem().
l_ok boxaRemoveBox | ( | BOXA * | boxa, |
l_int32 | index | ||
) |
[in] | boxa | |
[in] | index | of box to be removed and destroyed |
Notes: (1) This removes box[index] and then shifts box[i] --> box[i - 1] for all i > index. (2) It should not be used repeatedly to remove boxes from large arrays, because the function is O(n).
Definition at line 957 of file boxbasic.c.
References boxaRemoveBoxAndSave().
Referenced by pixaRemovePix().
[in] | boxa | |
[in] | index | of box to be removed |
[out] | pbox | [optional] removed box |
Notes: (1) This removes box[index] and then shifts box[i] --> box[i - 1] for all i > index. (2) It should not be used repeatedly to remove boxes from large arrays, because the function is O(n).
Definition at line 981 of file boxbasic.c.
References Boxa::box, boxaGetBox(), boxaGetCount(), boxDestroy(), L_CLONE, and Boxa::n.
Referenced by boxaRemoveBox(), and pixaRemovePixAndSave().
[in] | boxa | |
[in] | index | to the index-th box |
[in] | box | insert this box to replace existing one |
Notes: (1) In-place replacement of one box; the input box is now owned by the boxa. (2) The previous box at that location, if any, is destroyed.
Definition at line 875 of file boxbasic.c.
References Boxa::box, boxDestroy(), and Boxa::n.
Referenced by boxaCombineOverlaps(), boxaCombineOverlapsInPair(), boxaFillAll(), boxaHandleOverlaps(), boxaInitFull(), pixaAddBorderGeneral(), and pixaReplacePix().
[in] | boxas | |
[in] | copyflag | L_COPY or L_CLONE |
Notes: (1) This makes a copy/clone of each valid box.
Definition at line 1023 of file boxbasic.c.
References boxaAddBox(), boxaCreate(), boxaGetCount(), boxaGetValidBox(), L_CLONE, L_COPY, and L_INSERT.
Referenced by boxaCombineOverlaps(), boxaCombineOverlapsInPair(), and boxaDisplayTiled().
l_ok boxaWrite | ( | const char * | filename, |
BOXA * | boxa | ||
) |
[in] | filename | |
[in] | boxa |
Definition at line 2114 of file boxbasic.c.
References boxaWriteStream(), and fopenWriteStream().
Referenced by boxaWriteDebug().
l_ok boxaWriteDebug | ( | const char * | filename, |
BOXA * | boxa | ||
) |
[in] | filename | |
[in] | boxa |
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 boxaWrite() 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 2094 of file boxbasic.c.
References boxaWrite().
Referenced by boxaSmoothSequenceMedian().
l_ok boxaWriteMem | ( | l_uint8 ** | pdata, |
size_t * | psize, | ||
BOXA * | boxa | ||
) |
[out] | pdata | data of serialized boxa; ascii |
[out] | psize | size of returned data |
[in] | boxa |
Notes: (1) Serializes a boxa in memory and puts the result in a buffer.
Definition at line 2212 of file boxbasic.c.
References boxaWriteStream(), fopenWriteWinTempfile(), and l_binaryReadStream().
l_ok boxaWriteStderr | ( | BOXA * | boxa | ) |
[in] | boxa |
Definition at line 2176 of file boxbasic.c.
References BOXA_VERSION_NUMBER, boxaGetBox(), boxaGetCount(), boxDestroy(), Box::h, L_CLONE, lept_stderr(), Box::w, Box::x, and Box::y.
Referenced by boxaWriteStream().
l_ok boxaWriteStream | ( | FILE * | fp, |
BOXA * | boxa | ||
) |
[in] | fp | file stream; use NULL for stderr |
[in] | boxa |
Definition at line 2144 of file boxbasic.c.
References BOXA_VERSION_NUMBER, boxaGetBox(), boxaGetCount(), boxaWriteStderr(), boxDestroy(), Box::h, L_CLONE, Box::w, Box::x, and Box::y.
Referenced by boxaaWriteStream(), boxaWrite(), boxaWriteMem(), pixaaWriteStream(), pixacompWriteStream(), and pixaWriteStream().
[in] | box |
Definition at line 249 of file boxbasic.c.
References Box::refcount.
Referenced by boxaAddBox(), boxaGetBox(), pixacompGetBox(), and pixaGetBox().
[in] | box |
Definition at line 230 of file boxbasic.c.
References boxCreate(), Box::h, Box::w, Box::x, and Box::y.
Referenced by boxaAddBox(), boxaCombineOverlaps(), boxaCombineOverlapsInPair(), boxaGetBox(), boxaInitFull(), boxBoundingRegion(), boxClipToRectangle(), boxRelocateOneSide(), boxRotateOrth(), partelCreate(), pixacompGetBox(), and pixaGetBox().
BOX* boxCreate | ( | l_int32 | x, |
l_int32 | y, | ||
l_int32 | w, | ||
l_int32 | h | ||
) |
[in] | x,y,w,h |
Notes: (1) This clips the box to the +quad. If no part of the box is in the +quad, this returns NULL. (2) We allow you to make a box with w = 0 and/or h = 0. This does not represent a valid region, but it is useful as a placeholder in a boxa for which the index of the box in the boxa is important. This is an atypical situation; usually you want to put only valid boxes with nonzero width and height in a boxa. If you have a boxa with invalid boxes, the accessor boxaGetValidBox() will return NULL on each invalid box. (3) If you want to create only valid boxes, use boxCreateValid(), which returns NULL if either w or h is 0.
Definition at line 171 of file boxbasic.c.
References boxSetGeometry(), and Box::refcount.
Referenced by boxaAdjustSides(), boxaaFlattenAligned(), boxaaFlattenToBoxa(), boxaaGetExtent(), boxaaQuadtreeRegions(), boxaCombineOverlaps(), boxaCombineOverlapsInPair(), boxAdjustSides(), boxaGenerateSubboxes(), boxaGetExtent(), boxaInitFull(), boxaModifyWithBoxa(), boxaSplitEvenOdd(), boxaWindowedMedian(), boxBoundingRegion(), boxCopy(), boxCreateValid(), boxOverlapRegion(), boxRotateOrth(), boxTransform(), boxTransformOrdered(), ccbaReadStream(), generatePtaGrid(), ioFormatTest(), makeMosaicStrips(), pixaDisplayTiledByIndex(), pixaSetFullSizeBoxa(), pixClipRectangleWithBorder(), pixCropAlignedToCentroid(), pixPrepare1bpp(), pixTilingGetTile(), pixWarpStereoscopic(), ptaConvertToBox(), ptaConvertToBoxa(), and ptaGetBoundingRegion().
BOX* boxCreateValid | ( | l_int32 | x, |
l_int32 | y, | ||
l_int32 | w, | ||
l_int32 | h | ||
) |
[in] | x,y,w,h |
Notes: (1) This returns NULL if either w = 0 or h = 0.
Definition at line 212 of file boxbasic.c.
References boxCreate().
void boxDestroy | ( | BOX ** | pbox | ) |
[in,out] | pbox | will be set to null before returning |
Notes: (1) Decrements the ref count and, if 0, destroys the box. (2) Always nulls the input ptr.
Definition at line 273 of file boxbasic.c.
References Box::refcount.
Referenced by boxaaAlignBox(), boxaAddBox(), boxaAdjustBoxSides(), boxaAdjustHeightToTarget(), boxaAdjustSides(), boxaAdjustWidthToTarget(), boxaaWriteStream(), boxaClear(), boxaClipToBox(), boxaCombineOverlaps(), boxaCombineOverlapsInPair(), boxaCompareRegions(), boxaContainedInBox(), boxaContainedInBoxa(), boxaContainedInBoxCount(), boxaConvertToPta(), boxaDestroy(), boxaDisplayTiled(), boxaEqual(), boxaExtractSortedPattern(), boxaFillAll(), boxaGenerateSubboxes(), boxaGetBoxGeometry(), boxaGetCoverage(), boxaGetNearestToLine(), boxaGetNearestToPt(), boxaGetSizes(), boxaGetValidBox(), boxaHandleOverlaps(), boxaIntersectsBox(), boxaIntersectsBoxCount(), boxaIsFull(), boxaModifyWithBoxa(), boxaPruneSortedOnOverlap(), boxaReconcilePairWidth(), boxaReconcileSizeByMedian(), boxaRemoveBoxAndSave(), boxaReplaceBox(), boxaRotateOrth(), boxaSelectPivotBox(), boxaSetSide(), boxaShiftWithPta(), boxaSimilar(), boxaTransform(), boxaTransformOrdered(), boxaWriteStderr(), boxaWriteStream(), boxCheckIfOverlapIsBig(), boxClipToRectangleParams(), boxOverlapArea(), boxOverlapFraction(), ccbaDisplayImage1(), dewarpShowResults(), evalColorfillData(), generatePtaaBoxa(), generatePtaaHashBoxa(), generatePtaBoxa(), generatePtaHashBoxa(), ioFormatTest(), partelDestroy(), pixaClipToForeground(), pixacompGetBoxGeometry(), pixaCreateFromBoxa(), pixAddWithIndicator(), pixaDisplayBoxaa(), pixaGetBoxGeometry(), pixaRotateOrth(), pixAutoPhotoinvert(), pixBlendBoxaRandom(), pixClipRectangle(), pixClipRectangles(), pixClipRectangleWithBorder(), pixCompareGrayByHisto(), pixPrepare1bpp(), pixRemoveWithIndicator(), pixTilingGetTile(), recogAverageSamples(), recogExtractNumbers(), recogRescoreDidResult(), selCreateFromPta(), and showExtractNumbers().
l_ok boxGetGeometry | ( | const BOX * | box, |
l_int32 * | px, | ||
l_int32 * | py, | ||
l_int32 * | pw, | ||
l_int32 * | ph | ||
) |
[in] | box | |
[out] | px,py,pw,ph | [optional] each can be null |
Definition at line 301 of file boxbasic.c.
References Box::h, Box::w, Box::x, and Box::y.
Referenced by boxaaAlignBox(), boxaAdjustHeightToTarget(), boxaAdjustSides(), boxaAdjustWidthToTarget(), boxaaGetExtent(), boxaaWriteStream(), boxaCompareRegions(), boxAdjustSides(), boxaExtractSortedPattern(), boxaGenerateSubboxes(), boxaGetBoxGeometry(), boxaGetCoverage(), boxaGetSizes(), boxaGetValidBox(), boxaHandleOverlaps(), boxaModifyWithBoxa(), boxaReconcilePairWidth(), boxaReconcileSizeByMedian(), boxaSelectPivotBox(), boxaSort2d(), boxBoundingRegion(), boxClipToRectangleParams(), boxCompareSize(), boxContains(), boxContainsPt(), boxConvertToPta(), boxGetCenter(), boxGetSideLocations(), boxIntersectByLine(), boxIntersects(), boxOverlapArea(), boxOverlapDistance(), boxOverlapFraction(), boxOverlapRegion(), boxRelocateOneSide(), boxRotateOrth(), boxSetSide(), boxTransformOrdered(), ccbaDisplayImage1(), evalColorfillData(), findTileRegionsForSearch(), generatePtaaBoxa(), generatePtaBox(), generatePtaHashBox(), partelSetSize(), pixacompGetBoxGeometry(), pixAddWithIndicator(), pixaGetBoxGeometry(), pixAutoPhotoinvert(), pixClearInRect(), pixClipRectangle(), pixClipRectangleWithBorder(), pixCompareGrayByHisto(), pixComparePhotoRegionsByHisto(), pixRemoveWithIndicator(), recogAverageSamples(), recogExtractNumbers(), recogRescoreDidResult(), and selCreateFromPta().
l_ok boxGetSideLocations | ( | const BOX * | box, |
l_int32 * | pl, | ||
l_int32 * | pr, | ||
l_int32 * | pt, | ||
l_int32 * | pb | ||
) |
[in] | box | |
[out] | pl,pt,pr,pb | [optional] each can be null |
Notes: (1) All returned values are within the box.
Definition at line 358 of file boxbasic.c.
References boxGetGeometry().
Referenced by boxaReconcileSizeByMedian(), and boxSimilar().
l_ok boxIsValid | ( | BOX * | box, |
l_int32 * | pvalid | ||
) |
[in] | box | |
[out] | pvalid | 1 if valid; 0 otherwise |
Definition at line 417 of file boxbasic.c.
References Box::h, and Box::w.
Referenced by boxaClipToBox(), boxaContainedInBox(), boxaContainedInBoxCount(), boxaIntersectsBox(), boxaIntersectsBoxCount(), boxaReconcileSizeByMedian(), boxBoundingRegion(), boxCompareSize(), boxContains(), boxIntersects(), boxOverlapArea(), boxOverlapDistance(), boxOverlapFraction(), boxOverlapRegion(), boxSeparationDistance(), and boxSimilar().
l_ok boxPrintStreamInfo | ( | FILE * | fp, |
BOX * | box | ||
) |
[in] | fp | file stream; use NULL for stderr |
[in] | box |
Notes: (1) This outputs debug info. Use serialization functions to write to file if you want to read the data back.
Definition at line 2270 of file boxbasic.c.
References Box::h, lept_stderr(), Box::w, Box::x, and Box::y.
l_ok boxSetGeometry | ( | BOX * | box, |
l_int32 | x, | ||
l_int32 | y, | ||
l_int32 | w, | ||
l_int32 | h | ||
) |
[in] | box | |
[in] | x,y,w,h | [optional] use -1 to leave unchanged |
Definition at line 329 of file boxbasic.c.
References Box::h, Box::w, Box::x, and Box::y.
Referenced by boxaAdjustHeightToTarget(), boxaAdjustWidthToTarget(), boxAdjustSides(), boxaReconcilePairWidth(), boxCreate(), boxRelocateOneSide(), boxSetSide(), and boxSetSideLocations().
l_ok boxSetSideLocations | ( | BOX * | box, |
l_int32 | l, | ||
l_int32 | r, | ||
l_int32 | t, | ||
l_int32 | b | ||
) |
[in] | box | |
[in] | l,r,t,b | [optional] use -1 to leave unchanged |
Definition at line 390 of file boxbasic.c.
References boxSetGeometry(), Box::h, Box::w, Box::x, and Box::y.
|
static |
n'importe quoi
Definition at line 143 of file boxbasic.c.