00001
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _GAN_IMAGE_POINTER_H
00030 #define _GAN_IMAGE_POINTER_H
00031
00032 #define GAN_PIXEL void *
00033 #define GAN_PIXEL_FORMAT grey-level
00034 #define GAN_PIXEL_TYPE void *
00035 #define GAN_IMTYPE p
00036 #define GAN_IMAGE_FORM_GEN gan_image_form_gen_p
00037 #define GAN_IMAGE_SET_GEN gan_image_set_gen_p
00038 #define GAN_IMAGE_ALLOC gan_image_alloc_p
00039 #define GAN_IMAGE_ALLOC_DATA gan_image_alloc_data_p
00040 #define GAN_IMAGE_FORM gan_image_form_p
00041 #define GAN_IMAGE_FORM_DATA gan_image_form_data_p
00042 #define GAN_IMAGE_SET gan_image_set_p
00043 #define GAN_IMAGE_SET_PIX gan_image_set_pix_p
00044 #define GAN_IMAGE_GET_PIX gan_image_get_pix_p
00045 #define GAN_IMAGE_GET_PIXPTR gan_image_get_pixptr_p
00046 #define GAN_IMAGE_GET_PIXARR gan_image_get_pixarr_p
00047 #define GAN_IMAGE_FILL_CONST gan_image_fill_const_p
00048 #define GAN_IMAGE_GET_ACTIVE_SUBWINDOW gan_image_get_active_subwindow_p
00049 #define GAN_IMAGE_MASK_WINDOW gan_image_mask_window_p
00050 #define GAN_IMAGE_CLEAR_WINDOW gan_image_clear_window_p
00051
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086 #include <stdlib.h>
00087 #include <gandalf/common/misc_defs.h>
00088 #include <gandalf/image/image_defs.h>
00089
00095 #ifdef __cplusplus
00096 extern "C" {
00097 #endif
00098
00099
00100
00108 struct Gan_Image *gan_image_set_gen_p ( Gan_Image *img,
00109 unsigned long height,
00110 unsigned long width,
00111 unsigned long stride,
00112 Gan_Bool alloc_pix_data );
00124 struct Gan_Image *gan_image_form_gen_p (
00125 Gan_Image *img,
00126 unsigned long height,
00127 unsigned long width,
00128 unsigned long stride,
00129 Gan_Bool alloc_pix_data,
00130 void * *pix_data, size_t pix_data_size,
00131 void * **row_data, size_t row_data_size );
00132
00151 Gan_Bool gan_image_get_active_subwindow_p ( const Gan_Image *image,
00152 Gan_ImageWindow *subwin );
00156 #ifndef NDEBUG
00157
00168 void * *gan_image_get_pixptr_p ( const Gan_Image *img,
00169 unsigned row, unsigned col );
00170
00177 void * **gan_image_get_pixarr_p ( const Gan_Image *img );
00178
00182 #endif
00183
00193 Gan_Bool gan_image_mask_window_p ( Gan_Image *pImage,
00194 unsigned r0, unsigned c0,
00195 unsigned height, unsigned width );
00196
00201 Gan_Bool gan_image_clear_window_p ( Gan_Image *pImage,
00202 unsigned r0, unsigned c0,
00203 unsigned height, unsigned width );
00208 #if defined(GAN_IMAGE_GET_MINIMUM_PIXEL) && !defined(GAN_BITMAP)
00209
00213 Gan_Bool GAN_IMAGE_GET_MINIMUM_PIXEL ( const Gan_Image *pImage,
00214 const Gan_Image *pMask,
00215 void * *minval );
00216 Gan_Bool GAN_IMAGE_GET_MAXIMUM_PIXEL ( const Gan_Image *pImage,
00217 const Gan_Image *pMask,
00218 void * *maxval );
00222 #endif
00223
00224 #ifdef __cplusplus
00225 }
00226 #endif
00227
00228
00229
00244 Gan_Image *gan_image_alloc_p ( unsigned long height, unsigned long width );
00245
00256 Gan_Image *gan_image_form_p ( Gan_Image *img,
00257 unsigned long height,
00258 unsigned long width );
00259
00276 Gan_Image *gan_image_alloc_data_p ( unsigned long height,
00277 unsigned long width,
00278 unsigned long stride,
00279 void * *pix_data, size_t pix_data_size,
00280 void * **row_data, size_t row_data_size );
00281
00299 Gan_Image *gan_image_form_data_p ( Gan_Image *img,
00300 unsigned long height,
00301 unsigned long width,
00302 unsigned long stride,
00303 void * *pix_data, size_t pix_data_size,
00304 void * **row_data, size_t row_data_size );
00305
00325 Gan_Image *gan_image_set_p ( Gan_Image *img,
00326 unsigned long height, unsigned long width );
00327
00344 Gan_Bool gan_image_set_pix_p ( Gan_Image *img,
00345 unsigned row, unsigned col, void * pix );
00346
00353 void * gan_image_get_pix_p ( const Gan_Image *img,
00354 unsigned row, unsigned col );
00355
00371 Gan_Bool gan_image_fill_const_p ( Gan_Image *img, void * pix );
00372
00378 #undef GAN_PIXEL
00379 #undef GAN_PIXEL_FORMAT
00380 #undef GAN_PIXEL_TYPE
00381 #undef GAN_IMTYPE
00382 #undef GAN_IMAGE_FORM_GEN
00383 #undef GAN_IMAGE_SET_GEN
00384 #undef GAN_IMAGE_ALLOC
00385 #undef GAN_IMAGE_ALLOC_DATA
00386 #undef GAN_IMAGE_FORM
00387 #undef GAN_IMAGE_FORM_DATA
00388 #undef GAN_IMAGE_SET
00389 #undef GAN_IMAGE_SET_PIX
00390 #undef GAN_IMAGE_GET_PIX
00391 #undef GAN_IMAGE_GET_PIXPTR
00392 #undef GAN_IMAGE_GET_PIXARR
00393 #undef GAN_IMAGE_FILL_CONST
00394 #undef GAN_IMAGE_GET_ACTIVE_SUBWINDOW
00395 #undef GAN_IMAGE_MASK_WINDOW
00396 #undef GAN_IMAGE_CLEAR_WINDOW
00397 #undef GAN_IMAGE_GET_MINIMUM_PIXEL
00398 #undef GAN_IMAGE_GET_MAXIMUM_PIXEL
00399 #undef GAN_IMAGE_PIXEL_MIN_VAL
00400 #undef GAN_IMAGE_PIXEL_MAX_VAL
00401 #undef GAN_IMAGE_PIXEL_ZERO_VAL
00402 #undef GAN_BITMAP
00403
00409 #ifdef __cplusplus
00410 extern "C" {
00411 #endif
00412
00413 #ifdef __cplusplus
00414 }
00415 #endif
00416
00417 #endif