35 #include "allheaders.h"
37 PIX *pixHMTDwa_1(
PIX *pixd,
PIX *pixs,
const char *selname);
38 PIX *pixFHMTGen_1(
PIX *pixd,
PIX *pixs,
const char *selname);
39 l_int32 fhmtgen_low_1(l_uint32 *datad, l_int32 w,
40 l_int32 h, l_int32 wpld,
41 l_uint32 *datas, l_int32 wpls,
44 static l_int32 NUM_SELS_GENERATED = 10;
45 static char SEL_NAMES[][80] = {
73 pixHMTDwa_1(
PIX *pixd,
77 PIX *pixt1, *pixt2, *pixt3;
80 return (
PIX *)ERROR_PTR(
"pixs not defined", __func__, pixd);
81 if (pixGetDepth(pixs) != 1)
82 return (
PIX *)ERROR_PTR(
"pixs must be 1 bpp", __func__, pixd);
85 pixt2 = pixFHMTGen_1(NULL, pixt1, selname);
119 pixFHMTGen_1(
PIX *pixd,
123 l_int32 i, index, found, w, h, wpls, wpld;
124 l_uint32 *datad, *datas, *datat;
128 return (
PIX *)ERROR_PTR(
"pixs not defined", __func__, pixd);
129 if (pixGetDepth(pixs) != 1)
130 return (
PIX *)ERROR_PTR(
"pixs must be 1 bpp", __func__, pixd);
133 for (i = 0; i < NUM_SELS_GENERATED; i++) {
134 if (strcmp(selname, SEL_NAMES[i]) == 0) {
141 return (
PIX *)ERROR_PTR(
"sel index not found", __func__, pixd);
145 return (
PIX *)ERROR_PTR(
"pixd not made", __func__, NULL);
149 wpls = pixGetWpl(pixs);
150 wpld = pixGetWpl(pixd);
156 w = pixGetWidth(pixs) - 64;
157 h = pixGetHeight(pixs) - 64;
162 if ((pixt =
pixCopy(NULL, pixs)) == NULL)
163 return (
PIX *)ERROR_PTR(
"pixt not made", __func__, pixd);
165 fhmtgen_low_1(datad, w, h, wpld, datat, wpls, index);
169 fhmtgen_low_1(datad, w, h, wpld, datas, wpls, index);
l_uint32 * pixGetData(PIX *pix)
pixGetData()
l_ok pixResizeImageData(PIX *pixd, const PIX *pixs)
pixResizeImageData()
void pixDestroy(PIX **ppix)
pixDestroy()
PIX * pixCopy(PIX *pixd, const PIX *pixs)
pixCopy()
PIX * pixCreateTemplate(const PIX *pixs)
pixCreateTemplate()
PIX * pixAddBorder(PIX *pixs, l_int32 npix, l_uint32 val)
pixAddBorder()
PIX * pixRemoveBorder(PIX *pixs, l_int32 npix)
pixRemoveBorder()