00001
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _GAN_MASK1D_H
00030 #define _GAN_MASK1D_H
00031
00032 #include <gandalf/common/misc_defs.h>
00033
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037
00051 typedef enum
00052 {
00053 GAN_MASK1D_SYMMETRIC,
00054 GAN_MASK1D_ANTISYMMETRIC,
00055 GAN_MASK1D_GENERIC
00056 } Gan_Mask1DFormat;
00057
00061 typedef enum
00062 {
00063 GAN_EDGE_BEHAVIOUR_CLIP,
00064 GAN_EDGE_BEHAVIOUR_REPEAT,
00065 GAN_EDGE_BEHAVIOUR_CIRCULAR,
00066 GAN_EDGE_BEHAVIOUR_EXPAND
00067 } Gan_EdgeBehaviour;
00068
00072 typedef struct
00073 {
00075 Gan_Mask1DFormat format;
00076
00078 Gan_Type type;
00079
00081 unsigned int size;
00082
00084 unsigned int size_alloc;
00085
00087 union
00088 {
00089 float *f;
00090 double *d;
00091 int *i;
00092 unsigned short *us;
00093 unsigned char *uc;
00094
00095 } data;
00096
00098 Gan_Bool data_alloc;
00099
00101 Gan_Bool alloc;
00102 } Gan_Mask1D;
00103
00104
00105 Gan_Mask1D *gan_mask1D_form_gen ( Gan_Mask1D *mask,
00106 Gan_Mask1DFormat format, Gan_Type type,
00107 void *data, unsigned int size );
00108 Gan_Bool gan_mask1D_copy_q ( Gan_Mask1D *source, Gan_Mask1D *dest );
00109 Gan_Bool gan_mask1D_free ( Gan_Mask1D *mask );
00110
00111 Gan_Mask1D *gan_gauss_mask_new ( Gan_Type type, double sigma,
00112 unsigned mask_size, double scale,
00113 void *mask_data );
00114
00124 Gan_Mask1D *gan_mask1D_alloc ( Gan_Mask1DFormat format, Gan_Type type,
00125 unsigned int size );
00126
00136 Gan_Mask1D *gan_mask1D_alloc_data ( Gan_Mask1DFormat format, Gan_Type type,
00137 void *data, unsigned int size );
00138
00148 Gan_Mask1D *gan_mask1D_form ( Gan_Mask1D *mask,
00149 Gan_Mask1DFormat format, Gan_Type type,
00150 unsigned int size );
00151
00162 Gan_Mask1D *gan_mask1D_form_data ( Gan_Mask1D *mask,
00163 Gan_Mask1DFormat format, Gan_Type type,
00164 void *data, unsigned int size );
00165
00174 #ifdef __cplusplus
00175 }
00176 #endif
00177
00178 #endif