133 #include "allheaders.h" 171 PROCNAME(
"boxCreate");
174 return (
BOX *)ERROR_PTR(
"w and h not both >= 0", procName, NULL);
179 return (
BOX *)ERROR_PTR(
"x < 0 and box off +quad", procName, NULL);
185 return (
BOX *)ERROR_PTR(
"y < 0 and box off +quad", procName, NULL);
188 if ((box = (
BOX *)LEPT_CALLOC(1,
sizeof(
BOX))) == NULL)
189 return (
BOX *)ERROR_PTR(
"box not made", procName, NULL);
214 PROCNAME(
"boxCreateValid");
216 if (w <= 0 || h <= 0)
217 return (
BOX *)ERROR_PTR(
"w and h not both > 0", procName, NULL);
236 return (
BOX *)ERROR_PTR(
"box not defined", procName, NULL);
254 PROCNAME(
"boxClone");
257 return (
BOX *)ERROR_PTR(
"box not defined", procName, NULL);
281 PROCNAME(
"boxDestroy");
284 L_WARNING(
"ptr address is null!\n", procName);
287 if ((box = *pbox) == NULL)
315 PROCNAME(
"boxGetGeometry");
322 return ERROR_INT(
"box not defined", procName, 1);
323 if (px) *px = box->
x;
324 if (py) *py = box->
y;
325 if (pw) *pw = box->
w;
326 if (ph) *ph = box->
h;
345 PROCNAME(
"boxSetGeometry");
348 return ERROR_INT(
"box not defined", procName, 1);
349 if (x != -1) box->
x = x;
350 if (y != -1) box->
y = y;
351 if (w != -1) box->
w = w;
352 if (h != -1) box->
h = h;
378 PROCNAME(
"boxGetSideLocations");
385 return ERROR_INT(
"box not defined", procName, 1);
389 if (pr) *pr = x + w - 1;
391 if (pb) *pb = y + h - 1;
412 PROCNAME(
"boxSetSideLocations");
415 return ERROR_INT(
"box not defined", procName, 1);
416 x = (l != -1) ? l : box->
x;
417 w = (r != -1) ? r - x + 1 : box->
x + box->
w - x;
418 y = (t != -1) ? t : box->
y;
419 h = (b != -1) ? b - y + 1 : box->
y + box->
h - y;
433 PROCNAME(
"boxGetRefcount");
436 return ERROR_INT(
"box not defined", procName, UNDEF);
451 PROCNAME(
"boxChangeRefcount");
454 return ERROR_INT(
"box not defined", procName, 1);
472 PROCNAME(
"boxIsValid");
475 return ERROR_INT(
"&valid not defined", procName, 1);
478 return ERROR_INT(
"box not defined", procName, 1);
480 if (box->
w > 0 && box->
h > 0)
500 PROCNAME(
"boxaCreate");
505 boxa = (
BOXA *)LEPT_CALLOC(1,
sizeof(
BOXA));
509 if ((boxa->
box = (
BOX **)LEPT_CALLOC(n,
sizeof(
BOX *))) == NULL) {
511 return (
BOXA *)ERROR_PTR(
"boxa ptrs not made", procName, NULL);
538 PROCNAME(
"boxaCopy");
541 return (
BOXA *)ERROR_PTR(
"boxa not defined", procName, NULL);
549 return (
BOXA *)ERROR_PTR(
"invalid copyflag", procName, NULL);
552 return (
BOXA *)ERROR_PTR(
"boxac not made", procName, NULL);
553 for (i = 0; i < boxa->
n; i++) {
582 PROCNAME(
"boxaDestroy");
585 L_WARNING(
"ptr address is null!\n", procName);
589 if ((boxa = *pboxa) == NULL)
595 for (i = 0; i < boxa->
n; i++)
597 LEPT_FREE(boxa->
box);
622 PROCNAME(
"boxaAddBox");
625 return ERROR_INT(
"boxa not defined", procName, 1);
627 return ERROR_INT(
"box not defined", procName, 1);
631 else if (copyflag ==
L_COPY)
636 return ERROR_INT(
"invalid copyflag", procName, 1);
638 return ERROR_INT(
"boxc not made", procName, 1);
664 PROCNAME(
"boxaExtendArray");
667 return ERROR_INT(
"boxa not defined", procName, 1);
689 PROCNAME(
"boxaExtendArrayToSize");
692 return ERROR_INT(
"boxa not defined", procName, 1);
694 if (size > boxa->
nalloc) {
697 size *
sizeof(
BOX *))) == NULL)
698 return ERROR_INT(
"new ptr array not returned", procName, 1);
717 PROCNAME(
"boxaGetCount");
720 return ERROR_INT(
"boxa not defined", procName, 0);
734 l_int32 n, i, w, h, count;
736 PROCNAME(
"boxaGetValidCount");
739 return ERROR_INT(
"boxa not defined", procName, 0);
742 for (i = 0, count = 0; i < n; i++) {
764 PROCNAME(
"boxaGetBox");
767 return (
BOX *)ERROR_PTR(
"boxa not defined", procName, NULL);
768 if (index < 0 || index >= boxa->
n)
769 return (
BOX *)ERROR_PTR(
"index not valid", procName, NULL);
773 else if (accessflag ==
L_CLONE)
776 return (
BOX *)ERROR_PTR(
"invalid accessflag", procName, NULL);
806 PROCNAME(
"boxaGetValidBox");
809 return (
BOX *)ERROR_PTR(
"boxa not defined", procName, NULL);
811 if ((box =
boxaGetBox(boxa, index, accessflag)) == NULL)
812 return (
BOX *)ERROR_PTR(
"box not returned", procName, NULL);
814 if (w <= 0 || h <= 0)
832 PROCNAME(
"boxaFindInvalidBoxes");
835 return (
NUMA *)ERROR_PTR(
"boxa not defined", procName, NULL);
842 for (i = 0; i < n; i++) {
844 if (w == 0 || h == 0)
869 PROCNAME(
"boxaGetBoxGeometry");
876 return ERROR_INT(
"boxa not defined", procName, 1);
877 if (index < 0 || index >= boxa->
n)
878 return ERROR_INT(
"index not valid", procName, 1);
881 return ERROR_INT(
"box not found!", procName, 1);
902 PROCNAME(
"boxaIsFull");
905 return ERROR_INT(
"&full not defined", procName, 1);
908 return ERROR_INT(
"boxa not defined", procName, 1);
912 for (i = 0; i < n; i++) {
946 PROCNAME(
"boxaReplaceBox");
949 return ERROR_INT(
"boxa not defined", procName, 1);
950 if (index < 0 || index >= boxa->
n)
951 return ERROR_INT(
"index not valid", procName, 1);
953 return ERROR_INT(
"box not defined", procName, 1);
956 boxa->
box[index] = box;
987 PROCNAME(
"boxaInsertBox");
990 return ERROR_INT(
"boxa not defined", procName, 1);
992 if (index < 0 || index > n)
993 return ERROR_INT(
"index not in {0...n}", procName, 1);
995 return ERROR_INT(
"box not defined", procName, 1);
1001 for (i = n; i > index; i--)
1002 array[i] = array[i - 1];
1031 PROCNAME(
"boxaRemoveBox");
1034 return ERROR_INT(
"boxa not defined", procName, 1);
1036 if (index < 0 || index >= n)
1037 return ERROR_INT(
"index not in {0...n - 1}", procName, 1);
1041 for (i = index + 1; i < n; i++)
1042 array[i - 1] = array[i];
1043 array[n - 1] = NULL;
1074 PROCNAME(
"boxaRemoveBoxAndSave");
1076 if (pbox) *pbox = NULL;
1078 return ERROR_INT(
"boxa not defined", procName, 1);
1080 if (index < 0 || index >= n)
1081 return ERROR_INT(
"index not in {0...n - 1}", procName, 1);
1087 for (i = index + 1; i < n; i++)
1088 array[i - 1] = array[i];
1089 array[n - 1] = NULL;
1116 PROCNAME(
"boxaSaveValid");
1119 return (
BOXA *)ERROR_PTR(
"boxas not defined", procName, NULL);
1121 return (
BOXA *)ERROR_PTR(
"invalid copyflag", procName, NULL);
1125 for (i = 0; i < n; i++) {
1179 PROCNAME(
"boxaInitFull");
1182 return ERROR_INT(
"boxa not defined", procName, 1);
1186 for (i = 0; i < n; i++) {
1214 PROCNAME(
"boxaClear");
1217 return ERROR_INT(
"boxa not defined", procName, 1);
1220 for (i = 0; i < n; i++)
1241 PROCNAME(
"boxaaCreate");
1246 baa = (
BOXAA *)LEPT_CALLOC(1,
sizeof(
BOXAA));
1247 if ((baa->
boxa = (
BOXA **)LEPT_CALLOC(n,
sizeof(
BOXA *))) == NULL) {
1249 return (
BOXAA *)ERROR_PTR(
"boxa ptr array not made", procName, NULL);
1279 PROCNAME(
"boxaaCopy");
1282 return (
BOXAA *)ERROR_PTR(
"baas not defined", procName, NULL);
1284 return (
BOXAA *)ERROR_PTR(
"invalid copyflag", procName, NULL);
1288 for (i = 0; i < n; i++) {
1308 PROCNAME(
"boxaaDestroy");
1311 L_WARNING(
"ptr address is NULL!\n", procName);
1315 if ((baa = *pbaa) == NULL)
1318 for (i = 0; i < baa->
n; i++)
1320 LEPT_FREE(baa->
boxa);
1348 PROCNAME(
"boxaaAddBoxa");
1351 return ERROR_INT(
"baa not defined", procName, 1);
1353 return ERROR_INT(
"ba not defined", procName, 1);
1355 return ERROR_INT(
"invalid copyflag", procName, 1);
1381 PROCNAME(
"boxaaExtendArray");
1384 return ERROR_INT(
"baa not defined", procName, 1);
1389 return ERROR_INT(
"new ptr array not returned", procName, 1);
1412 PROCNAME(
"boxaaExtendArrayToSize");
1415 return ERROR_INT(
"baa not defined", procName, 1);
1417 if (size > baa->
nalloc) {
1420 size *
sizeof(
BOXA *))) == NULL)
1421 return ERROR_INT(
"new ptr array not returned", procName, 1);
1440 PROCNAME(
"boxaaGetCount");
1443 return ERROR_INT(
"baa not defined", procName, 0);
1460 PROCNAME(
"boxaaGetBoxCount");
1463 return ERROR_INT(
"baa not defined", procName, 0);
1466 for (sum = 0, i = 0; i < n; i++) {
1491 PROCNAME(
"boxaaGetBoxa");
1494 return (
BOXA *)ERROR_PTR(
"baa not defined", procName, NULL);
1496 if (index < 0 || index >= n)
1497 return (
BOXA *)ERROR_PTR(
"index not valid", procName, NULL);
1499 return (
BOXA *)ERROR_PTR(
"invalid accessflag", procName, NULL);
1523 PROCNAME(
"boxaaGetBox");
1526 return (
BOX *)ERROR_PTR(
"boxa not retrieved", procName, NULL);
1527 if ((box =
boxaGetBox(boxa, ibox, accessflag)) == NULL)
1528 L_ERROR(
"box not retrieved\n", procName);
1573 PROCNAME(
"boxaaInitFull");
1576 return ERROR_INT(
"baa not defined", procName, 1);
1578 return ERROR_INT(
"boxa not defined", procName, 1);
1582 for (i = 0; i < n; i++) {
1613 PROCNAME(
"boxaaExtendWithInit");
1616 return ERROR_INT(
"baa not defined", procName, 1);
1618 return ERROR_INT(
"boxa not defined", procName, 1);
1622 if (maxindex < n)
return 0;
1626 for (i = n; i <= maxindex; i++)
1654 PROCNAME(
"boxaaReplaceBoxa");
1657 return ERROR_INT(
"baa not defined", procName, 1);
1659 return ERROR_INT(
"boxa not defined", procName, 1);
1661 if (index < 0 || index >= n)
1662 return ERROR_INT(
"index not valid", procName, 1);
1665 baa->
boxa[index] = boxa;
1696 PROCNAME(
"boxaaInsertBoxa");
1699 return ERROR_INT(
"baa not defined", procName, 1);
1701 if (index < 0 || index > n)
1702 return ERROR_INT(
"index not in {0...n}", procName, 1);
1704 return ERROR_INT(
"boxa not defined", procName, 1);
1710 for (i = n; i > index; i--)
1711 array[i] = array[i - 1];
1712 array[index] = boxa;
1741 PROCNAME(
"boxaaRemoveBox");
1744 return ERROR_INT(
"baa not defined", procName, 1);
1746 if (index < 0 || index >= n)
1747 return ERROR_INT(
"index not valid", procName, 1);
1751 for (i = index + 1; i < n; i++)
1752 array[i - 1] = array[i];
1753 array[n - 1] = NULL;
1782 PROCNAME(
"boxaaAddBox");
1785 return ERROR_INT(
"baa not defined", procName, 1);
1787 if (index < 0 || index >= n)
1788 return ERROR_INT(
"index not valid", procName, 1);
1790 return ERROR_INT(
"invalid accessflag", procName, 1);
1834 PROCNAME(
"boxaaReadFromFiles");
1837 return (
BOXAA *)ERROR_PTR(
"dirname not defined", procName, NULL);
1842 return (
BOXAA *)ERROR_PTR(
"no pixa files found", procName, NULL);
1846 for (i = 0; i < n; i++) {
1848 if ((boxa =
boxaRead(fname)) == NULL) {
1849 L_ERROR(
"boxa not read for %d-th file", procName, i);
1872 PROCNAME(
"boxaaRead");
1875 return (
BOXAA *)ERROR_PTR(
"filename not defined", procName, NULL);
1878 return (
BOXAA *)ERROR_PTR(
"stream not opened", procName, NULL);
1882 return (
BOXAA *)ERROR_PTR(
"boxaa not read", procName, NULL);
1896 l_int32 n, i, x, y, w, h, version;
1901 PROCNAME(
"boxaaReadStream");
1904 return (
BOXAA *)ERROR_PTR(
"stream not defined", procName, NULL);
1906 if (fscanf(fp,
"\nBoxaa Version %d\n", &version) != 1)
1907 return (
BOXAA *)ERROR_PTR(
"not a boxaa file", procName, NULL);
1909 return (
BOXAA *)ERROR_PTR(
"invalid boxa version", procName, NULL);
1910 if (fscanf(fp,
"Number of boxa = %d\n", &n) != 1)
1911 return (
BOXAA *)ERROR_PTR(
"not a boxaa file", procName, NULL);
1914 return (
BOXAA *)ERROR_PTR(
"boxaa not made", procName, NULL);
1915 for (i = 0; i < n; i++) {
1916 if (fscanf(fp,
"\nBoxa[%d] extent: x = %d, y = %d, w = %d, h = %d",
1917 &ignore, &x, &y, &w, &h) != 5) {
1919 return (
BOXAA *)ERROR_PTR(
"boxa descr not valid", procName, NULL);
1923 return (
BOXAA *)ERROR_PTR(
"boxa not made", procName, NULL);
1945 PROCNAME(
"boxaaReadMem");
1948 return (
BOXAA *)ERROR_PTR(
"data not defined", procName, NULL);
1950 return (
BOXAA *)ERROR_PTR(
"stream not opened", procName, NULL);
1954 if (!baa) L_ERROR(
"baa not read\n", procName);
1973 PROCNAME(
"boxaaWrite");
1976 return ERROR_INT(
"filename not defined", procName, 1);
1978 return ERROR_INT(
"baa not defined", procName, 1);
1981 return ERROR_INT(
"stream not opened", procName, 1);
1985 return ERROR_INT(
"baa not written to stream", procName, 1);
2001 l_int32 n, i, x, y, w, h;
2005 PROCNAME(
"boxaaWriteStream");
2008 return ERROR_INT(
"stream not defined", procName, 1);
2010 return ERROR_INT(
"baa not defined", procName, 1);
2014 fprintf(fp,
"Number of boxa = %d\n", n);
2016 for (i = 0; i < n; i++) {
2018 return ERROR_INT(
"boxa not found", procName, 1);
2021 fprintf(fp,
"\nBoxa[%d] extent: x = %d, y = %d, w = %d, h = %d",
2052 PROCNAME(
"boxaaWriteMem");
2054 if (pdata) *pdata = NULL;
2055 if (psize) *psize = 0;
2057 return ERROR_INT(
"&data not defined", procName, 1);
2059 return ERROR_INT(
"&size not defined", procName, 1);
2061 return ERROR_INT(
"baa not defined", procName, 1);
2064 if ((fp = open_memstream((
char **)pdata, psize)) == NULL)
2065 return ERROR_INT(
"stream not opened", procName, 1);
2068 L_INFO(
"work-around: writing to a temp file\n", procName);
2071 return ERROR_INT(
"tmpfile stream not opened", procName, 1);
2073 if ((fp = tmpfile()) == NULL)
2074 return ERROR_INT(
"tmpfile stream not opened", procName, 1);
2100 PROCNAME(
"boxaRead");
2103 return (
BOXA *)ERROR_PTR(
"filename not defined", procName, NULL);
2106 return (
BOXA *)ERROR_PTR(
"stream not opened", procName, NULL);
2110 return (
BOXA *)ERROR_PTR(
"boxa not read", procName, NULL);
2124 l_int32 n, i, x, y, w, h, version;
2129 PROCNAME(
"boxaReadStream");
2132 return (
BOXA *)ERROR_PTR(
"stream not defined", procName, NULL);
2134 if (fscanf(fp,
"\nBoxa Version %d\n", &version) != 1)
2135 return (
BOXA *)ERROR_PTR(
"not a boxa file", procName, NULL);
2137 return (
BOXA *)ERROR_PTR(
"invalid boxa version", procName, NULL);
2138 if (fscanf(fp,
"Number of boxes = %d\n", &n) != 1)
2139 return (
BOXA *)ERROR_PTR(
"not a boxa file", procName, NULL);
2142 return (
BOXA *)ERROR_PTR(
"boxa not made", procName, NULL);
2143 for (i = 0; i < n; i++) {
2144 if (fscanf(fp,
" Box[%d]: x = %d, y = %d, w = %d, h = %d\n",
2145 &ignore, &x, &y, &w, &h) != 5) {
2147 return (
BOXA *)ERROR_PTR(
"box descr not valid", procName, NULL);
2171 PROCNAME(
"boxaReadMem");
2174 return (
BOXA *)ERROR_PTR(
"data not defined", procName, NULL);
2176 return (
BOXA *)ERROR_PTR(
"stream not opened", procName, NULL);
2180 if (!boxa) L_ERROR(
"boxa not read\n", procName);
2199 PROCNAME(
"boxaWrite");
2202 return ERROR_INT(
"filename not defined", procName, 1);
2204 return ERROR_INT(
"boxa not defined", procName, 1);
2207 return ERROR_INT(
"stream not opened", procName, 1);
2211 return ERROR_INT(
"boxa not written to stream", procName, 1);
2231 PROCNAME(
"boxaWriteStream");
2234 return ERROR_INT(
"stream not defined", procName, 1);
2236 return ERROR_INT(
"boxa not defined", procName, 1);
2240 fprintf(fp,
"Number of boxes = %d\n", n);
2241 for (i = 0; i < n; i++) {
2243 return ERROR_INT(
"box not found", procName, 1);
2244 fprintf(fp,
" Box[%d]: x = %d, y = %d, w = %d, h = %d\n",
2245 i, box->
x, box->
y, box->
w, box->
h);
2273 PROCNAME(
"boxaWriteMem");
2275 if (pdata) *pdata = NULL;
2276 if (psize) *psize = 0;
2278 return ERROR_INT(
"&data not defined", procName, 1);
2280 return ERROR_INT(
"&size not defined", procName, 1);
2282 return ERROR_INT(
"boxa not defined", procName, 1);
2285 if ((fp = open_memstream((
char **)pdata, psize)) == NULL)
2286 return ERROR_INT(
"stream not opened", procName, 1);
2289 L_INFO(
"work-around: writing to a temp file\n", procName);
2292 return ERROR_INT(
"tmpfile stream not opened", procName, 1);
2294 if ((fp = tmpfile()) == NULL)
2295 return ERROR_INT(
"tmpfile stream not opened", procName, 1);
2326 PROCNAME(
"boxPrintStreamInfo");
2329 return ERROR_INT(
"stream not defined", procName, 1);
2331 return ERROR_INT(
"box not defined", procName, 1);
2333 fprintf(fp,
" Box: x = %d, y = %d, w = %d, h = %d\n",
2334 box->
x, box->
y, box->
w, box->
h);
#define BOXAA_VERSION_NUMBER
BOXA * boxaReadStream(FILE *fp)
boxaReadStream()
l_int32 boxaExtendArray(BOXA *boxa)
boxaExtendArray()
BOXAA * boxaaReadStream(FILE *fp)
boxaaReadStream()
BOX * boxaGetValidBox(BOXA *boxa, l_int32 index, l_int32 accessflag)
boxaGetValidBox()
l_int32 boxaaRemoveBoxa(BOXAA *baa, l_int32 index)
boxaaRemoveBoxa()
l_int32 boxaWriteStream(FILE *fp, BOXA *boxa)
boxaWriteStream()
l_int32 boxaWrite(const char *filename, BOXA *boxa)
boxaWrite()
static const l_int32 INITIAL_PTR_ARRAYSIZE
l_int32 boxaaGetCount(BOXAA *baa)
boxaaGetCount()
l_int32 boxaExtendArrayToSize(BOXA *boxa, l_int32 size)
boxaExtendArrayToSize()
BOXAA * boxaaReadMem(const l_uint8 *data, size_t size)
boxaaReadMem()
l_int32 boxaaWriteMem(l_uint8 **pdata, size_t *psize, BOXAA *baa)
boxaaWriteMem()
l_int32 boxaRemoveBox(BOXA *boxa, l_int32 index)
boxaRemoveBox()
NUMA * numaMakeConstant(l_float32 val, l_int32 size)
numaMakeConstant()
l_int32 boxSetGeometry(BOX *box, l_int32 x, l_int32 y, l_int32 w, l_int32 h)
boxSetGeometry()
l_int32 boxaAddBox(BOXA *boxa, BOX *box, l_int32 copyflag)
boxaAddBox()
FILE * fopenReadFromMemory(const l_uint8 *data, size_t size)
fopenReadFromMemory()
l_int32 boxIsValid(BOX *box, l_int32 *pvalid)
boxIsValid()
BOXA * boxaCopy(BOXA *boxa, l_int32 copyflag)
boxaCopy()
void boxaDestroy(BOXA **pboxa)
boxaDestroy()
l_int32 boxPrintStreamInfo(FILE *fp, BOX *box)
boxPrintStreamInfo()
l_int32 boxaGetBoxGeometry(BOXA *boxa, l_int32 index, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxaGetBoxGeometry()
void * reallocNew(void **pindata, l_int32 oldsize, l_int32 newsize)
reallocNew()
l_int32 boxaClear(BOXA *boxa)
boxaClear()
l_int32 boxaaWrite(const char *filename, BOXAA *baa)
boxaaWrite()
BOX * boxClone(BOX *box)
boxClone()
BOXAA * boxaaReadFromFiles(const char *dirname, const char *substr, l_int32 first, l_int32 nfiles)
boxaaReadFromFiles()
l_int32 boxaIsFull(BOXA *boxa, l_int32 *pfull)
boxaIsFull()
void boxaaDestroy(BOXAA **pbaa)
boxaaDestroy()
static const l_int32 L_INSERT
l_int32 boxaaAddBox(BOXAA *baa, l_int32 index, BOX *box, l_int32 accessflag)
boxaaAddBox()
BOX * boxCreateValid(l_int32 x, l_int32 y, l_int32 w, l_int32 h)
boxCreateValid()
l_int32 boxaaExtendWithInit(BOXAA *baa, l_int32 maxindex, BOXA *boxa)
boxaaExtendWithInit()
l_int32 boxaInsertBox(BOXA *boxa, l_int32 index, BOX *box)
boxaInsertBox()
BOXA * boxaReadMem(const l_uint8 *data, size_t size)
boxaReadMem()
l_int32 boxaaInitFull(BOXAA *baa, BOXA *boxa)
boxaaInitFull()
BOXA * boxaSaveValid(BOXA *boxas, l_int32 copyflag)
boxaSaveValid()
l_int32 boxaaExtendArrayToSize(BOXAA *baa, l_int32 size)
boxaaExtendArrayToSize()
l_int32 boxSetSideLocations(BOX *box, l_int32 l, l_int32 r, l_int32 t, l_int32 b)
boxSetSideLocations()
l_int32 boxaInitFull(BOXA *boxa, BOX *box)
boxaInitFull()
l_int32 boxGetSideLocations(BOX *box, l_int32 *pl, l_int32 *pr, l_int32 *pt, l_int32 *pb)
boxGetSideLocations()
l_int32 boxGetGeometry(BOX *box, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxGetGeometry()
FILE * fopenWriteWinTempfile()
fopenWriteWinTempfile()
char * sarrayGetString(SARRAY *sa, l_int32 index, l_int32 copyflag)
sarrayGetString()
NUMA * boxaFindInvalidBoxes(BOXA *boxa)
boxaFindInvalidBoxes()
BOX * boxaGetBox(BOXA *boxa, l_int32 index, l_int32 accessflag)
boxaGetBox()
SARRAY * getSortedPathnamesInDirectory(const char *dirname, const char *substr, l_int32 first, l_int32 nfiles)
getSortedPathnamesInDirectory()
FILE * fopenWriteStream(const char *filename, const char *modestring)
fopenWriteStream()
l_int32 boxaaExtendArray(BOXAA *baa)
boxaaExtendArray()
BOXAA * boxaaCreate(l_int32 n)
boxaaCreate()
l_int32 boxaaReplaceBoxa(BOXAA *baa, l_int32 index, BOXA *boxa)
boxaaReplaceBoxa()
FILE * fopenReadStream(const char *filename)
fopenReadStream()
l_int32 boxGetRefcount(BOX *box)
Return the current reference count of box.
l_uint8 * l_binaryReadStream(FILE *fp, size_t *pnbytes)
l_binaryReadStream()
l_int32 sarrayGetCount(SARRAY *sa)
sarrayGetCount()
l_int32 boxChangeRefcount(BOX *box, l_int32 delta)
Adjust the current references count of box by delta.
BOXAA * boxaaRead(const char *filename)
boxaaRead()
l_int32 boxaGetValidCount(BOXA *boxa)
boxaGetValidCount()
l_int32 boxaaAddBoxa(BOXAA *baa, BOXA *ba, l_int32 copyflag)
boxaaAddBoxa()
l_int32 boxaWriteMem(l_uint8 **pdata, size_t *psize, BOXA *boxa)
boxaWriteMem()
#define BOXA_VERSION_NUMBER
BOX * boxCopy(BOX *box)
boxCopy()
l_int32 numaSetValue(NUMA *na, l_int32 index, l_float32 val)
numaSetValue()
l_int32 boxaaInsertBoxa(BOXAA *baa, l_int32 index, BOXA *boxa)
boxaaInsertBoxa()
l_int32 boxaaGetBoxCount(BOXAA *baa)
boxaaGetBoxCount()
l_int32 boxaaWriteStream(FILE *fp, BOXAA *baa)
boxaaWriteStream()
BOX * boxaaGetBox(BOXAA *baa, l_int32 iboxa, l_int32 ibox, l_int32 accessflag)
boxaaGetBox()
BOXA * boxaCreate(l_int32 n)
boxaCreate()
void boxDestroy(BOX **pbox)
boxDestroy()
l_int32 boxaGetExtent(BOXA *boxa, l_int32 *pw, l_int32 *ph, BOX **pbox)
boxaGetExtent()
l_int32 boxaGetCount(BOXA *boxa)
boxaGetCount()
l_int32 boxaRemoveBoxAndSave(BOXA *boxa, l_int32 index, BOX **pbox)
boxaRemoveBoxAndSave()
BOXAA * boxaaCopy(BOXAA *baas, l_int32 copyflag)
boxaaCopy()
BOX * boxCreate(l_int32 x, l_int32 y, l_int32 w, l_int32 h)
boxCreate()
BOXA * boxaRead(const char *filename)
boxaRead()
l_int32 boxaReplaceBox(BOXA *boxa, l_int32 index, BOX *box)
boxaReplaceBox()
BOXA * boxaaGetBoxa(BOXAA *baa, l_int32 index, l_int32 accessflag)
boxaaGetBoxa()
void sarrayDestroy(SARRAY **psa)
sarrayDestroy()