133 #include <config_auto.h>
137 #include "allheaders.h"
141 static const size_t MaxBoxaPtrArraySize = 10000000;
142 static 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);
628 size_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 *);
644 oldsize, newsize)) == NULL)
645 return ERROR_INT(
"new ptr array not returned", __func__, 1);
664 return ERROR_INT(
"boxa not defined", __func__, 0);
678 l_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);
778 for (i = 0; i < n; i++) {
780 if (w == 0 || h == 0)
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);
1310 size_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 *);
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);
1730 return (
BOXAA *)ERROR_PTR(
"no pixa files found", __func__, NULL);
1734 for (i = 0; i < n; i++) {
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);
1764 return (
BOXAA *)ERROR_PTR(
"stream not opened", __func__, NULL);
1768 return (
BOXAA *)ERROR_PTR(
"boxaa not read", __func__, NULL);
1787 l_int32 n, i, x, y, w, h, version;
1793 return (
BOXAA *)ERROR_PTR(
"stream not defined", __func__, NULL);
1795 if (fscanf(fp,
"\nBoxaa Version %d\n", &version) != 1)
1796 return (
BOXAA *)ERROR_PTR(
"not a boxaa file", __func__, NULL);
1798 return (
BOXAA *)ERROR_PTR(
"invalid boxa version", __func__, NULL);
1799 if (fscanf(fp,
"Number of boxa = %d\n", &n) != 1)
1800 return (
BOXAA *)ERROR_PTR(
"not a boxaa file", __func__, NULL);
1802 return (
BOXAA *)ERROR_PTR(
"num boxa ptrs < 0", __func__, NULL);
1803 if (n > MaxBoxaaPtrArraySize)
1804 return (
BOXAA *)ERROR_PTR(
"too many boxa ptrs", __func__, NULL);
1805 if (n == 0) L_INFO(
"the boxaa is empty\n", __func__);
1808 return (
BOXAA *)ERROR_PTR(
"boxaa not made", __func__, NULL);
1809 for (i = 0; i < n; i++) {
1810 if (fscanf(fp,
"\nBoxa[%d] extent: x = %d, y = %d, w = %d, h = %d",
1811 &ignore, &x, &y, &w, &h) != 5) {
1813 return (
BOXAA *)ERROR_PTR(
"boxa descr not valid", __func__, NULL);
1817 return (
BOXAA *)ERROR_PTR(
"boxa not made", __func__, NULL);
1840 return (
BOXAA *)ERROR_PTR(
"data not defined", __func__, NULL);
1842 return (
BOXAA *)ERROR_PTR(
"stream not opened", __func__, NULL);
1846 if (!baa) L_ERROR(
"baa not read\n", __func__);
1866 return ERROR_INT(
"filename not defined", __func__, 1);
1868 return ERROR_INT(
"baa not defined", __func__, 1);
1871 return ERROR_INT(
"stream not opened", __func__, 1);
1875 return ERROR_INT(
"baa not written to stream", __func__, 1);
1891 l_int32 n, i, x, y, w, h;
1896 return ERROR_INT(
"stream not defined", __func__, 1);
1898 return ERROR_INT(
"baa not defined", __func__, 1);
1902 fprintf(fp,
"Number of boxa = %d\n", n);
1904 for (i = 0; i < n; i++) {
1906 return ERROR_INT(
"boxa not found", __func__, 1);
1909 fprintf(fp,
"\nBoxa[%d] extent: x = %d, y = %d, w = %d, h = %d",
1940 if (pdata) *pdata = NULL;
1941 if (psize) *psize = 0;
1943 return ERROR_INT(
"&data not defined", __func__, 1);
1945 return ERROR_INT(
"&size not defined", __func__, 1);
1947 return ERROR_INT(
"baa not defined", __func__, 1);
1950 if ((fp = open_memstream((
char **)pdata, psize)) == NULL)
1951 return ERROR_INT(
"stream not opened", __func__, 1);
1955 *psize = *psize - 1;
1957 L_INFO(
"work-around: writing to a temp file\n", __func__);
1960 return ERROR_INT(
"tmpfile stream not opened", __func__, 1);
1962 if ((fp = tmpfile()) == NULL)
1963 return ERROR_INT(
"tmpfile stream not opened", __func__, 1);
1990 return (
BOXA *)ERROR_PTR(
"filename not defined", __func__, NULL);
1993 return (
BOXA *)ERROR_PTR(
"stream not opened", __func__, NULL);
1997 return (
BOXA *)ERROR_PTR(
"boxa not read", __func__, NULL);
2016 l_int32 n, i, x, y, w, h, version;
2022 return (
BOXA *)ERROR_PTR(
"stream not defined", __func__, NULL);
2024 if (fscanf(fp,
"\nBoxa Version %d\n", &version) != 1)
2025 return (
BOXA *)ERROR_PTR(
"not a boxa file", __func__, NULL);
2027 return (
BOXA *)ERROR_PTR(
"invalid boxa version", __func__, NULL);
2028 if (fscanf(fp,
"Number of boxes = %d\n", &n) != 1)
2029 return (
BOXA *)ERROR_PTR(
"not a boxa file", __func__, NULL);
2031 return (
BOXA *)ERROR_PTR(
"num box ptrs < 0", __func__, NULL);
2032 if (n > MaxBoxaPtrArraySize)
2033 return (
BOXA *)ERROR_PTR(
"too many box ptrs", __func__, NULL);
2034 if (n == 0) L_INFO(
"the boxa is empty\n", __func__);
2037 return (
BOXA *)ERROR_PTR(
"boxa not made", __func__, NULL);
2038 for (i = 0; i < n; i++) {
2039 if (fscanf(fp,
" Box[%d]: x = %d, y = %d, w = %d, h = %d\n",
2040 &ignore, &x, &y, &w, &h) != 5) {
2042 return (
BOXA *)ERROR_PTR(
"box descr not valid", __func__, NULL);
2066 return (
BOXA *)ERROR_PTR(
"data not defined", __func__, NULL);
2068 return (
BOXA *)ERROR_PTR(
"stream not opened", __func__, NULL);
2072 if (!boxa) L_ERROR(
"boxa not read\n", __func__);
2100 L_INFO(
"write to named temp file %s is disabled\n", __func__, filename);
2121 return ERROR_INT(
"filename not defined", __func__, 1);
2123 return ERROR_INT(
"boxa not defined", __func__, 1);
2126 return ERROR_INT(
"stream not opened", __func__, 1);
2130 return ERROR_INT(
"boxa not written to stream", __func__, 1);
2151 return ERROR_INT(
"boxa not defined", __func__, 1);
2157 fprintf(fp,
"Number of boxes = %d\n", n);
2158 for (i = 0; i < n; i++) {
2160 return ERROR_INT(
"box not found", __func__, 1);
2161 fprintf(fp,
" Box[%d]: x = %d, y = %d, w = %d, h = %d\n",
2162 i, box->
x, box->
y, box->
w, box->
h);
2182 return ERROR_INT(
"boxa not defined", __func__, 1);
2187 for (i = 0; i < n; i++) {
2189 return ERROR_INT(
"box not found", __func__, 1);
2190 lept_stderr(
" Box[%d]: x = %d, y = %d, w = %d, h = %d\n",
2191 i, box->
x, box->
y, box->
w, box->
h);
2219 if (pdata) *pdata = NULL;
2220 if (psize) *psize = 0;
2222 return ERROR_INT(
"&data not defined", __func__, 1);
2224 return ERROR_INT(
"&size not defined", __func__, 1);
2226 return ERROR_INT(
"boxa not defined", __func__, 1);
2229 if ((fp = open_memstream((
char **)pdata, psize)) == NULL)
2230 return ERROR_INT(
"stream not opened", __func__, 1);
2234 *psize = *psize - 1;
2236 L_INFO(
"work-around: writing to a temp file\n", __func__);
2239 return ERROR_INT(
"tmpfile stream not opened", __func__, 1);
2241 if ((fp = tmpfile()) == NULL)
2242 return ERROR_INT(
"tmpfile stream not opened", __func__, 1);
2274 return ERROR_INT(
"box not defined", __func__, 1);
2277 lept_stderr(
" Box: x = %d, y = %d, w = %d, h = %d\n",
2278 box->
x, box->
y, box->
w, box->
h);
2280 fprintf(fp,
" Box: x = %d, y = %d, w = %d, h = %d\n",
2281 box->
x, box->
y, box->
w, box->
h);
l_ok boxaWriteMem(l_uint8 **pdata, size_t *psize, BOXA *boxa)
boxaWriteMem()
l_ok boxaaInitFull(BOXAA *baa, BOXA *boxa)
boxaaInitFull()
l_int32 boxaGetValidCount(BOXA *boxa)
boxaGetValidCount()
BOXA * boxaSaveValid(BOXA *boxas, l_int32 copyflag)
boxaSaveValid()
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()
l_ok boxaClear(BOXA *boxa)
boxaClear()
l_ok boxaaWrite(const char *filename, BOXAA *baa)
boxaaWrite()
BOXAA * boxaaReadFromFiles(const char *dirname, const char *substr, l_int32 first, l_int32 nfiles)
boxaaReadFromFiles()
BOXA * boxaRead(const char *filename)
boxaRead()
l_ok boxaaExtendArray(BOXAA *baa)
boxaaExtendArray()
BOXA * boxaReadStream(FILE *fp)
boxaReadStream()
l_ok boxaInitFull(BOXA *boxa, BOX *box)
boxaInitFull()
l_ok boxaIsFull(BOXA *boxa, l_int32 *pfull)
boxaIsFull()
BOXA * boxaCopy(BOXA *boxa, l_int32 copyflag)
boxaCopy()
l_ok boxaInsertBox(BOXA *boxa, l_int32 index, BOX *box)
boxaInsertBox()
BOX * boxCreateValid(l_int32 x, l_int32 y, l_int32 w, l_int32 h)
boxCreateValid()
void boxDestroy(BOX **pbox)
boxDestroy()
l_ok boxaaRemoveBoxa(BOXAA *baa, l_int32 index)
boxaaRemoveBoxa()
l_ok boxaRemoveBoxAndSave(BOXA *boxa, l_int32 index, BOX **pbox)
boxaRemoveBoxAndSave()
l_ok boxaRemoveBox(BOXA *boxa, l_int32 index)
boxaRemoveBox()
BOXAA * boxaaReadMem(const l_uint8 *data, size_t size)
boxaaReadMem()
BOX * boxClone(BOX *box)
boxClone()
BOX * boxaaGetBox(BOXAA *baa, l_int32 iboxa, l_int32 ibox, l_int32 accessflag)
boxaaGetBox()
BOXAA * boxaaCreate(l_int32 n)
boxaaCreate()
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()
l_ok boxaGetBoxGeometry(BOXA *boxa, l_int32 index, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxaGetBoxGeometry()
BOXAA * boxaaCopy(BOXAA *baas, l_int32 copyflag)
boxaaCopy()
l_ok boxaWriteDebug(const char *filename, BOXA *boxa)
boxaWriteDebug()
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()
l_ok boxaExtendArrayToSize(BOXA *boxa, size_t size)
boxaExtendArrayToSize()
l_ok boxaWrite(const char *filename, BOXA *boxa)
boxaWrite()
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()
BOX * boxaGetValidBox(BOXA *boxa, l_int32 index, l_int32 accessflag)
boxaGetValidBox()
BOXA * boxaaGetBoxa(BOXAA *baa, l_int32 index, l_int32 accessflag)
boxaaGetBoxa()
BOX * boxaGetBox(BOXA *boxa, l_int32 index, l_int32 accessflag)
boxaGetBox()
BOXA * boxaReadMem(const l_uint8 *data, size_t size)
boxaReadMem()
BOX * boxCopy(BOX *box)
boxCopy()
void boxaaDestroy(BOXAA **pbaa)
boxaaDestroy()
NUMA * boxaFindInvalidBoxes(BOXA *boxa)
boxaFindInvalidBoxes()
l_int32 boxaaGetBoxCount(BOXAA *baa)
boxaaGetBoxCount()
l_ok boxaaExtendArrayToSize(BOXAA *baa, l_int32 size)
boxaaExtendArrayToSize()
BOX * boxCreate(l_int32 x, l_int32 y, l_int32 w, l_int32 h)
boxCreate()
l_ok boxaaInsertBoxa(BOXAA *baa, l_int32 index, BOXA *boxa)
boxaaInsertBoxa()
BOXAA * boxaaReadStream(FILE *fp)
boxaaReadStream()
l_ok boxSetSideLocations(BOX *box, l_int32 l, l_int32 r, l_int32 t, l_int32 b)
boxSetSideLocations()
BOXA * boxaCreate(l_int32 n)
boxaCreate()
l_ok boxaWriteStream(FILE *fp, BOXA *boxa)
boxaWriteStream()
l_ok boxPrintStreamInfo(FILE *fp, BOX *box)
boxPrintStreamInfo()
BOXAA * boxaaRead(const char *filename)
boxaaRead()
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()
l_ok boxaGetExtent(BOXA *boxa, l_int32 *pw, l_int32 *ph, BOX **pbox)
boxaGetExtent()
l_ok numaSetValue(NUMA *na, l_int32 index, l_float32 val)
numaSetValue()
NUMA * numaMakeConstant(l_float32 val, l_int32 size)
numaMakeConstant()
#define BOXAA_VERSION_NUMBER
#define BOXA_VERSION_NUMBER
char * sarrayGetString(SARRAY *sa, l_int32 index, l_int32 copyflag)
sarrayGetString()
l_int32 sarrayGetCount(SARRAY *sa)
sarrayGetCount()
void sarrayDestroy(SARRAY **psa)
sarrayDestroy()
SARRAY * getSortedPathnamesInDirectory(const char *dirname, const char *substr, l_int32 first, l_int32 nfiles)
getSortedPathnamesInDirectory()
void lept_stderr(const char *fmt,...)
lept_stderr()
l_uint8 * l_binaryReadStream(FILE *fp, size_t *pnbytes)
l_binaryReadStream()
FILE * fopenReadFromMemory(const l_uint8 *data, size_t size)
fopenReadFromMemory()
FILE * fopenWriteStream(const char *filename, const char *modestring)
fopenWriteStream()
void * reallocNew(void **pindata, size_t oldsize, size_t newsize)
reallocNew()
FILE * fopenWriteWinTempfile(void)
fopenWriteWinTempfile()
FILE * fopenReadStream(const char *filename)
fopenReadStream()