39 #include "allheaders.h" 44 static const char *str_ital1 =
" o x" 58 static const char *str_ital2 =
" o x" 72 static const char *str_ital3 =
" x" 110 pixItalicWords(
PIX *pixs,
119 PIX *pixsd, *pixm, *pixd;
120 SEL *sel_ital1, *sel_ital2, *sel_ital3;
122 PROCNAME(
"pixItalicWords");
125 return ERROR_INT(
"pixs not defined", procName, 1);
127 return ERROR_INT(
"&boxa not defined", procName, 1);
129 return ERROR_INT(
"both boxaw and pixw are defined", procName, 1);
139 pixsd =
pixHMT(NULL, pixs, sel_ital1);
141 pixOpen(pixsd, pixsd, sel_ital3);
151 pixWordMaskByDilation(pixs, NULL, &size, NULL);
152 L_INFO(
"dilation size = %d\n", procName, size);
153 snprintf(opstring,
sizeof(opstring),
"d1.5 + c%d.1", size);
171 PIX *pix1, *pix2, *pix3;
175 pixSaveTiledOutline(pixs, pad, 0.5, 1, 20, 2, 32);
176 pixSaveTiledOutline(pixsd, pad, 0.5, 1, 20, 2, 0);
179 pixSaveTiledOutline(pix1, pad, 0.5, 1, 20, 2, 0);
181 pixSaveTiledOutline(pixd, pad, 0.5, 1, 20, 2, 0);
184 pixSaveTiledOutline(pix1, pad, 0.5, 1, 20, 2, 0);
191 pixSaveTiledOutline(pix1, pad, 0.5, 1, 20, 2, 0);
196 pixWriteDebug(
"/tmp/lept/ital/ital.png", pix2, IFF_PNG);
203 res = pixGetWidth(pixs) / 12;
204 L_INFO(
"resolution = %d\n", procName, res);
207 "/tmp/lept/ital/ital.pdf");
218 upper = L_MAX(30, 3 * size);
221 gplot =
gplotCreate(
"/tmp/lept/ital/runhisto", GPLOT_PNG,
222 "Histogram of horizontal runs of white pixels, vs length",
223 "run length",
"number of runs");
void gplotDestroy(GPLOT **pgplot)
gplotDestroy()
l_int32 lept_mkdir(const char *subdir)
lept_mkdir()
l_ok gplotAddPlot(GPLOT *gplot, NUMA *nax, NUMA *nay, l_int32 plotstyle, const char *plottitle)
gplotAddPlot()
PIX * pixConvertTo32(PIX *pixs)
pixConvertTo32()
PIXA * pixaCreate(l_int32 n)
pixaCreate()
l_ok gplotMakeOutput(GPLOT *gplot)
gplotMakeOutput()
GPLOT * gplotCreate(const char *rootname, l_int32 outformat, const char *title, const char *xlabel, const char *ylabel)
gplotCreate()
PIX * pixOpen(PIX *pixd, PIX *pixs, SEL *sel)
pixOpen()
PIX * pixDilateBrick(PIX *pixd, PIX *pixs, l_int32 hsize, l_int32 vsize)
pixDilateBrick()
void boxaDestroy(BOXA **pboxa)
boxaDestroy()
PIX * pixaDisplay(PIXA *pixa, l_int32 w, l_int32 h)
pixaDisplay()
PIX * pixCreateTemplate(PIX *pixs)
pixCreateTemplate()
l_ok pixCombineMasked(PIX *pixd, PIX *pixs, PIX *pixm)
pixCombineMasked()
BOXA * pixConnComp(PIX *pixs, PIXA **ppixa, l_int32 connectivity)
pixConnComp()
void selDestroy(SEL **psel)
selDestroy()
void l_pdfSetDateAndVersion(l_int32 flag)
l_pdfSetDateAndVersion()
PIX * pixMorphSequence(PIX *pixs, const char *sequence, l_int32 dispsep)
pixMorphSequence()
l_ok boxaWriteDebug(const char *filename, BOXA *boxa)
boxaWriteDebug()
NUMA * pixRunHistogramMorph(PIX *pixs, l_int32 runtype, l_int32 direction, l_int32 maxsize)
pixRunHistogramMorph()
PIX * pixClone(PIX *pixs)
pixClone()
void pixDestroy(PIX **ppix)
pixDestroy()
PIX * pixMaskBoxa(PIX *pixd, PIX *pixs, BOXA *boxa, l_int32 op)
pixMaskBoxa()
void numaDestroy(NUMA **pna)
numaDestroy()
PIX * pixSeedfillBinary(PIX *pixd, PIX *pixs, PIX *pixm, l_int32 connectivity)
pixSeedfillBinary()
l_ok pixaConvertToPdf(PIXA *pixa, l_int32 res, l_float32 scalefactor, l_int32 type, l_int32 quality, const char *title, const char *fileout)
pixaConvertToPdf()
l_ok pixRenderBoxaArb(PIX *pix, BOXA *boxa, l_int32 width, l_uint8 rval, l_uint8 gval, l_uint8 bval)
pixRenderBoxaArb()
PIX * pixHMT(PIX *pixd, PIX *pixs, SEL *sel)
pixHMT()
PIX * pixClose(PIX *pixd, PIX *pixs, SEL *sel)
pixClose()
PIX * pixCopy(PIX *pixd, PIX *pixs)
pixCopy()
void pixaDestroy(PIXA **ppixa)
pixaDestroy()
PIX * pixSetBlackOrWhiteBoxa(PIX *pixs, BOXA *boxa, l_int32 op)
pixSetBlackOrWhiteBoxa()
SEL * selCreateFromString(const char *text, l_int32 h, l_int32 w, const char *name)
selCreateFromString()