42 #include <config_auto.h>
45 #include "allheaders.h"
74 PIX *pixr, *pixg, *pixb, *pixrm, *pixgm, *pixbm, *pixd;
77 return (
PIX *)ERROR_PTR(
"pixs not defined", __func__, NULL);
78 if (pixGetDepth(pixs) != 32)
79 return (
PIX *)ERROR_PTR(
"pixs not 32 bpp", __func__, NULL);
80 if (type != L_MORPH_DILATE && type != L_MORPH_ERODE &&
81 type != L_MORPH_OPEN && type != L_MORPH_CLOSE)
82 return (
PIX *)ERROR_PTR(
"invalid morph type", __func__, NULL);
83 if (hsize < 1 || vsize < 1)
84 return (
PIX *)ERROR_PTR(
"hsize or vsize < 1", __func__, NULL);
85 if ((hsize & 1) == 0 ) {
86 L_WARNING(
"horiz sel size must be odd; increasing by 1\n", __func__);
89 if ((vsize & 1) == 0 ) {
90 L_WARNING(
"vert sel size must be odd; increasing by 1\n", __func__);
94 if (hsize == 1 && vsize == 1)
100 if (type == L_MORPH_DILATE) {
104 }
else if (type == L_MORPH_ERODE) {
108 }
else if (type == L_MORPH_OPEN) {
PIX * pixColorMorph(PIX *pixs, l_int32 type, l_int32 hsize, l_int32 vsize)
pixColorMorph()
PIX * pixCloseGray(PIX *pixs, l_int32 hsize, l_int32 vsize)
pixCloseGray()
PIX * pixDilateGray(PIX *pixs, l_int32 hsize, l_int32 vsize)
pixDilateGray()
PIX * pixOpenGray(PIX *pixs, l_int32 hsize, l_int32 vsize)
pixOpenGray()
PIX * pixErodeGray(PIX *pixs, l_int32 hsize, l_int32 vsize)
pixErodeGray()
void pixDestroy(PIX **ppix)
pixDestroy()
PIX * pixCopy(PIX *pixd, const PIX *pixs)
pixCopy()
PIX * pixGetRGBComponent(PIX *pixs, l_int32 comp)
pixGetRGBComponent()
PIX * pixCreateRGBImage(PIX *pixr, PIX *pixg, PIX *pixb)
pixCreateRGBImage()