134 #include "allheaders.h" 172 PROCNAME(
"boxCreate");
175 return (
BOX *)ERROR_PTR(
"w and h not both >= 0", procName, NULL);
180 return (
BOX *)ERROR_PTR(
"x < 0 and box off +quad", procName, NULL);
186 return (
BOX *)ERROR_PTR(
"y < 0 and box off +quad", procName, NULL);
189 if ((box = (
BOX *)LEPT_CALLOC(1,
sizeof(
BOX))) == NULL)
190 return (
BOX *)ERROR_PTR(
"box not made", procName, NULL);
215 PROCNAME(
"boxCreateValid");
217 if (w <= 0 || h <= 0)
218 return (
BOX *)ERROR_PTR(
"w and h not both > 0", procName, NULL);
237 return (
BOX *)ERROR_PTR(
"box not defined", procName, NULL);
255 PROCNAME(
"boxClone");
258 return (
BOX *)ERROR_PTR(
"box not defined", procName, NULL);
282 PROCNAME(
"boxDestroy");
285 L_WARNING(
"ptr address is null!\n", procName);
288 if ((box = *pbox) == NULL)
316 PROCNAME(
"boxGetGeometry");
323 return ERROR_INT(
"box not defined", procName, 1);
324 if (px) *px = box->
x;
325 if (py) *py = box->
y;
326 if (pw) *pw = box->
w;
327 if (ph) *ph = box->
h;
346 PROCNAME(
"boxSetGeometry");
349 return ERROR_INT(
"box not defined", procName, 1);
350 if (x != -1) box->
x = x;
351 if (y != -1) box->
y = y;
352 if (w != -1) box->
w = w;
353 if (h != -1) box->
h = h;
379 PROCNAME(
"boxGetSideLocations");
386 return ERROR_INT(
"box not defined", procName, 1);
390 if (pr) *pr = x + w - 1;
392 if (pb) *pb = y + h - 1;
413 PROCNAME(
"boxSetSideLocations");
416 return ERROR_INT(
"box not defined", procName, 1);
417 x = (l != -1) ? l : box->
x;
418 w = (r != -1) ? r - x + 1 : box->
x + box->
w - x;
419 y = (t != -1) ? t : box->
y;
420 h = (b != -1) ? b - y + 1 : box->
y + box->
h - y;
435 PROCNAME(
"boxGetRefcount");
438 return ERROR_INT(
"box not defined", procName, UNDEF);
454 PROCNAME(
"boxChangeRefcount");
457 return ERROR_INT(
"box not defined", procName, 1);
475 PROCNAME(
"boxIsValid");
478 return ERROR_INT(
"&valid not defined", procName, 1);
481 return ERROR_INT(
"box not defined", procName, 1);
483 if (box->
w > 0 && box->
h > 0)
503 PROCNAME(
"boxaCreate");
508 boxa = (
BOXA *)LEPT_CALLOC(1,
sizeof(
BOXA));
512 if ((boxa->
box = (
BOX **)LEPT_CALLOC(n,
sizeof(
BOX *))) == NULL) {
514 return (
BOXA *)ERROR_PTR(
"boxa ptrs not made", procName, NULL);
541 PROCNAME(
"boxaCopy");
544 return (
BOXA *)ERROR_PTR(
"boxa not defined", procName, NULL);
552 return (
BOXA *)ERROR_PTR(
"invalid copyflag", procName, NULL);
555 return (
BOXA *)ERROR_PTR(
"boxac not made", procName, NULL);
556 for (i = 0; i < boxa->
n; i++) {
585 PROCNAME(
"boxaDestroy");
588 L_WARNING(
"ptr address is null!\n", procName);
592 if ((boxa = *pboxa) == NULL)
598 for (i = 0; i < boxa->
n; i++)
600 LEPT_FREE(boxa->
box);
625 PROCNAME(
"boxaAddBox");
628 return ERROR_INT(
"boxa not defined", procName, 1);
630 return ERROR_INT(
"box not defined", procName, 1);
634 else if (copyflag ==
L_COPY)
639 return ERROR_INT(
"invalid copyflag", procName, 1);
641 return ERROR_INT(
"boxc not made", procName, 1);
667 PROCNAME(
"boxaExtendArray");
670 return ERROR_INT(
"boxa not defined", procName, 1);
692 PROCNAME(
"boxaExtendArrayToSize");
695 return ERROR_INT(
"boxa not defined", procName, 1);
697 if (size > boxa->
nalloc) {
700 size *
sizeof(
BOX *))) == NULL)
701 return ERROR_INT(
"new ptr array not returned", procName, 1);
720 PROCNAME(
"boxaGetCount");
723 return ERROR_INT(
"boxa not defined", procName, 0);
737 l_int32 n, i, w, h, count;
739 PROCNAME(
"boxaGetValidCount");
742 return ERROR_INT(
"boxa not defined", procName, 0);
745 for (i = 0, count = 0; i < n; i++) {
767 PROCNAME(
"boxaGetBox");
770 return (
BOX *)ERROR_PTR(
"boxa not defined", procName, NULL);
771 if (index < 0 || index >= boxa->
n)
772 return (
BOX *)ERROR_PTR(
"index not valid", procName, NULL);
776 else if (accessflag ==
L_CLONE)
779 return (
BOX *)ERROR_PTR(
"invalid accessflag", procName, NULL);
809 PROCNAME(
"boxaGetValidBox");
812 return (
BOX *)ERROR_PTR(
"boxa not defined", procName, NULL);
814 if ((box =
boxaGetBox(boxa, index, accessflag)) == NULL)
815 return (
BOX *)ERROR_PTR(
"box not returned", procName, NULL);
817 if (w <= 0 || h <= 0)
835 PROCNAME(
"boxaFindInvalidBoxes");
838 return (
NUMA *)ERROR_PTR(
"boxa not defined", procName, NULL);
845 for (i = 0; i < n; i++) {
847 if (w == 0 || h == 0)
872 PROCNAME(
"boxaGetBoxGeometry");
879 return ERROR_INT(
"boxa not defined", procName, 1);
880 if (index < 0 || index >= boxa->
n)
881 return ERROR_INT(
"index not valid", procName, 1);
884 return ERROR_INT(
"box not found!", procName, 1);
905 PROCNAME(
"boxaIsFull");
908 return ERROR_INT(
"&full not defined", procName, 1);
911 return ERROR_INT(
"boxa not defined", procName, 1);
915 for (i = 0; i < n; i++) {
950 PROCNAME(
"boxaReplaceBox");
953 return ERROR_INT(
"boxa not defined", procName, 1);
954 if (index < 0 || index >= boxa->
n)
955 return ERROR_INT(
"index not valid", procName, 1);
957 return ERROR_INT(
"box not defined", procName, 1);
960 boxa->
box[index] = box;
991 PROCNAME(
"boxaInsertBox");
994 return ERROR_INT(
"boxa not defined", procName, 1);
996 if (index < 0 || index > n)
997 return ERROR_INT(
"index not in {0...n}", procName, 1);
999 return ERROR_INT(
"box not defined", procName, 1);
1005 for (i = n; i > index; i--)
1006 array[i] = array[i - 1];
1060 PROCNAME(
"boxaRemoveBoxAndSave");
1062 if (pbox) *pbox = NULL;
1064 return ERROR_INT(
"boxa not defined", procName, 1);
1066 if (index < 0 || index >= n)
1067 return ERROR_INT(
"index not in {0...n - 1}", procName, 1);
1073 for (i = index + 1; i < n; i++)
1074 array[i - 1] = array[i];
1075 array[n - 1] = NULL;
1102 PROCNAME(
"boxaSaveValid");
1105 return (
BOXA *)ERROR_PTR(
"boxas not defined", procName, NULL);
1107 return (
BOXA *)ERROR_PTR(
"invalid copyflag", procName, NULL);
1111 for (i = 0; i < n; i++) {
1165 PROCNAME(
"boxaInitFull");
1168 return ERROR_INT(
"boxa not defined", procName, 1);
1172 for (i = 0; i < n; i++) {
1200 PROCNAME(
"boxaClear");
1203 return ERROR_INT(
"boxa not defined", procName, 1);
1206 for (i = 0; i < n; i++)
1227 PROCNAME(
"boxaaCreate");
1232 baa = (
BOXAA *)LEPT_CALLOC(1,
sizeof(
BOXAA));
1233 if ((baa->
boxa = (
BOXA **)LEPT_CALLOC(n,
sizeof(
BOXA *))) == NULL) {
1235 return (
BOXAA *)ERROR_PTR(
"boxa ptr array not made", procName, NULL);
1265 PROCNAME(
"boxaaCopy");
1268 return (
BOXAA *)ERROR_PTR(
"baas not defined", procName, NULL);
1270 return (
BOXAA *)ERROR_PTR(
"invalid copyflag", procName, NULL);
1274 for (i = 0; i < n; i++) {
1294 PROCNAME(
"boxaaDestroy");
1297 L_WARNING(
"ptr address is NULL!\n", procName);
1301 if ((baa = *pbaa) == NULL)
1304 for (i = 0; i < baa->
n; i++)
1306 LEPT_FREE(baa->
boxa);
1334 PROCNAME(
"boxaaAddBoxa");
1337 return ERROR_INT(
"baa not defined", procName, 1);
1339 return ERROR_INT(
"ba not defined", procName, 1);
1341 return ERROR_INT(
"invalid copyflag", procName, 1);
1367 PROCNAME(
"boxaaExtendArray");
1370 return ERROR_INT(
"baa not defined", procName, 1);
1375 return ERROR_INT(
"new ptr array not returned", procName, 1);
1398 PROCNAME(
"boxaaExtendArrayToSize");
1401 return ERROR_INT(
"baa not defined", procName, 1);
1403 if (size > baa->
nalloc) {
1406 size *
sizeof(
BOXA *))) == NULL)
1407 return ERROR_INT(
"new ptr array not returned", procName, 1);
1426 PROCNAME(
"boxaaGetCount");
1429 return ERROR_INT(
"baa not defined", procName, 0);
1446 PROCNAME(
"boxaaGetBoxCount");
1449 return ERROR_INT(
"baa not defined", procName, 0);
1452 for (sum = 0, i = 0; i < n; i++) {
1477 PROCNAME(
"boxaaGetBoxa");
1480 return (
BOXA *)ERROR_PTR(
"baa not defined", procName, NULL);
1482 if (index < 0 || index >= n)
1483 return (
BOXA *)ERROR_PTR(
"index not valid", procName, NULL);
1485 return (
BOXA *)ERROR_PTR(
"invalid accessflag", procName, NULL);
1509 PROCNAME(
"boxaaGetBox");
1512 return (
BOX *)ERROR_PTR(
"boxa not retrieved", procName, NULL);
1513 if ((box =
boxaGetBox(boxa, ibox, accessflag)) == NULL)
1514 L_ERROR(
"box not retrieved\n", procName);
1559 PROCNAME(
"boxaaInitFull");
1562 return ERROR_INT(
"baa not defined", procName, 1);
1564 return ERROR_INT(
"boxa not defined", procName, 1);
1568 for (i = 0; i < n; i++) {
1599 PROCNAME(
"boxaaExtendWithInit");
1602 return ERROR_INT(
"baa not defined", procName, 1);
1604 return ERROR_INT(
"boxa not defined", procName, 1);
1608 if (maxindex < n)
return 0;
1612 for (i = n; i <= maxindex; i++)
1640 PROCNAME(
"boxaaReplaceBoxa");
1643 return ERROR_INT(
"baa not defined", procName, 1);
1645 return ERROR_INT(
"boxa not defined", procName, 1);
1647 if (index < 0 || index >= n)
1648 return ERROR_INT(
"index not valid", procName, 1);
1651 baa->
boxa[index] = boxa;
1682 PROCNAME(
"boxaaInsertBoxa");
1685 return ERROR_INT(
"baa not defined", procName, 1);
1687 if (index < 0 || index > n)
1688 return ERROR_INT(
"index not in {0...n}", procName, 1);
1690 return ERROR_INT(
"boxa not defined", procName, 1);
1696 for (i = n; i > index; i--)
1697 array[i] = array[i - 1];
1698 array[index] = boxa;
1727 PROCNAME(
"boxaaRemoveBox");
1730 return ERROR_INT(
"baa not defined", procName, 1);
1732 if (index < 0 || index >= n)
1733 return ERROR_INT(
"index not valid", procName, 1);
1737 for (i = index + 1; i < n; i++)
1738 array[i - 1] = array[i];
1739 array[n - 1] = NULL;
1768 PROCNAME(
"boxaaAddBox");
1771 return ERROR_INT(
"baa not defined", procName, 1);
1773 if (index < 0 || index >= n)
1774 return ERROR_INT(
"index not valid", procName, 1);
1776 return ERROR_INT(
"invalid accessflag", procName, 1);
1820 PROCNAME(
"boxaaReadFromFiles");
1823 return (
BOXAA *)ERROR_PTR(
"dirname not defined", procName, NULL);
1828 return (
BOXAA *)ERROR_PTR(
"no pixa files found", procName, NULL);
1832 for (i = 0; i < n; i++) {
1834 if ((boxa =
boxaRead(fname)) == NULL) {
1835 L_ERROR(
"boxa not read for %d-th file", procName, i);
1858 PROCNAME(
"boxaaRead");
1861 return (
BOXAA *)ERROR_PTR(
"filename not defined", procName, NULL);
1864 return (
BOXAA *)ERROR_PTR(
"stream not opened", procName, NULL);
1868 return (
BOXAA *)ERROR_PTR(
"boxaa not read", procName, NULL);
1882 l_int32 n, i, x, y, w, h, version;
1887 PROCNAME(
"boxaaReadStream");
1890 return (
BOXAA *)ERROR_PTR(
"stream not defined", procName, NULL);
1892 if (fscanf(fp,
"\nBoxaa Version %d\n", &version) != 1)
1893 return (
BOXAA *)ERROR_PTR(
"not a boxaa file", procName, NULL);
1895 return (
BOXAA *)ERROR_PTR(
"invalid boxa version", procName, NULL);
1896 if (fscanf(fp,
"Number of boxa = %d\n", &n) != 1)
1897 return (
BOXAA *)ERROR_PTR(
"not a boxaa file", procName, NULL);
1900 return (
BOXAA *)ERROR_PTR(
"boxaa not made", procName, NULL);
1901 for (i = 0; i < n; i++) {
1902 if (fscanf(fp,
"\nBoxa[%d] extent: x = %d, y = %d, w = %d, h = %d",
1903 &ignore, &x, &y, &w, &h) != 5) {
1905 return (
BOXAA *)ERROR_PTR(
"boxa descr not valid", procName, NULL);
1909 return (
BOXAA *)ERROR_PTR(
"boxa not made", procName, NULL);
1931 PROCNAME(
"boxaaReadMem");
1934 return (
BOXAA *)ERROR_PTR(
"data not defined", procName, NULL);
1936 return (
BOXAA *)ERROR_PTR(
"stream not opened", procName, NULL);
1940 if (!baa) L_ERROR(
"baa not read\n", procName);
1959 PROCNAME(
"boxaaWrite");
1962 return ERROR_INT(
"filename not defined", procName, 1);
1964 return ERROR_INT(
"baa not defined", procName, 1);
1967 return ERROR_INT(
"stream not opened", procName, 1);
1971 return ERROR_INT(
"baa not written to stream", procName, 1);
1987 l_int32 n, i, x, y, w, h;
1991 PROCNAME(
"boxaaWriteStream");
1994 return ERROR_INT(
"stream not defined", procName, 1);
1996 return ERROR_INT(
"baa not defined", procName, 1);
2000 fprintf(fp,
"Number of boxa = %d\n", n);
2002 for (i = 0; i < n; i++) {
2004 return ERROR_INT(
"boxa not found", procName, 1);
2007 fprintf(fp,
"\nBoxa[%d] extent: x = %d, y = %d, w = %d, h = %d",
2038 PROCNAME(
"boxaaWriteMem");
2040 if (pdata) *pdata = NULL;
2041 if (psize) *psize = 0;
2043 return ERROR_INT(
"&data not defined", procName, 1);
2045 return ERROR_INT(
"&size not defined", procName, 1);
2047 return ERROR_INT(
"baa not defined", procName, 1);
2050 if ((fp = open_memstream((
char **)pdata, psize)) == NULL)
2051 return ERROR_INT(
"stream not opened", procName, 1);
2054 L_INFO(
"work-around: writing to a temp file\n", procName);
2057 return ERROR_INT(
"tmpfile stream not opened", procName, 1);
2059 if ((fp = tmpfile()) == NULL)
2060 return ERROR_INT(
"tmpfile stream not opened", procName, 1);
2086 PROCNAME(
"boxaRead");
2089 return (
BOXA *)ERROR_PTR(
"filename not defined", procName, NULL);
2092 return (
BOXA *)ERROR_PTR(
"stream not opened", procName, NULL);
2096 return (
BOXA *)ERROR_PTR(
"boxa not read", procName, NULL);
2110 l_int32 n, i, x, y, w, h, version;
2115 PROCNAME(
"boxaReadStream");
2118 return (
BOXA *)ERROR_PTR(
"stream not defined", procName, NULL);
2120 if (fscanf(fp,
"\nBoxa Version %d\n", &version) != 1)
2121 return (
BOXA *)ERROR_PTR(
"not a boxa file", procName, NULL);
2123 return (
BOXA *)ERROR_PTR(
"invalid boxa version", procName, NULL);
2124 if (fscanf(fp,
"Number of boxes = %d\n", &n) != 1)
2125 return (
BOXA *)ERROR_PTR(
"not a boxa file", procName, NULL);
2128 return (
BOXA *)ERROR_PTR(
"boxa not made", procName, NULL);
2129 for (i = 0; i < n; i++) {
2130 if (fscanf(fp,
" Box[%d]: x = %d, y = %d, w = %d, h = %d\n",
2131 &ignore, &x, &y, &w, &h) != 5) {
2133 return (
BOXA *)ERROR_PTR(
"box descr not valid", procName, NULL);
2157 PROCNAME(
"boxaReadMem");
2160 return (
BOXA *)ERROR_PTR(
"data not defined", procName, NULL);
2162 return (
BOXA *)ERROR_PTR(
"stream not opened", procName, NULL);
2166 if (!boxa) L_ERROR(
"boxa not read\n", procName);
2191 PROCNAME(
"boxaWriteDebug");
2196 L_INFO(
"write to named temp file %s is disabled\n", procName, filename);
2216 PROCNAME(
"boxaWrite");
2219 return ERROR_INT(
"filename not defined", procName, 1);
2221 return ERROR_INT(
"boxa not defined", procName, 1);
2224 return ERROR_INT(
"stream not opened", procName, 1);
2228 return ERROR_INT(
"boxa not written to stream", procName, 1);
2248 PROCNAME(
"boxaWriteStream");
2251 return ERROR_INT(
"stream not defined", procName, 1);
2253 return ERROR_INT(
"boxa not defined", procName, 1);
2257 fprintf(fp,
"Number of boxes = %d\n", n);
2258 for (i = 0; i < n; i++) {
2260 return ERROR_INT(
"box not found", procName, 1);
2261 fprintf(fp,
" Box[%d]: x = %d, y = %d, w = %d, h = %d\n",
2262 i, box->
x, box->
y, box->
w, box->
h);
2290 PROCNAME(
"boxaWriteMem");
2292 if (pdata) *pdata = NULL;
2293 if (psize) *psize = 0;
2295 return ERROR_INT(
"&data not defined", procName, 1);
2297 return ERROR_INT(
"&size not defined", procName, 1);
2299 return ERROR_INT(
"boxa not defined", procName, 1);
2302 if ((fp = open_memstream((
char **)pdata, psize)) == NULL)
2303 return ERROR_INT(
"stream not opened", procName, 1);
2306 L_INFO(
"work-around: writing to a temp file\n", procName);
2309 return ERROR_INT(
"tmpfile stream not opened", procName, 1);
2311 if ((fp = tmpfile()) == NULL)
2312 return ERROR_INT(
"tmpfile stream not opened", procName, 1);
2343 PROCNAME(
"boxPrintStreamInfo");
2346 return ERROR_INT(
"stream not defined", procName, 1);
2348 return ERROR_INT(
"box not defined", procName, 1);
2350 fprintf(fp,
" Box: x = %d, y = %d, w = %d, h = %d\n",
2351 box->
x, box->
y, box->
w, box->
h);
l_ok boxaaWrite(const char *filename, BOXAA *baa)
boxaaWrite()
#define BOXAA_VERSION_NUMBER
BOXA * boxaReadStream(FILE *fp)
boxaReadStream()
BOXAA * boxaaReadStream(FILE *fp)
boxaaReadStream()
BOX * boxaGetValidBox(BOXA *boxa, l_int32 index, l_int32 accessflag)
boxaGetValidBox()
l_ok boxaExtendArrayToSize(BOXA *boxa, l_int32 size)
boxaExtendArrayToSize()
l_ok boxaaReplaceBoxa(BOXAA *baa, l_int32 index, BOXA *boxa)
boxaaReplaceBoxa()
static const l_int32 INITIAL_PTR_ARRAYSIZE
l_ok boxSetSideLocations(BOX *box, l_int32 l, l_int32 r, l_int32 t, l_int32 b)
boxSetSideLocations()
l_int32 boxaaGetCount(BOXAA *baa)
boxaaGetCount()
l_ok boxaExtendArray(BOXA *boxa)
boxaExtendArray()
BOXAA * boxaaReadMem(const l_uint8 *data, size_t size)
boxaaReadMem()
l_ok boxGetSideLocations(BOX *box, l_int32 *pl, l_int32 *pr, l_int32 *pt, l_int32 *pb)
boxGetSideLocations()
l_ok boxaWriteStream(FILE *fp, BOXA *boxa)
boxaWriteStream()
NUMA * numaMakeConstant(l_float32 val, l_int32 size)
numaMakeConstant()
l_ok boxaReplaceBox(BOXA *boxa, l_int32 index, BOX *box)
boxaReplaceBox()
l_ok boxaaExtendWithInit(BOXAA *baa, l_int32 maxindex, BOXA *boxa)
boxaaExtendWithInit()
FILE * fopenReadFromMemory(const l_uint8 *data, size_t size)
fopenReadFromMemory()
BOXA * boxaCopy(BOXA *boxa, l_int32 copyflag)
boxaCopy()
void boxaDestroy(BOXA **pboxa)
boxaDestroy()
void * reallocNew(void **pindata, l_int32 oldsize, l_int32 newsize)
reallocNew()
l_ok numaSetValue(NUMA *na, l_int32 index, l_float32 val)
numaSetValue()
BOX * boxClone(BOX *box)
boxClone()
l_ok boxaaWriteStream(FILE *fp, BOXAA *baa)
boxaaWriteStream()
l_ok boxaaAddBoxa(BOXAA *baa, BOXA *ba, l_int32 copyflag)
boxaaAddBoxa()
BOXAA * boxaaReadFromFiles(const char *dirname, const char *substr, l_int32 first, l_int32 nfiles)
boxaaReadFromFiles()
l_ok boxaaRemoveBoxa(BOXAA *baa, l_int32 index)
boxaaRemoveBoxa()
void boxaaDestroy(BOXAA **pbaa)
boxaaDestroy()
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()
BOXA * boxaReadMem(const l_uint8 *data, size_t size)
boxaReadMem()
l_ok boxaGetBoxGeometry(BOXA *boxa, l_int32 index, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxaGetBoxGeometry()
BOXA * boxaSaveValid(BOXA *boxas, l_int32 copyflag)
boxaSaveValid()
l_ok boxaAddBox(BOXA *boxa, BOX *box, l_int32 copyflag)
boxaAddBox()
l_ok boxaWriteDebug(const char *filename, BOXA *boxa)
boxaWriteDebug()
l_ok boxaaAddBox(BOXAA *baa, l_int32 index, BOX *box, l_int32 accessflag)
boxaaAddBox()
FILE * fopenWriteWinTempfile()
fopenWriteWinTempfile()
char * sarrayGetString(SARRAY *sa, l_int32 index, l_int32 copyflag)
sarrayGetString()
l_ok boxaWrite(const char *filename, BOXA *boxa)
boxaWrite()
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()
l_ok boxaWriteMem(l_uint8 **pdata, size_t *psize, BOXA *boxa)
boxaWriteMem()
l_ok boxaGetExtent(BOXA *boxa, l_int32 *pw, l_int32 *ph, BOX **pbox)
boxaGetExtent()
FILE * fopenWriteStream(const char *filename, const char *modestring)
fopenWriteStream()
BOXAA * boxaaCreate(l_int32 n)
boxaaCreate()
FILE * fopenReadStream(const char *filename)
fopenReadStream()
l_ok boxaInitFull(BOXA *boxa, BOX *box)
boxaInitFull()
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()
BOXAA * boxaaRead(const char *filename)
boxaaRead()
l_int32 boxaGetValidCount(BOXA *boxa)
boxaGetValidCount()
l_ok boxaIsFull(BOXA *boxa, l_int32 *pfull)
boxaIsFull()
l_ok boxaRemoveBox(BOXA *boxa, l_int32 index)
boxaRemoveBox()
l_ok boxaaInitFull(BOXAA *baa, BOXA *boxa)
boxaaInitFull()
#define BOXA_VERSION_NUMBER
BOX * boxCopy(BOX *box)
boxCopy()
l_int32 boxaaGetBoxCount(BOXAA *baa)
boxaaGetBoxCount()
BOX * boxaaGetBox(BOXAA *baa, l_int32 iboxa, l_int32 ibox, l_int32 accessflag)
boxaaGetBox()
BOXA * boxaCreate(l_int32 n)
boxaCreate()
l_ok boxaaWriteMem(l_uint8 **pdata, size_t *psize, BOXAA *baa)
boxaaWriteMem()
l_ok boxaaInsertBoxa(BOXAA *baa, l_int32 index, BOXA *boxa)
boxaaInsertBoxa()
void boxDestroy(BOX **pbox)
boxDestroy()
l_int32 boxaGetCount(BOXA *boxa)
boxaGetCount()
l_ok boxPrintStreamInfo(FILE *fp, BOX *box)
boxPrintStreamInfo()
l_ok boxaaExtendArray(BOXAA *baa)
boxaaExtendArray()
l_ok boxSetGeometry(BOX *box, l_int32 x, l_int32 y, l_int32 w, l_int32 h)
boxSetGeometry()
l_ok boxaClear(BOXA *boxa)
boxaClear()
BOXAA * boxaaCopy(BOXAA *baas, l_int32 copyflag)
boxaaCopy()
l_ok boxIsValid(BOX *box, l_int32 *pvalid)
boxIsValid()
l_ok boxGetGeometry(BOX *box, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxGetGeometry()
BOX * boxCreate(l_int32 x, l_int32 y, l_int32 w, l_int32 h)
boxCreate()
BOXA * boxaRead(const char *filename)
boxaRead()
l_ok boxChangeRefcount(BOX *box, l_int32 delta)
Adjust the current references count of box by delta.
l_ok boxaaExtendArrayToSize(BOXAA *baa, l_int32 size)
boxaaExtendArrayToSize()
l_ok boxaInsertBox(BOXA *boxa, l_int32 index, BOX *box)
boxaInsertBox()
BOXA * boxaaGetBoxa(BOXAA *baa, l_int32 index, l_int32 accessflag)
boxaaGetBoxa()
void sarrayDestroy(SARRAY **psa)
sarrayDestroy()