42 #include <config_auto.h> 45 #include "allheaders.h" 50 static const char *str_ital1 =
" o x" 64 static const char *str_ital2 =
" o x" 78 static const char *str_ital3 =
" x" 116 pixItalicWords(
PIX *pixs,
125 PIX *pixsd, *pixm, *pixd;
126 SEL *sel_ital1, *sel_ital2, *sel_ital3;
128 PROCNAME(
"pixItalicWords");
131 return ERROR_INT(
"&boxa not defined", procName, 1);
134 return ERROR_INT(
"pixs not defined", procName, 1);
136 return ERROR_INT(
"both boxaw and pixw are defined", procName, 1);
146 pixsd =
pixHMT(NULL, pixs, sel_ital1);
148 pixOpen(pixsd, pixsd, sel_ital3);
158 pixWordMaskByDilation(pixs, NULL, &size, NULL);
159 L_INFO(
"dilation size = %d\n", procName, size);
160 snprintf(opstring,
sizeof(opstring),
"d1.5 + c%d.1", size);
178 PIX *pix1, *pix2, *pix3;
200 pixWriteDebug(
"/tmp/lept/ital/ital.png", pix2, IFF_PNG);
207 res = pixGetWidth(pixs) / 12;
208 L_INFO(
"resolution = %d\n", procName, res);
211 "/tmp/lept/ital/ital.pdf");
222 upper = L_MAX(30, 3 * size);
225 gplot =
gplotCreate(
"/tmp/lept/ital/runhisto", GPLOT_PNG,
226 "Histogram of horizontal runs of white pixels, vs length",
227 "run length",
"number of runs");
void gplotDestroy(GPLOT **pgplot)
gplotDestroy()
l_int32 lept_mkdir(const char *subdir)
lept_mkdir()
PIX * pixConvertTo32(PIX *pixs)
pixConvertTo32()
PIX * pixCreateTemplate(const PIX *pixs)
pixCreateTemplate()
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 * pixCopy(PIX *pixd, const PIX *pixs)
pixCopy()
PIX * pixDilateBrick(PIX *pixd, PIX *pixs, l_int32 hsize, l_int32 vsize)
pixDilateBrick()
void boxaDestroy(BOXA **pboxa)
boxaDestroy()
PIX * pixaDisplayTiledInColumns(PIXA *pixas, l_int32 nx, l_float32 scalefactor, l_int32 spacing, l_int32 border)
pixaDisplayTiledInColumns()
l_ok pixCombineMasked(PIX *pixd, PIX *pixs, PIX *pixm)
pixCombineMasked()
BOXA * pixConnComp(PIX *pixs, PIXA **ppixa, l_int32 connectivity)
pixConnComp()
l_ok pixaAddPix(PIXA *pixa, PIX *pix, l_int32 copyflag)
pixaAddPix()
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()
l_ok gplotAddPlot(GPLOT *gplot, NUMA *nax, NUMA *nay, l_int32 plotstyle, const char *plotlabel)
gplotAddPlot()
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()
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()