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,
122 char opstring[32], buf[32];
125 PIX *pixsd, *pixm, *pixd;
126 SEL *sel_ital1, *sel_ital2, *sel_ital3;
129 return ERROR_INT(
"&boxa not defined", __func__, 1);
132 return ERROR_INT(
"pixs not defined", __func__, 1);
134 return ERROR_INT(
"both boxaw and pixw are defined", __func__, 1);
144 pixsd =
pixHMT(NULL, pixs, sel_ital1);
146 pixOpen(pixsd, pixsd, sel_ital3);
158 pixWordMaskByDilation(pixs, NULL, &size, NULL);
159 L_INFO(
"dilation size = %d\n", __func__, size);
160 snprintf(opstring,
sizeof(opstring),
"d1.5 + c%d.1", size);
179 PIX *pix1, *pix2, *pix3;
201 snprintf(buf,
sizeof(buf),
"/tmp/lept/ital/ital.%d.png", type);
202 pixWriteDebug(buf, pix2, IFF_PNG);
209 res = pixGetWidth(pixs) / 12;
210 L_INFO(
"resolution = %d\n", __func__, res);
212 snprintf(buf,
sizeof(buf),
"/tmp/lept/ital/ital.%d.pdf", type);
225 upper = L_MAX(30, 3 * size);
228 gplot =
gplotCreate(
"/tmp/lept/ital/runhisto", GPLOT_PNG,
229 "Histogram of horizontal runs of white pixels, vs length",
230 "run length",
"number of runs");
l_ok boxaWriteDebug(const char *filename, BOXA *boxa)
boxaWriteDebug()
void boxaDestroy(BOXA **pboxa)
boxaDestroy()
PIX * pixSetBlackOrWhiteBoxa(PIX *pixs, BOXA *boxa, l_int32 op)
pixSetBlackOrWhiteBoxa()
PIX * pixMaskBoxa(PIX *pixd, PIX *pixs, BOXA *boxa, l_int32 op)
pixMaskBoxa()
BOXA * pixConnComp(PIX *pixs, PIXA **ppixa, l_int32 connectivity)
pixConnComp()
l_ok gplotAddPlot(GPLOT *gplot, NUMA *nax, NUMA *nay, l_int32 plotstyle, const char *plotlabel)
gplotAddPlot()
l_ok gplotMakeOutput(GPLOT *gplot)
gplotMakeOutput()
GPLOT * gplotCreate(const char *rootname, l_int32 outformat, const char *title, const char *xlabel, const char *ylabel)
gplotCreate()
void gplotDestroy(GPLOT **pgplot)
gplotDestroy()
l_ok pixRenderBoxaArb(PIX *pix, BOXA *boxa, l_int32 width, l_uint8 rval, l_uint8 gval, l_uint8 bval)
pixRenderBoxaArb()
PIX * pixOpen(PIX *pixd, PIX *pixs, SEL *sel)
pixOpen()
PIX * pixClose(PIX *pixd, PIX *pixs, SEL *sel)
pixClose()
PIX * pixHMT(PIX *pixd, PIX *pixs, SEL *sel)
pixHMT()
PIX * pixDilateBrick(PIX *pixd, PIX *pixs, l_int32 hsize, l_int32 vsize)
pixDilateBrick()
NUMA * pixRunHistogramMorph(PIX *pixs, l_int32 runtype, l_int32 direction, l_int32 maxsize)
pixRunHistogramMorph()
PIX * pixMorphSequence(PIX *pixs, const char *sequence, l_int32 dispsep)
pixMorphSequence()
void numaDestroy(NUMA **pna)
numaDestroy()
l_ok pixaConvertToPdf(PIXA *pixa, l_int32 res, l_float32 scalefactor, l_int32 type, l_int32 quality, const char *title, const char *fileout)
pixaConvertToPdf()
void l_pdfSetDateAndVersion(l_int32 flag)
l_pdfSetDateAndVersion()
void pixDestroy(PIX **ppix)
pixDestroy()
PIX * pixCopy(PIX *pixd, const PIX *pixs)
pixCopy()
PIX * pixCreateTemplate(const PIX *pixs)
pixCreateTemplate()
PIX * pixClone(PIX *pixs)
pixClone()
l_ok pixCombineMasked(PIX *pixd, PIX *pixs, PIX *pixm)
pixCombineMasked()
l_ok pixaAddPix(PIXA *pixa, PIX *pix, l_int32 copyflag)
pixaAddPix()
void pixaDestroy(PIXA **ppixa)
pixaDestroy()
PIXA * pixaCreate(l_int32 n)
pixaCreate()
PIX * pixaDisplayTiledInColumns(PIXA *pixas, l_int32 nx, l_float32 scalefactor, l_int32 spacing, l_int32 border)
pixaDisplayTiledInColumns()
PIX * pixConvertTo32(PIX *pixs)
pixConvertTo32()
PIX * pixSeedfillBinary(PIX *pixd, PIX *pixs, PIX *pixm, l_int32 connectivity)
pixSeedfillBinary()
SEL * selCreateFromString(const char *text, l_int32 h, l_int32 w, const char *name)
selCreateFromString()
void selDestroy(SEL **psel)
selDestroy()
l_int32 lept_mkdir(const char *subdir)
lept_mkdir()