125 #include <config_auto.h> 129 #include "allheaders.h" 132 static const size_t MaxPtrArraySize = 100000;
163 PROCNAME(
"fpixCreate");
166 return (
FPIX *)ERROR_PTR(
"width must be > 0", procName, NULL);
168 return (
FPIX *)ERROR_PTR(
"height must be > 0", procName, NULL);
171 npix64 = (l_uint64)width * (l_uint64)height;
172 if (npix64 >= (1LL << 29)) {
173 L_ERROR(
"requested w = %d, h = %d\n", procName, width, height);
174 return (
FPIX *)ERROR_PTR(
"requested bytes >= 2^31", procName, NULL);
177 fpixd = (
FPIX *)LEPT_CALLOC(1,
sizeof(
FPIX));
182 data = (l_float32 *)LEPT_CALLOC((
size_t)width * height,
sizeof(l_float32));
185 return (
FPIX *)ERROR_PTR(
"calloc fail for data", procName, NULL);
211 PROCNAME(
"fpixCreateTemplate");
214 return (
FPIX *)ERROR_PTR(
"fpixs not defined", procName, NULL);
218 return (
FPIX *)ERROR_PTR(
"fpixd not made", procName, NULL);
238 PROCNAME(
"fpixClone");
241 return (
FPIX *)ERROR_PTR(
"fpix not defined", procName, NULL);
258 l_float32 *datas, *datad;
261 PROCNAME(
"fpixCopy");
264 return (
FPIX *)ERROR_PTR(
"fpixs not defined", procName, NULL);
271 return (
FPIX *)ERROR_PTR(
"fpixd not made", procName, NULL);
274 memcpy(datad, datas, bytes);
297 PROCNAME(
"fpixDestroy");
300 L_WARNING(
"ptr address is null!\n", procName);
304 if ((fpix = *pfpix) == NULL)
333 PROCNAME(
"fpixGetDimensions");
336 return ERROR_INT(
"no return val requested", procName, 1);
340 return ERROR_INT(
"fpix not defined", procName, 1);
341 if (pw) *pw = fpix->
w;
342 if (ph) *ph = fpix->
h;
359 PROCNAME(
"fpixSetDimensions");
362 return ERROR_INT(
"fpix not defined", procName, 1);
378 PROCNAME(
"fpixGetWpl");
381 return ERROR_INT(
"fpix not defined", procName, 0);
397 PROCNAME(
"fpixSetWpl");
400 return ERROR_INT(
"fpix not defined", procName, 1);
416 PROCNAME(
"fpixGetRefcount");
419 return ERROR_INT(
"fpix not defined", procName, UNDEF);
435 PROCNAME(
"fpixChangeRefcount");
438 return ERROR_INT(
"fpix not defined", procName, 1);
457 PROCNAME(
"fpixGetResolution");
460 return ERROR_INT(
"fpix not defined", procName, 1);
461 if (pxres) *pxres = fpix->
xres;
462 if (pyres) *pyres = fpix->
yres;
479 PROCNAME(
"fpixSetResolution");
482 return ERROR_INT(
"fpix not defined", procName, 1);
501 PROCNAME(
"fpixCopyResolution");
503 if (!fpixs || !fpixd)
504 return ERROR_INT(
"fpixs and fpixd not both defined", procName, 1);
521 PROCNAME(
"fpixGetData");
524 return (l_float32 *)ERROR_PTR(
"fpix not defined", procName, NULL);
540 PROCNAME(
"fpixSetData");
543 return ERROR_INT(
"fpix not defined", procName, 1);
570 PROCNAME(
"fpixGetPixel");
573 return ERROR_INT(
"pval not defined", procName, 1);
576 return ERROR_INT(
"fpix not defined", procName, 1);
579 if (x < 0 || x >= w || y < 0 || y >= h)
582 *pval = *(fpix->
data + y * w + x);
607 PROCNAME(
"fpixSetPixel");
610 return ERROR_INT(
"fpix not defined", procName, 1);
613 if (x < 0 || x >= w || y < 0 || y >= h)
616 *(fpix->
data + y * w + x) = val;
635 PROCNAME(
"fpixaCreate");
637 if (n <= 0 || n > MaxPtrArraySize)
640 fpixa = (
FPIXA *)LEPT_CALLOC(1,
sizeof(
FPIXA));
672 PROCNAME(
"fpixaCopy");
675 return (
FPIXA *)ERROR_PTR(
"fpixa not defined", procName, NULL);
683 return (
FPIXA *)ERROR_PTR(
"invalid copyflag", procName, NULL);
686 return (
FPIXA *)ERROR_PTR(
"fpixac not made", procName, NULL);
687 for (i = 0; i < fpixa->
n; i++) {
717 PROCNAME(
"fpixaDestroy");
719 if (pfpixa == NULL) {
720 L_WARNING(
"ptr address is NULL!\n", procName);
724 if ((fpixa = *pfpixa) == NULL)
730 for (i = 0; i < fpixa->
n; i++)
732 LEPT_FREE(fpixa->
fpix);
758 PROCNAME(
"fpixaAddFPix");
761 return ERROR_INT(
"fpixa not defined", procName, 1);
763 return ERROR_INT(
"fpix not defined", procName, 1);
767 else if (copyflag ==
L_COPY)
772 return ERROR_INT(
"invalid copyflag", procName, 1);
774 return ERROR_INT(
"fpixc not made", procName, 1);
781 return ERROR_INT(
"extension failed", procName, 1);
784 fpixa->
fpix[n] = fpixc;
805 PROCNAME(
"fpixaExtendArray");
808 return ERROR_INT(
"fpixa not defined", procName, 1);
831 size_t oldsize, newsize;
833 PROCNAME(
"fpixaExtendArrayToSize");
836 return ERROR_INT(
"fpixa not defined", procName, 1);
837 if (fpixa->
nalloc > MaxPtrArraySize)
838 return ERROR_INT(
"fpixa has too many ptrs", procName, 1);
839 if (size > MaxPtrArraySize)
840 return ERROR_INT(
"size > 100K ptrs; too large", procName, 1);
841 if (size <= fpixa->nalloc) {
842 L_INFO(
"size too small; no extension\n", procName);
847 newsize = size *
sizeof(
FPIX *);
849 oldsize, newsize)) == NULL)
850 return ERROR_INT(
"new ptr array not returned", procName, 1);
868 PROCNAME(
"fpixaGetCount");
871 return ERROR_INT(
"fpixa not defined", procName, 0);
888 PROCNAME(
"fpixaChangeRefcount");
891 return ERROR_INT(
"fpixa not defined", procName, 1);
911 PROCNAME(
"fpixaGetFPix");
914 return (
FPIX *)ERROR_PTR(
"fpixa not defined", procName, NULL);
915 if (index < 0 || index >= fpixa->
n)
916 return (
FPIX *)ERROR_PTR(
"index not valid", procName, NULL);
920 else if (accesstype ==
L_CLONE)
923 return (
FPIX *)ERROR_PTR(
"invalid accesstype", procName, NULL);
943 PROCNAME(
"fpixaGetFPixDimensions");
946 return ERROR_INT(
"no return val requested", procName, 1);
950 return ERROR_INT(
"fpixa not defined", procName, 1);
951 if (index < 0 || index >= fpixa->
n)
952 return ERROR_INT(
"index not valid", procName, 1);
955 return ERROR_INT(
"fpix not found!", procName, 1);
977 PROCNAME(
"fpixaGetData");
980 return (l_float32 *)ERROR_PTR(
"fpixa not defined", procName, NULL);
982 if (index < 0 || index >= n)
983 return (l_float32 *)ERROR_PTR(
"invalid index", procName, NULL);
1011 PROCNAME(
"fpixaGetPixel");
1014 return ERROR_INT(
"pval not defined", procName, 1);
1017 return ERROR_INT(
"fpixa not defined", procName, 1);
1019 if (index < 0 || index >= n)
1020 return ERROR_INT(
"invalid index into fpixa", procName, 1);
1048 PROCNAME(
"fpixaSetPixel");
1051 return ERROR_INT(
"fpixa not defined", procName, 1);
1053 if (index < 0 || index >= n)
1054 return ERROR_INT(
"invalid index into fpixa", procName, 1);
1087 PROCNAME(
"dpixCreate");
1090 return (
DPIX *)ERROR_PTR(
"width must be > 0", procName, NULL);
1092 return (
DPIX *)ERROR_PTR(
"height must be > 0", procName, NULL);
1095 npix64 = (l_uint64)width * (l_uint64)height;
1096 if (npix64 >= (1LL << 28)) {
1097 L_ERROR(
"requested w = %d, h = %d\n", procName, width, height);
1098 return (
DPIX *)ERROR_PTR(
"requested bytes >= 2^31", procName, NULL);
1101 dpix = (
DPIX *)LEPT_CALLOC(1,
sizeof(
DPIX));
1106 data = (l_float64 *)LEPT_CALLOC((
size_t)width * height,
sizeof(l_float64));
1109 return (
DPIX *)ERROR_PTR(
"calloc fail for data", procName, NULL);
1135 PROCNAME(
"dpixCreateTemplate");
1138 return (
DPIX *)ERROR_PTR(
"dpixs not defined", procName, NULL);
1161 PROCNAME(
"dpixClone");
1164 return (
DPIX *)ERROR_PTR(
"dpix not defined", procName, NULL);
1179 l_int32 w, h, bytes;
1180 l_float64 *datas, *datad;
1183 PROCNAME(
"dpixCopy");
1186 return (
DPIX *)ERROR_PTR(
"dpixs not defined", procName, NULL);
1193 return (
DPIX *)ERROR_PTR(
"dpixd not made", procName, NULL);
1196 memcpy(datad, datas, bytes);
1219 PROCNAME(
"dpixDestroy");
1222 L_WARNING(
"ptr address is null!\n", procName);
1226 if ((dpix = *pdpix) == NULL)
1255 PROCNAME(
"dpixGetDimensions");
1258 return ERROR_INT(
"no return val requested", procName, 1);
1262 return ERROR_INT(
"dpix not defined", procName, 1);
1263 if (pw) *pw = dpix->
w;
1264 if (ph) *ph = dpix->
h;
1281 PROCNAME(
"dpixSetDimensions");
1284 return ERROR_INT(
"dpix not defined", procName, 1);
1300 PROCNAME(
"dpixGetWpl");
1303 return ERROR_INT(
"dpix not defined", procName, 0);
1319 PROCNAME(
"dpixSetWpl");
1322 return ERROR_INT(
"dpix not defined", procName, 1);
1338 PROCNAME(
"dpixGetRefcount");
1341 return ERROR_INT(
"dpix not defined", procName, UNDEF);
1357 PROCNAME(
"dpixChangeRefcount");
1360 return ERROR_INT(
"dpix not defined", procName, 1);
1379 PROCNAME(
"dpixGetResolution");
1382 return ERROR_INT(
"dpix not defined", procName, 1);
1383 if (pxres) *pxres = dpix->
xres;
1384 if (pyres) *pyres = dpix->
yres;
1401 PROCNAME(
"dpixSetResolution");
1404 return ERROR_INT(
"dpix not defined", procName, 1);
1423 PROCNAME(
"dpixCopyResolution");
1425 if (!dpixs || !dpixd)
1426 return ERROR_INT(
"dpixs and dpixd not both defined", procName, 1);
1443 PROCNAME(
"dpixGetData");
1446 return (l_float64 *)ERROR_PTR(
"dpix not defined", procName, NULL);
1462 PROCNAME(
"dpixSetData");
1465 return ERROR_INT(
"dpix not defined", procName, 1);
1492 PROCNAME(
"dpixGetPixel");
1495 return ERROR_INT(
"pval not defined", procName, 1);
1498 return ERROR_INT(
"dpix not defined", procName, 1);
1501 if (x < 0 || x >= w || y < 0 || y >= h)
1504 *pval = *(dpix->
data + y * w + x);
1529 PROCNAME(
"dpixSetPixel");
1532 return ERROR_INT(
"dpix not defined", procName, 1);
1535 if (x < 0 || x >= w || y < 0 || y >= h)
1538 *(dpix->
data + y * w + x) = val;
1558 PROCNAME(
"fpixRead");
1561 return (
FPIX *)ERROR_PTR(
"filename not defined", procName, NULL);
1564 return (
FPIX *)ERROR_PTR(
"stream not opened", procName, NULL);
1568 return (
FPIX *)ERROR_PTR(
"fpix not read", procName, NULL);
1583 l_int32 w, h, nbytes, xres, yres, version;
1587 PROCNAME(
"fpixReadStream");
1590 return (
FPIX *)ERROR_PTR(
"stream not defined", procName, NULL);
1592 if (fscanf(fp,
"\nFPix Version %d\n", &version) != 1)
1593 return (
FPIX *)ERROR_PTR(
"not a fpix file", procName, NULL);
1595 return (
FPIX *)ERROR_PTR(
"invalid fpix version", procName, NULL);
1596 if (fscanf(fp,
"w = %d, h = %d, nbytes = %d\n", &w, &h, &nbytes) != 3)
1597 return (
FPIX *)ERROR_PTR(
"read fail for data size", procName, NULL);
1604 if (fgets(buf,
sizeof(buf), fp) == NULL)
1605 return (
FPIX *)ERROR_PTR(
"fgets read fail", procName, NULL);
1606 if (sscanf(buf,
"xres = %d, yres = %d\n", &xres, &yres) != 2)
1607 return (
FPIX *)ERROR_PTR(
"read fail for xres, yres", procName, NULL);
1610 return (
FPIX *)ERROR_PTR(
"fpix not made", procName, NULL);
1613 if (fread(data, 1, nbytes, fp) != nbytes) {
1615 return (
FPIX *)ERROR_PTR(
"read error for nbytes", procName, NULL);
1639 PROCNAME(
"fpixReadMem");
1642 return (
FPIX *)ERROR_PTR(
"data not defined", procName, NULL);
1644 return (
FPIX *)ERROR_PTR(
"stream not opened", procName, NULL);
1648 if (!fpix) L_ERROR(
"fpix not read\n", procName);
1667 PROCNAME(
"fpixWrite");
1670 return ERROR_INT(
"filename not defined", procName, 1);
1672 return ERROR_INT(
"fpix not defined", procName, 1);
1675 return ERROR_INT(
"stream not opened", procName, 1);
1679 return ERROR_INT(
"fpix not written to stream", procName, 1);
1695 l_int32 w, h, xres, yres;
1700 PROCNAME(
"fpixWriteStream");
1703 return ERROR_INT(
"stream not defined", procName, 1);
1705 return ERROR_INT(
"fpix not defined", procName, 1);
1712 nbytes =
sizeof(l_float32) * w * h;
1715 fprintf(fp,
"w = %d, h = %d, nbytes = %u\n", w, h, nbytes);
1716 fprintf(fp,
"xres = %d, yres = %d\n", xres, yres);
1717 fwrite(data, 1, nbytes, fp);
1746 PROCNAME(
"fpixWriteMem");
1748 if (pdata) *pdata = NULL;
1749 if (psize) *psize = 0;
1751 return ERROR_INT(
"&data not defined", procName, 1);
1753 return ERROR_INT(
"&size not defined", procName, 1);
1755 return ERROR_INT(
"fpix not defined", procName, 1);
1758 if ((fp = open_memstream((
char **)pdata, psize)) == NULL)
1759 return ERROR_INT(
"stream not opened", procName, 1);
1763 *psize = *psize - 1;
1765 L_INFO(
"work-around: writing to a temp file\n", procName);
1768 return ERROR_INT(
"tmpfile stream not opened", procName, 1);
1770 if ((fp = tmpfile()) == NULL)
1771 return ERROR_INT(
"tmpfile stream not opened", procName, 1);
1805 PROCNAME(
"fpixEndianByteSwap");
1808 return (
FPIX *)ERROR_PTR(
"fpixs not defined", procName, fpixd);
1809 if (fpixd && (fpixs != fpixd))
1810 return (
FPIX *)ERROR_PTR(
"fpixd != fpixs", procName, fpixd);
1823 for (i = 0; i < h; i++) {
1824 for (j = 0; j < w; j++, data++) {
1826 *data = (word >> 24) |
1827 ((word >> 8) & 0x0000ff00) |
1828 ((word << 8) & 0x00ff0000) |
1860 PROCNAME(
"dpixRead");
1863 return (
DPIX *)ERROR_PTR(
"filename not defined", procName, NULL);
1866 return (
DPIX *)ERROR_PTR(
"stream not opened", procName, NULL);
1870 return (
DPIX *)ERROR_PTR(
"dpix not read", procName, NULL);
1885 l_int32 w, h, nbytes, version, xres, yres;
1889 PROCNAME(
"dpixReadStream");
1892 return (
DPIX *)ERROR_PTR(
"stream not defined", procName, NULL);
1894 if (fscanf(fp,
"\nDPix Version %d\n", &version) != 1)
1895 return (
DPIX *)ERROR_PTR(
"not a dpix file", procName, NULL);
1897 return (
DPIX *)ERROR_PTR(
"invalid dpix version", procName, NULL);
1898 if (fscanf(fp,
"w = %d, h = %d, nbytes = %d\n", &w, &h, &nbytes) != 3)
1899 return (
DPIX *)ERROR_PTR(
"read fail for data size", procName, NULL);
1906 if (fgets(buf,
sizeof(buf), fp) == NULL)
1907 return (
DPIX *)ERROR_PTR(
"fgets read fail", procName, NULL);
1908 if (sscanf(buf,
"xres = %d, yres = %d\n", &xres, &yres) != 2)
1909 return (
DPIX *)ERROR_PTR(
"read fail for xres, yres", procName, NULL);
1912 return (
DPIX *)ERROR_PTR(
"dpix not made", procName, NULL);
1915 if (fread(data, 1, nbytes, fp) != nbytes) {
1917 return (
DPIX *)ERROR_PTR(
"read error for nbytes", procName, NULL);
1941 PROCNAME(
"dpixReadMem");
1944 return (
DPIX *)ERROR_PTR(
"data not defined", procName, NULL);
1946 return (
DPIX *)ERROR_PTR(
"stream not opened", procName, NULL);
1950 if (!dpix) L_ERROR(
"dpix not read\n", procName);
1969 PROCNAME(
"dpixWrite");
1972 return ERROR_INT(
"filename not defined", procName, 1);
1974 return ERROR_INT(
"dpix not defined", procName, 1);
1977 return ERROR_INT(
"stream not opened", procName, 1);
1981 return ERROR_INT(
"dpix not written to stream", procName, 1);
1997 l_int32 w, h, xres, yres;
2002 PROCNAME(
"dpixWriteStream");
2005 return ERROR_INT(
"stream not defined", procName, 1);
2007 return ERROR_INT(
"dpix not defined", procName, 1);
2015 nbytes =
sizeof(l_float64) * w * h;
2017 fprintf(fp,
"w = %d, h = %d, nbytes = %u\n", w, h, nbytes);
2018 fprintf(fp,
"xres = %d, yres = %d\n", xres, yres);
2019 fwrite(data, 1, nbytes, fp);
2048 PROCNAME(
"dpixWriteMem");
2050 if (pdata) *pdata = NULL;
2051 if (psize) *psize = 0;
2053 return ERROR_INT(
"&data not defined", procName, 1);
2055 return ERROR_INT(
"&size not defined", procName, 1);
2057 return ERROR_INT(
"dpix not defined", procName, 1);
2060 if ((fp = open_memstream((
char **)pdata, psize)) == NULL)
2061 return ERROR_INT(
"stream not opened", procName, 1);
2065 *psize = *psize - 1;
2067 L_INFO(
"work-around: writing to a temp file\n", procName);
2070 return ERROR_INT(
"tmpfile stream not opened", procName, 1);
2072 if ((fp = tmpfile()) == NULL)
2073 return ERROR_INT(
"tmpfile stream not opened", procName, 1);
2107 PROCNAME(
"dpixEndianByteSwap");
2110 return (
DPIX *)ERROR_PTR(
"dpixs not defined", procName, dpixd);
2111 if (dpixd && (dpixs != dpixd))
2112 return (
DPIX *)ERROR_PTR(
"dpixd != dpixs", procName, dpixd);
2125 for (i = 0; i < h; i++) {
2126 for (j = 0; j < 2 * w; j++, data++) {
2128 *data = (word >> 24) |
2129 ((word >> 8) & 0x0000ff00) |
2130 ((word << 8) & 0x00ff0000) |
2168 l_int32 i, j, w, h, count;
2171 PROCNAME(
"fpixPrintStream");
2174 return ERROR_INT(
"stream not defined", procName, 1);
2176 return ERROR_INT(
"fpix not defined", procName, 1);
2178 return ERROR_INT(
"sampling factor < 1f", procName, 1);
2181 fprintf(fp,
"\nFPix: w = %d, h = %d\n", w, h);
2182 for (i = 0; i < h; i += factor) {
2183 for (count = 0, j = 0; j < w; j += factor, count++) {
2185 fprintf(fp,
"val[%d, %d] = %f ", i, j, val);
2186 if ((count + 1) % 3 == 0) fprintf(fp,
"\n");
2188 if (count % 3) fprintf(fp,
"\n");
l_ok fpixCopyResolution(FPIX *fpixd, FPIX *fpixs)
fpixCopyResolution()
DPIX * dpixClone(DPIX *dpix)
dpixClone()
FPIXA * fpixaCopy(FPIXA *fpixa, l_int32 copyflag)
fpixaCopy()
void dpixDestroy(DPIX **pdpix)
dpixDestroy()
l_ok fpixaGetPixel(FPIXA *fpixa, l_int32 index, l_int32 x, l_int32 y, l_float32 *pval)
fpixaGetPixel()
l_ok fpixGetPixel(FPIX *fpix, l_int32 x, l_int32 y, l_float32 *pval)
fpixGetPixel()
DPIX * dpixCreate(l_int32 width, l_int32 height)
dpixCreate()
l_ok dpixChangeRefcount(DPIX *dpix, l_int32 delta)
dpixChangeRefcount()
l_ok dpixCopyResolution(DPIX *dpixd, DPIX *dpixs)
dpixCopyResolution()
l_int32 fpixaGetCount(FPIXA *fpixa)
fpixaGetCount()
l_float64 * dpixGetData(DPIX *dpix)
dpixGetData()
l_ok fpixaChangeRefcount(FPIXA *fpixa, l_int32 delta)
fpixaChangeRefcount()
l_ok fpixWriteStream(FILE *fp, FPIX *fpix)
fpixWriteStream()
l_int32 dpixGetWpl(DPIX *dpix)
dpixGetWpl()
l_ok dpixSetPixel(DPIX *dpix, l_int32 x, l_int32 y, l_float64 val)
dpixSetPixel()
l_ok dpixSetDimensions(DPIX *dpix, l_int32 w, l_int32 h)
dpixSetDimensions()
DPIX * dpixRead(const char *filename)
dpixRead()
l_ok dpixWrite(const char *filename, DPIX *dpix)
dpixWrite()
FILE * fopenReadFromMemory(const l_uint8 *data, size_t size)
fopenReadFromMemory()
l_ok fpixGetDimensions(FPIX *fpix, l_int32 *pw, l_int32 *ph)
fpixGetDimensions()
FPIX * fpixEndianByteSwap(FPIX *fpixd, FPIX *fpixs)
fpixEndianByteSwap()
FPIX * fpixCopy(FPIX *fpixs)
fpixCopy()
l_ok dpixSetResolution(DPIX *dpix, l_int32 xres, l_int32 yres)
dpixSetResolution()
FPIXA * fpixaCreate(l_int32 n)
fpixaCreate()
void fpixaDestroy(FPIXA **pfpixa)
fpixaDestroy()
DPIX * dpixCreateTemplate(DPIX *dpixs)
dpixCreateTemplate()
l_ok fpixSetResolution(FPIX *fpix, l_int32 xres, l_int32 yres)
fpixSetResolution()
l_ok fpixSetData(FPIX *fpix, l_float32 *data)
fpixSetData()
l_ok fpixSetPixel(FPIX *fpix, l_int32 x, l_int32 y, l_float32 val)
fpixSetPixel()
l_ok fpixaGetFPixDimensions(FPIXA *fpixa, l_int32 index, l_int32 *pw, l_int32 *ph)
fpixaGetFPixDimensions()
l_ok dpixSetWpl(DPIX *dpix, l_int32 wpl)
dpixSetWpl()
l_ok fpixWrite(const char *filename, FPIX *fpix)
fpixWrite()
l_ok dpixGetResolution(DPIX *dpix, l_int32 *pxres, l_int32 *pyres)
dpixGetResolution()
FPIX * fpixReadMem(const l_uint8 *data, size_t size)
fpixReadMem()
DPIX * dpixEndianByteSwap(DPIX *dpixd, DPIX *dpixs)
dpixEndianByteSwap()
l_ok fpixGetResolution(FPIX *fpix, l_int32 *pxres, l_int32 *pyres)
fpixGetResolution()
l_ok fpixSetDimensions(FPIX *fpix, l_int32 w, l_int32 h)
fpixSetDimensions()
l_ok fpixaSetPixel(FPIXA *fpixa, l_int32 index, l_int32 x, l_int32 y, l_float32 val)
fpixaSetPixel()
DPIX * dpixCopy(DPIX *dpixs)
dpixCopy()
static const size_t InitialPtrArraySize
l_ok fpixPrintStream(FILE *fp, FPIX *fpix, l_int32 factor)
fpixPrintStream()
l_int32 fpixGetWpl(FPIX *fpix)
fpixGetWpl()
void * reallocNew(void **pindata, size_t oldsize, size_t newsize)
reallocNew()
FPIX * fpixClone(FPIX *fpix)
fpixClone()
l_float32 * fpixaGetData(FPIXA *fpixa, l_int32 index)
fpixaGetData()
l_ok dpixGetPixel(DPIX *dpix, l_int32 x, l_int32 y, l_float64 *pval)
dpixGetPixel()
l_ok dpixWriteMem(l_uint8 **pdata, size_t *psize, DPIX *dpix)
dpixWriteMem()
DPIX * dpixReadMem(const l_uint8 *data, size_t size)
dpixReadMem()
l_float32 * fpixGetData(FPIX *fpix)
fpixGetData()
l_ok fpixChangeRefcount(FPIX *fpix, l_int32 delta)
fpixChangeRefcount()
l_ok fpixWriteMem(l_uint8 **pdata, size_t *psize, FPIX *fpix)
fpixWriteMem()
FILE * fopenWriteStream(const char *filename, const char *modestring)
fopenWriteStream()
FILE * fopenWriteWinTempfile(void)
fopenWriteWinTempfile()
FILE * fopenReadStream(const char *filename)
fopenReadStream()
l_uint8 * l_binaryReadStream(FILE *fp, size_t *pnbytes)
l_binaryReadStream()
l_ok dpixGetDimensions(DPIX *dpix, l_int32 *pw, l_int32 *ph)
dpixGetDimensions()
FPIX * fpixCreateTemplate(FPIX *fpixs)
fpixCreateTemplate()
FPIX * fpixCreate(l_int32 width, l_int32 height)
fpixCreate()
static l_int32 fpixaExtendArrayToSize(FPIXA *fpixa, l_int32 size)
fpixaExtendArrayToSize()
l_ok dpixWriteStream(FILE *fp, DPIX *dpix)
dpixWriteStream()
#define DPIX_VERSION_NUMBER
FPIX * fpixRead(const char *filename)
fpixRead()
FPIX * fpixReadStream(FILE *fp)
fpixReadStream()
static l_int32 fpixaExtendArray(FPIXA *fpixa)
fpixaExtendArray()
void fpixDestroy(FPIX **pfpix)
fpixDestroy()
l_int32 fpixGetRefcount(FPIX *fpix)
fpixGetRefcount()
l_int32 dpixGetRefcount(DPIX *dpix)
dpixGetRefcount()
l_ok fpixSetWpl(FPIX *fpix, l_int32 wpl)
fpixSetWpl()
l_ok dpixSetData(DPIX *dpix, l_float64 *data)
dpixSetData()
FPIX * fpixaGetFPix(FPIXA *fpixa, l_int32 index, l_int32 accesstype)
fpixaGetFPix()
DPIX * dpixReadStream(FILE *fp)
dpixReadStream()
l_ok fpixaAddFPix(FPIXA *fpixa, FPIX *fpix, l_int32 copyflag)
fpixaAddFPix()
#define FPIX_VERSION_NUMBER