src/libmorpho.h

Go to the documentation of this file.
00001 /* LIBMORPHO
00002  *
00003  * libmorpho.h
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU  General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  *  General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU  General Public
00016  * License along with this library; if not, write to the
00017  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018  * Boston, MA 02111-1307, USA.
00019  */
00020 
00030 #ifndef __LIBMORPHO__
00031 #define __LIBMORPHO__
00032 
00033 /* Include other headers files */
00034 #include <stdio.h>
00035 #include <string.h>
00036 #include <stdlib.h>
00037 #include <unistd.h>
00038 #include <errno.h>
00039 #include <fcntl.h>
00040 #include <sys/types.h>
00041 
00050 typedef unsigned char uint8_t;
00051 
00061 # ifndef __int8_t_defined
00062 typedef short int int16_t;
00063 #endif
00064 
00065 /* Verbosity for the sources */
00070 #define DEBUG 0
00071 
00072 /* Enumeration of return codes */
00078 #define  MORPHO_ERROR  -1
00079 
00084 #define  MORPHO_SUCCESS 0
00085 
00086 /* util.c */
00087 int imageTranspose(uint8_t *imageIn, uint8_t *imageOut, int imageWidth, int imageHeight);
00088 int is_size_valid_1D(int size, int imageWidth, char *func, int odd);
00089 
00090 /* erosionByAnchor.c */
00091 int erosionByAnchor_1D_horizontal(uint8_t *imageIn, uint8_t *imageOut, int imageWidth, int imageHeight, int size);
00092 int erosionByAnchor_1D_vertical(uint8_t *imageIn, uint8_t *imageOut, int imageWidth, int imageHeight, int size);
00093 int erosionByAnchor_2D(uint8_t *imageIn, uint8_t *imageOut, int imageWidth, int imageHeight, int seWidth, int seHeight);
00094 
00095 /* src/dilationByAnchor.c */
00096 int dilationByAnchor_1D_horizontal(uint8_t *imageIn, uint8_t *imageOut, int imageWidth, int imageHeight, int size);
00097 int dilationByAnchor_1D_vertical(uint8_t *imageIn, uint8_t *imageOut, int imageWidth, int imageHeight, int size);
00098 int dilationByAnchor_2D(uint8_t *imageIn, uint8_t *imageOut, int imageWidth, int imageHeight, int seWidth, int seHeight);
00099 
00100 /* openingByAnchor.c */
00101 int openingByAnchor_1D_horizontal(uint8_t *imageIn, uint8_t *imageOut, int imageWidth, int imageHeight, int size);
00102 int openingByAnchor_1D_vertical(uint8_t *imageIn, uint8_t *imageOut, int imageWidth, int imageHeight, int size);
00103 int openingByAnchor_2D(uint8_t *imageIn, uint8_t *imageOut, int imageWidth, int imageHeight, int seWidth, int seHeight);
00104 
00105 /* closingByAnchor.c */
00106 int closingByAnchor_1D_horizontal(uint8_t *imageIn, uint8_t *imageOut, int imageWidth, int imageHeight, int size);
00107 int closingByAnchor_1D_vertical(uint8_t *imageIn, uint8_t *imageOut, int imageWidth, int imageHeight, int size);
00108 int closingByAnchor_2D(uint8_t *imageIn, uint8_t *imageOut, int imageWidth, int imageHeight, int seWidth, int seHeight);
00109 
00110 /* erosionArbitrarySE.c */
00111 int erosion_arbitrary_SE(uint8_t *imageIn, uint8_t *imageOut, int imageWidth, int imageHeight, uint8_t *se, int seWidth, int seHeight, int seHorizontalOrigin, int seVerticalOrigin);
00112 
00113 /* dilationArbitrarySE.c */
00114 int dilation_arbitrary_SE(uint8_t *imageIn, uint8_t *imageOut, int imageWidth, int imageHeight, uint8_t *se, int seWidth, int seHeight, int seHorizontalOrigin, int seVerticalOrigin);
00115 
00116 /* openingArbitrarySE.c */
00117 int opening_arbitrary_SE(uint8_t *imageIn, uint8_t *imageOut, int imageWidth, int imageHeight, uint8_t *se1, int seWidth, int seHeight, int seHorizontalOrigin, int seVerticalOrigin);
00118 
00119 /* closingArbitrarySE.c */
00120 int closing_arbitrary_SE(uint8_t *imageIn, uint8_t *imageOut, int imageWidth, int imageHeight, uint8_t *se1, int seWidth, int seHeight, int seHorizontalOrigin, int seVerticalOrigin);
00121 
00122 /* erosionArbitrarySF.c */
00123 int erosion_arbitrary_SF(int16_t *imageIn, int16_t *imageOut, int imageWidth, int imageHeight, uint8_t *sf, int sfWidth, int sfHeight, int sfHorizontalOrigin, int sfVerticalOrigin);
00124 
00125 /* dilationArbitrarySF.c */
00126 int dilation_arbitrary_SF(int16_t *imageIn, int16_t *imageOut, int imageWidth, int imageHeight, uint8_t *sf, int sfWidth, int sfHeight, int sfHorizontalOrigin, int sfVerticalOrigin);
00127 
00128 /* openingArbitrarySF.c */
00129 int opening_arbitrary_SF(int16_t *imageIn, int16_t *imageOut, int imageWidth, int imageHeight, uint8_t *sf1, int sfWidth, int sfHeight, int sfHorizontalOrigin, int sfVerticalOrigin);
00130 
00131 /* closingArbitrarySF.c */
00132 int closing_arbitrary_SF(int16_t *imageIn, int16_t *imageOut, int imageWidth, int imageHeight, uint8_t *sf1, int sfWidth, int sfHeight, int sfHorizontalOrigin, int sfVerticalOrigin);
00133 
00134 #endif
00135 

Telecommunications and Imaging Laboratory - Institut Montefiore - Université de Liège