133#include <config_auto.h>
137#include "allheaders.h"
141static const size_t MaxBoxaPtrArraySize = 10000000;
142static const size_t MaxBoxaaPtrArraySize = 1000000;
179 return (
BOX *)ERROR_PTR(
"w and h not both >= 0", __func__, NULL);
184 return (
BOX *)ERROR_PTR(
"x < 0 and box off +quad", __func__, NULL);
190 return (
BOX *)ERROR_PTR(
"y < 0 and box off +quad", __func__, NULL);
193 box = (
BOX *)LEPT_CALLOC(1,
sizeof(
BOX));
217 if (w <= 0 || h <= 0)
218 return (
BOX *)ERROR_PTR(
"w and h not both > 0", __func__, NULL);
235 return (
BOX *)ERROR_PTR(
"box not defined", __func__, NULL);
253 return (
BOX *)ERROR_PTR(
"box not defined", __func__, NULL);
278 L_WARNING(
"ptr address is null!\n", __func__);
281 if ((box = *pbox) == NULL)
312 return ERROR_INT(
"box not defined", __func__, 1);
313 if (px) *px = box->
x;
314 if (py) *py = box->
y;
315 if (pw) *pw = box->
w;
316 if (ph) *ph = box->
h;
336 return ERROR_INT(
"box not defined", __func__, 1);
337 if (x != -1) box->
x = x;
338 if (y != -1) box->
y = y;
339 if (w != -1) box->
w = w;
340 if (h != -1) box->
h = h;
371 return ERROR_INT(
"box not defined", __func__, 1);
375 if (pr) *pr = x + w - 1;
377 if (pb) *pb = y + h - 1;
399 return ERROR_INT(
"box not defined", __func__, 1);
400 x = (l != -1) ? l : box->
x;
401 w = (r != -1) ? r - x + 1 : box->
x + box->
w - x;
402 y = (t != -1) ? t : box->
y;
403 h = (b != -1) ? b - y + 1 : box->
y + box->
h - y;
421 return ERROR_INT(
"&valid not defined", __func__, 1);
424 return ERROR_INT(
"box not defined", __func__, 1);
426 if (box->
w > 0 && box->
h > 0)
446 if (n <= 0 || n > MaxBoxaPtrArraySize)
449 boxa = (
BOXA *)LEPT_CALLOC(1,
sizeof(
BOXA));
453 if ((boxa->
box = (
BOX **)LEPT_CALLOC(n,
sizeof(
BOX *))) == NULL) {
455 return (
BOXA *)ERROR_PTR(
"boxa ptrs not made", __func__, NULL);
483 return (
BOXA *)ERROR_PTR(
"boxa not defined", __func__, NULL);
491 return (
BOXA *)ERROR_PTR(
"invalid copyflag", __func__, NULL);
494 return (
BOXA *)ERROR_PTR(
"boxac not made", __func__, NULL);
495 for (i = 0; i < boxa->
n; i++) {
525 L_WARNING(
"ptr address is null!\n", __func__);
529 if ((boxa = *pboxa) == NULL)
534 for (i = 0; i < boxa->
n; i++)
536 LEPT_FREE(boxa->
box);
561 return ERROR_INT(
"boxa not defined", __func__, 1);
563 return ERROR_INT(
"box not defined", __func__, 1);
567 else if (copyflag ==
L_COPY)
572 return ERROR_INT(
"invalid copyflag", __func__, 1);
574 return ERROR_INT(
"boxc not made", __func__, 1);
581 return ERROR_INT(
"extension failed", __func__, 1);
605 return ERROR_INT(
"boxa not defined", __func__, 1);
628size_t oldsize, newsize;
631 return ERROR_INT(
"boxa not defined", __func__, 1);
632 if (boxa->
nalloc > MaxBoxaPtrArraySize)
633 return ERROR_INT(
"boxa has too many ptrs", __func__, 1);
634 if (size > MaxBoxaPtrArraySize)
635 return ERROR_INT(
"size > 10M box ptrs; too large", __func__, 1);
636 if (size <= boxa->nalloc) {
637 L_INFO(
"size too small; no extension\n", __func__);
642 newsize = size *
sizeof(
BOX *);
643 if ((boxa->
box = (
BOX **)reallocNew((
void **)&boxa->
box,
644 oldsize, newsize)) == NULL)
645 return ERROR_INT(
"new ptr array not returned", __func__, 1);
664 return ERROR_INT(
"boxa not defined", __func__, 0);
678l_int32 n, i, w, h, count;
681 return ERROR_INT(
"boxa not defined", __func__, 0);
684 for (i = 0, count = 0; i < n; i++) {
707 return (
BOX *)ERROR_PTR(
"boxa not defined", __func__, NULL);
708 if (index < 0 || index >= boxa->
n)
709 return (
BOX *)ERROR_PTR(
"index not valid", __func__, NULL);
713 else if (accessflag ==
L_CLONE)
716 return (
BOX *)ERROR_PTR(
"invalid accessflag", __func__, NULL);
747 return (
BOX *)ERROR_PTR(
"boxa not defined", __func__, NULL);
749 if ((box =
boxaGetBox(boxa, index, accessflag)) == NULL)
750 return (
BOX *)ERROR_PTR(
"box not returned", __func__, NULL);
752 if (w <= 0 || h <= 0)
771 return (
NUMA *)ERROR_PTR(
"boxa not defined", __func__, NULL);
777 na = numaMakeConstant(0, n);
778 for (i = 0; i < n; i++) {
780 if (w == 0 || h == 0)
781 numaSetValue(na, i, 1);
810 return ERROR_INT(
"boxa not defined", __func__, 1);
811 if (index < 0 || index >= boxa->
n)
812 return ERROR_INT(
"index not valid", __func__, 1);
815 return ERROR_INT(
"box not found!", __func__, 1);
837 return ERROR_INT(
"&full not defined", __func__, 1);
840 return ERROR_INT(
"boxa not defined", __func__, 1);
844 for (i = 0; i < n; i++) {
880 return ERROR_INT(
"boxa not defined", __func__, 1);
881 if (index < 0 || index >= boxa->
n)
882 return ERROR_INT(
"index not valid", __func__, 1);
884 return ERROR_INT(
"box not defined", __func__, 1);
887 boxa->
box[index] = box;
919 return ERROR_INT(
"boxa not defined", __func__, 1);
921 if (index < 0 || index > n) {
922 L_ERROR(
"index %d not in [0,...,%d]\n", __func__, index, n);
926 return ERROR_INT(
"box not defined", __func__, 1);
930 return ERROR_INT(
"extension failed", __func__, 1);
934 for (i = n; i > index; i--)
935 array[i] = array[i - 1];
988 if (pbox) *pbox = NULL;
990 return ERROR_INT(
"boxa not defined", __func__, 1);
992 if (index < 0 || index >= n) {
993 L_ERROR(
"index %d not in [0,...,%d]\n", __func__, index, n - 1);
1001 for (i = index + 1; i < n; i++)
1002 array[i - 1] = array[i];
1003 array[n - 1] = NULL;
1031 return (
BOXA *)ERROR_PTR(
"boxas not defined", __func__, NULL);
1033 return (
BOXA *)ERROR_PTR(
"invalid copyflag", __func__, NULL);
1037 for (i = 0; i < n; i++) {
1092 return ERROR_INT(
"boxa not defined", __func__, 1);
1096 for (i = 0; i < n; i++) {
1125 return ERROR_INT(
"boxa not defined", __func__, 1);
1128 for (i = 0; i < n; i++)
1149 if (n <= 0 || n > MaxBoxaaPtrArraySize)
1152 baa = (
BOXAA *)LEPT_CALLOC(1,
sizeof(
BOXAA));
1153 if ((baa->
boxa = (
BOXA **)LEPT_CALLOC(n,
sizeof(
BOXA *))) == NULL) {
1155 return (
BOXAA *)ERROR_PTR(
"boxa ptr array not made", __func__, NULL);
1186 return (
BOXAA *)ERROR_PTR(
"baas not defined", __func__, NULL);
1188 return (
BOXAA *)ERROR_PTR(
"invalid copyflag", __func__, NULL);
1192 for (i = 0; i < n; i++) {
1213 L_WARNING(
"ptr address is NULL!\n", __func__);
1217 if ((baa = *pbaa) == NULL)
1220 for (i = 0; i < baa->
n; i++)
1222 LEPT_FREE(baa->
boxa);
1249 return ERROR_INT(
"baa not defined", __func__, 1);
1251 return ERROR_INT(
"ba not defined", __func__, 1);
1253 return ERROR_INT(
"invalid copyflag", __func__, 1);
1263 return ERROR_INT(
"extension failed", __func__, 1);
1287 return ERROR_INT(
"baa not defined", __func__, 1);
1310size_t oldsize, newsize;
1313 return ERROR_INT(
"baa not defined", __func__, 1);
1314 if (baa->
nalloc > MaxBoxaaPtrArraySize)
1315 return ERROR_INT(
"baa has too many ptrs", __func__, 1);
1316 if (size > MaxBoxaaPtrArraySize)
1317 return ERROR_INT(
"size > 1M boxa ptrs; too large", __func__, 1);
1318 if (size <= baa->nalloc) {
1319 L_INFO(
"size too small; no extension\n", __func__);
1324 newsize = size *
sizeof(
BOXA *);
1325 if ((baa->
boxa = (
BOXA **)reallocNew((
void **)&baa->
boxa,
1326 oldsize, newsize)) == NULL)
1327 return ERROR_INT(
"new ptr array not returned", __func__, 1);
1346 return ERROR_INT(
"baa not defined", __func__, 0);
1364 return ERROR_INT(
"baa not defined", __func__, 0);
1367 for (sum = 0, i = 0; i < n; i++) {
1393 return (
BOXA *)ERROR_PTR(
"baa not defined", __func__, NULL);
1395 if (index < 0 || index >= n)
1396 return (
BOXA *)ERROR_PTR(
"index not valid", __func__, NULL);
1398 return (
BOXA *)ERROR_PTR(
"invalid accessflag", __func__, NULL);
1423 return (
BOX *)ERROR_PTR(
"boxa not retrieved", __func__, NULL);
1424 if ((box =
boxaGetBox(boxa, ibox, accessflag)) == NULL)
1425 L_ERROR(
"box not retrieved\n", __func__);
1471 return ERROR_INT(
"baa not defined", __func__, 1);
1473 return ERROR_INT(
"boxa not defined", __func__, 1);
1477 for (i = 0; i < n; i++) {
1509 return ERROR_INT(
"baa not defined", __func__, 1);
1511 return ERROR_INT(
"boxa not defined", __func__, 1);
1515 if (maxindex < n)
return 0;
1517 return ERROR_INT(
"extension failed", __func__, 1);
1520 for (i = n; i <= maxindex; i++)
1549 return ERROR_INT(
"baa not defined", __func__, 1);
1551 return ERROR_INT(
"boxa not defined", __func__, 1);
1553 if (index < 0 || index >= n)
1554 return ERROR_INT(
"index not valid", __func__, 1);
1557 baa->
boxa[index] = boxa;
1590 return ERROR_INT(
"baa not defined", __func__, 1);
1592 if (index < 0 || index > n) {
1593 L_ERROR(
"index %d not in [0,...,%d]\n", __func__, index, n);
1597 return ERROR_INT(
"boxa not defined", __func__, 1);
1601 return ERROR_INT(
"extension failed", __func__, 1);
1605 for (i = n; i > index; i--)
1606 array[i] = array[i - 1];
1607 array[index] = boxa;
1636 return ERROR_INT(
"baa not defined", __func__, 1);
1638 if (index < 0 || index >= n)
1639 return ERROR_INT(
"index not valid", __func__, 1);
1643 for (i = index + 1; i < n; i++)
1644 array[i - 1] = array[i];
1645 array[n - 1] = NULL;
1675 return ERROR_INT(
"baa not defined", __func__, 1);
1677 if (index < 0 || index >= n)
1678 return ERROR_INT(
"index not valid", __func__, 1);
1680 return ERROR_INT(
"invalid accessflag", __func__, 1);
1725 return (
BOXAA *)ERROR_PTR(
"dirname not defined", __func__, NULL);
1727 sa = getSortedPathnamesInDirectory(dirname, substr, first, nfiles);
1728 if (!sa || ((n = sarrayGetCount(sa)) == 0)) {
1730 return (
BOXAA *)ERROR_PTR(
"no pixa files found", __func__, NULL);
1734 for (i = 0; i < n; i++) {
1735 fname = sarrayGetString(sa, i,
L_NOCOPY);
1736 if ((boxa =
boxaRead(fname)) == NULL) {
1737 L_ERROR(
"boxa not read for %d-th file", __func__, i);
1761 return (
BOXAA *)ERROR_PTR(
"filename not defined", __func__, NULL);
1763 if ((fp = fopenReadStream(filename)) == NULL)
1764 return (
BOXAA *)ERROR_PTR_1(
"stream not opened",
1765 filename, __func__, NULL);
1769 return (
BOXAA *)ERROR_PTR_1(
"boxaa not read",
1770 filename, __func__, NULL);
1789l_int32 n, i, x, y, w, h, version;
1795 return (
BOXAA *)ERROR_PTR(
"stream not defined", __func__, NULL);
1797 if (fscanf(fp,
"\nBoxaa Version %d\n", &version) != 1)
1798 return (
BOXAA *)ERROR_PTR(
"not a boxaa file", __func__, NULL);
1800 return (
BOXAA *)ERROR_PTR(
"invalid boxa version", __func__, NULL);
1801 if (fscanf(fp,
"Number of boxa = %d\n", &n) != 1)
1802 return (
BOXAA *)ERROR_PTR(
"not a boxaa file", __func__, NULL);
1804 return (
BOXAA *)ERROR_PTR(
"num boxa ptrs < 0", __func__, NULL);
1805 if (n > MaxBoxaaPtrArraySize)
1806 return (
BOXAA *)ERROR_PTR(
"too many boxa ptrs", __func__, NULL);
1807 if (n == 0) L_INFO(
"the boxaa is empty\n", __func__);
1810 return (
BOXAA *)ERROR_PTR(
"boxaa not made", __func__, NULL);
1811 for (i = 0; i < n; i++) {
1812 if (fscanf(fp,
"\nBoxa[%d] extent: x = %d, y = %d, w = %d, h = %d",
1813 &ignore, &x, &y, &w, &h) != 5) {
1815 return (
BOXAA *)ERROR_PTR(
"boxa descr not valid", __func__, NULL);
1819 return (
BOXAA *)ERROR_PTR(
"boxa not made", __func__, NULL);
1842 return (
BOXAA *)ERROR_PTR(
"data not defined", __func__, NULL);
1843 if ((fp = fopenReadFromMemory(data, size)) == NULL)
1844 return (
BOXAA *)ERROR_PTR(
"stream not opened", __func__, NULL);
1848 if (!baa) L_ERROR(
"baa not read\n", __func__);
1868 return ERROR_INT(
"filename not defined", __func__, 1);
1870 return ERROR_INT(
"baa not defined", __func__, 1);
1872 if ((fp = fopenWriteStream(filename,
"w")) == NULL)
1873 return ERROR_INT_1(
"stream not opened", filename, __func__, 1);
1877 return ERROR_INT_1(
"baa not written to stream", filename, __func__, 1);
1893l_int32 n, i, x, y, w, h;
1898 return ERROR_INT(
"stream not defined", __func__, 1);
1900 return ERROR_INT(
"baa not defined", __func__, 1);
1904 fprintf(fp,
"Number of boxa = %d\n", n);
1906 for (i = 0; i < n; i++) {
1908 return ERROR_INT(
"boxa not found", __func__, 1);
1909 boxaGetExtent(boxa, NULL, NULL, &box);
1911 fprintf(fp,
"\nBoxa[%d] extent: x = %d, y = %d, w = %d, h = %d",
1942 if (pdata) *pdata = NULL;
1943 if (psize) *psize = 0;
1945 return ERROR_INT(
"&data not defined", __func__, 1);
1947 return ERROR_INT(
"&size not defined", __func__, 1);
1949 return ERROR_INT(
"baa not defined", __func__, 1);
1952 if ((fp = open_memstream((
char **)pdata, psize)) == NULL)
1953 return ERROR_INT(
"stream not opened", __func__, 1);
1957 if (*psize > 0) *psize = *psize - 1;
1959 L_INFO(
"no fmemopen API --> work-around: write to temp file\n", __func__);
1961 if ((fp = fopenWriteWinTempfile()) == NULL)
1962 return ERROR_INT(
"tmpfile stream not opened", __func__, 1);
1964 if ((fp = tmpfile()) == NULL)
1965 return ERROR_INT(
"tmpfile stream not opened", __func__, 1);
1969 *pdata = l_binaryReadStream(fp, psize);
1992 return (
BOXA *)ERROR_PTR(
"filename not defined", __func__, NULL);
1994 if ((fp = fopenReadStream(filename)) == NULL)
1995 return (
BOXA *)ERROR_PTR_1(
"stream not opened",
1996 filename, __func__, NULL);
2000 return (
BOXA *)ERROR_PTR_1(
"boxa not read",
2001 filename, __func__, NULL);
2020l_int32 n, i, x, y, w, h, version;
2026 return (
BOXA *)ERROR_PTR(
"stream not defined", __func__, NULL);
2028 if (fscanf(fp,
"\nBoxa Version %d\n", &version) != 1)
2029 return (
BOXA *)ERROR_PTR(
"not a boxa file", __func__, NULL);
2031 return (
BOXA *)ERROR_PTR(
"invalid boxa version", __func__, NULL);
2032 if (fscanf(fp,
"Number of boxes = %d\n", &n) != 1)
2033 return (
BOXA *)ERROR_PTR(
"not a boxa file", __func__, NULL);
2035 return (
BOXA *)ERROR_PTR(
"num box ptrs < 0", __func__, NULL);
2036 if (n > MaxBoxaPtrArraySize)
2037 return (
BOXA *)ERROR_PTR(
"too many box ptrs", __func__, NULL);
2038 if (n == 0) L_INFO(
"the boxa is empty\n", __func__);
2041 return (
BOXA *)ERROR_PTR(
"boxa not made", __func__, NULL);
2042 for (i = 0; i < n; i++) {
2043 if (fscanf(fp,
" Box[%d]: x = %d, y = %d, w = %d, h = %d\n",
2044 &ignore, &x, &y, &w, &h) != 5) {
2046 return (
BOXA *)ERROR_PTR(
"box descr not valid", __func__, NULL);
2070 return (
BOXA *)ERROR_PTR(
"data not defined", __func__, NULL);
2071 if ((fp = fopenReadFromMemory(data, size)) == NULL)
2072 return (
BOXA *)ERROR_PTR(
"stream not opened", __func__, NULL);
2076 if (!boxa) L_ERROR(
"boxa not read\n", __func__);
2104 L_INFO(
"write to named temp file %s is disabled\n", __func__, filename);
2125 return ERROR_INT(
"filename not defined", __func__, 1);
2127 return ERROR_INT(
"boxa not defined", __func__, 1);
2129 if ((fp = fopenWriteStream(filename,
"w")) == NULL)
2130 return ERROR_INT_1(
"stream not opened", filename, __func__, 1);
2134 return ERROR_INT_1(
"boxa not written to stream", filename, __func__, 1);
2155 return ERROR_INT(
"boxa not defined", __func__, 1);
2161 fprintf(fp,
"Number of boxes = %d\n", n);
2162 for (i = 0; i < n; i++) {
2164 return ERROR_INT(
"box not found", __func__, 1);
2165 fprintf(fp,
" Box[%d]: x = %d, y = %d, w = %d, h = %d\n",
2166 i, box->
x, box->
y, box->
w, box->
h);
2186 return ERROR_INT(
"boxa not defined", __func__, 1);
2190 lept_stderr(
"Number of boxes = %d\n", n);
2191 for (i = 0; i < n; i++) {
2193 return ERROR_INT(
"box not found", __func__, 1);
2194 lept_stderr(
" Box[%d]: x = %d, y = %d, w = %d, h = %d\n",
2195 i, box->
x, box->
y, box->
w, box->
h);
2223 if (pdata) *pdata = NULL;
2224 if (psize) *psize = 0;
2226 return ERROR_INT(
"&data not defined", __func__, 1);
2228 return ERROR_INT(
"&size not defined", __func__, 1);
2230 return ERROR_INT(
"boxa not defined", __func__, 1);
2233 if ((fp = open_memstream((
char **)pdata, psize)) == NULL)
2234 return ERROR_INT(
"stream not opened", __func__, 1);
2238 if (*psize > 0) *psize = *psize - 1;
2240 L_INFO(
"no fmemopen API --> work-around: write to temp file\n", __func__);
2242 if ((fp = fopenWriteWinTempfile()) == NULL)
2243 return ERROR_INT(
"tmpfile stream not opened", __func__, 1);
2245 if ((fp = tmpfile()) == NULL)
2246 return ERROR_INT(
"tmpfile stream not opened", __func__, 1);
2250 *pdata = l_binaryReadStream(fp, psize);
2278 return ERROR_INT(
"box not defined", __func__, 1);
2281 lept_stderr(
" Box: x = %d, y = %d, w = %d, h = %d\n",
2282 box->
x, box->
y, box->
w, box->
h);
2284 fprintf(fp,
" Box: x = %d, y = %d, w = %d, h = %d\n",
2285 box->
x, box->
y, box->
w, box->
h);
BOXA * boxaReadStream(FILE *fp)
boxaReadStream()
l_ok boxaWriteMem(l_uint8 **pdata, size_t *psize, BOXA *boxa)
boxaWriteMem()
l_ok boxaaInitFull(BOXAA *baa, BOXA *boxa)
boxaaInitFull()
BOX * boxaGetValidBox(BOXA *boxa, l_int32 index, l_int32 accessflag)
boxaGetValidBox()
l_int32 boxaGetValidCount(BOXA *boxa)
boxaGetValidCount()
BOX * boxCopy(BOX *box)
boxCopy()
l_ok boxGetGeometry(const BOX *box, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxGetGeometry()
l_ok boxaaReplaceBoxa(BOXAA *baa, l_int32 index, BOXA *boxa)
boxaaReplaceBoxa()
BOXAA * boxaaRead(const char *filename)
boxaaRead()
l_ok boxaClear(BOXA *boxa)
boxaClear()
l_ok boxaaWrite(const char *filename, BOXAA *baa)
boxaaWrite()
BOXAA * boxaaReadMem(const l_uint8 *data, size_t size)
boxaaReadMem()
BOXA * boxaaGetBoxa(BOXAA *baa, l_int32 index, l_int32 accessflag)
boxaaGetBoxa()
BOXA * boxaRead(const char *filename)
boxaRead()
BOX * boxaGetBox(BOXA *boxa, l_int32 index, l_int32 accessflag)
boxaGetBox()
l_ok boxaaExtendArray(BOXAA *baa)
boxaaExtendArray()
BOXA * boxaCopy(BOXA *boxa, l_int32 copyflag)
boxaCopy()
l_ok boxaInitFull(BOXA *boxa, BOX *box)
boxaInitFull()
l_ok boxaIsFull(BOXA *boxa, l_int32 *pfull)
boxaIsFull()
l_ok boxaInsertBox(BOXA *boxa, l_int32 index, BOX *box)
boxaInsertBox()
BOXA * boxaSaveValid(BOXA *boxas, l_int32 copyflag)
boxaSaveValid()
void boxDestroy(BOX **pbox)
boxDestroy()
BOX * boxClone(BOX *box)
boxClone()
BOX * boxCreate(l_int32 x, l_int32 y, l_int32 w, l_int32 h)
boxCreate()
l_ok boxaaRemoveBoxa(BOXAA *baa, l_int32 index)
boxaaRemoveBoxa()
BOXA * boxaReadMem(const l_uint8 *data, size_t size)
boxaReadMem()
l_ok boxaRemoveBoxAndSave(BOXA *boxa, l_int32 index, BOX **pbox)
boxaRemoveBoxAndSave()
BOX * boxCreateValid(l_int32 x, l_int32 y, l_int32 w, l_int32 h)
boxCreateValid()
l_ok boxaRemoveBox(BOXA *boxa, l_int32 index)
boxaRemoveBox()
l_ok boxaReplaceBox(BOXA *boxa, l_int32 index, BOX *box)
boxaReplaceBox()
l_ok boxGetSideLocations(const BOX *box, l_int32 *pl, l_int32 *pr, l_int32 *pt, l_int32 *pb)
boxGetSideLocations()
l_int32 boxaaGetCount(BOXAA *baa)
boxaaGetCount()
BOXAA * boxaaCreate(l_int32 n)
boxaaCreate()
l_ok boxaGetBoxGeometry(BOXA *boxa, l_int32 index, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxaGetBoxGeometry()
l_ok boxaWriteDebug(const char *filename, BOXA *boxa)
boxaWriteDebug()
BOX * boxaaGetBox(BOXAA *baa, l_int32 iboxa, l_int32 ibox, l_int32 accessflag)
boxaaGetBox()
l_ok boxaaExtendWithInit(BOXAA *baa, l_int32 maxindex, BOXA *boxa)
boxaaExtendWithInit()
static const size_t InitialPtrArraySize
l_ok boxaWriteStderr(BOXA *boxa)
boxaWriteStderr()
l_ok boxaaAddBoxa(BOXAA *baa, BOXA *ba, l_int32 copyflag)
boxaaAddBoxa()
l_ok boxaaWriteStream(FILE *fp, BOXAA *baa)
boxaaWriteStream()
BOXAA * boxaaCopy(BOXAA *baas, l_int32 copyflag)
boxaaCopy()
l_ok boxaExtendArrayToSize(BOXA *boxa, size_t size)
boxaExtendArrayToSize()
l_ok boxaWrite(const char *filename, BOXA *boxa)
boxaWrite()
BOXA * boxaCreate(l_int32 n)
boxaCreate()
BOXAA * boxaaReadStream(FILE *fp)
boxaaReadStream()
l_ok boxaAddBox(BOXA *boxa, BOX *box, l_int32 copyflag)
boxaAddBox()
l_ok boxaExtendArray(BOXA *boxa)
boxaExtendArray()
void boxaDestroy(BOXA **pboxa)
boxaDestroy()
l_int32 boxaGetCount(const BOXA *boxa)
boxaGetCount()
l_ok boxIsValid(BOX *box, l_int32 *pvalid)
boxIsValid()
l_ok boxSetGeometry(BOX *box, l_int32 x, l_int32 y, l_int32 w, l_int32 h)
boxSetGeometry()
void boxaaDestroy(BOXAA **pbaa)
boxaaDestroy()
l_int32 boxaaGetBoxCount(BOXAA *baa)
boxaaGetBoxCount()
l_ok boxaaExtendArrayToSize(BOXAA *baa, l_int32 size)
boxaaExtendArrayToSize()
l_ok boxaaInsertBoxa(BOXAA *baa, l_int32 index, BOXA *boxa)
boxaaInsertBoxa()
l_ok boxSetSideLocations(BOX *box, l_int32 l, l_int32 r, l_int32 t, l_int32 b)
boxSetSideLocations()
l_ok boxaWriteStream(FILE *fp, BOXA *boxa)
boxaWriteStream()
l_ok boxPrintStreamInfo(FILE *fp, BOX *box)
boxPrintStreamInfo()
BOXAA * boxaaReadFromFiles(const char *dirname, const char *substr, l_int32 first, l_int32 nfiles)
boxaaReadFromFiles()
l_ok boxaaAddBox(BOXAA *baa, l_int32 index, BOX *box, l_int32 accessflag)
boxaaAddBox()
l_ok boxaaWriteMem(l_uint8 **pdata, size_t *psize, BOXAA *baa)
boxaaWriteMem()
NUMA * boxaFindInvalidBoxes(BOXA *boxa)
boxaFindInvalidBoxes()
#define BOXAA_VERSION_NUMBER
#define BOXA_VERSION_NUMBER