00001
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _GAN_IMAGE_DEFS_H
00030 #define _GAN_IMAGE_DEFS_H
00031
00032 #include <stdlib.h>
00033 #include <gandalf/image/pixel.h>
00034 #include <gandalf/common/misc_defs.h>
00035
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039
00045
00046 typedef struct Gan_Image
00047 {
00049 Gan_ImageFormat format;
00050
00052 Gan_Type type;
00053
00055 unsigned long height, width;
00056
00059 unsigned long stride;
00060
00063 unsigned char *pix_data_ptr;
00064
00066 size_t pix_data_size;
00067
00069 Gan_Bool pix_data_alloc;
00070
00072 union
00073 {
00075 union
00076 {
00077 unsigned char **uc;
00078 short **s;
00079 unsigned short **us;
00080 int **i;
00081 unsigned int **ui;
00082 float **f;
00083 double **d;
00084 Gan_BitWord **b;
00085 void ***p;
00086 Gan_YXPixel_ui10 **ui10;
00087 Gan_YXPixel_ui12 **ui12;
00088 } gl;
00089
00091 union
00092 {
00093 Gan_GLAPixel_uc **uc;
00094 Gan_GLAPixel_s **s;
00095 Gan_GLAPixel_us **us;
00096 Gan_GLAPixel_i **i;
00097 Gan_GLAPixel_ui **ui;
00098 Gan_GLAPixel_f **f;
00099 Gan_GLAPixel_d **d;
00100 } gla;
00101
00103 union
00104 {
00105 Gan_RGBPixel_uc **uc;
00106 Gan_RGBPixel_s **s;
00107 Gan_RGBPixel_us **us;
00108 Gan_RGBPixel_i **i;
00109 Gan_RGBPixel_ui **ui;
00110 Gan_RGBPixel_f **f;
00111 Gan_RGBPixel_d **d;
00112 } rgb;
00113
00115 union
00116 {
00117 Gan_RGBAPixel_uc **uc;
00118 Gan_RGBAPixel_s **s;
00119 Gan_RGBAPixel_us **us;
00120 Gan_RGBAPixel_i **i;
00121 Gan_RGBAPixel_ui **ui;
00122 Gan_RGBAPixel_f **f;
00123 Gan_RGBAPixel_d **d;
00124 Gan_RGBAPixel_ui12 **ui12;
00125 } rgba;
00126
00128 union
00129 {
00130 Gan_Vector2_f **f;
00131 Gan_Vector2 **d;
00132 Gan_Vector2_s **s;
00133 Gan_Vector2_i **i;
00134 } vfield2D;
00135
00137 union
00138 {
00139 Gan_Vector3_f **f;
00140 Gan_Vector3 **d;
00141 Gan_Vector3_s **s;
00142 Gan_Vector3_i **i;
00143 } vfield3D;
00144
00146 union
00147 {
00148 Gan_RGBXPixel_ui8 **ui8;
00149 Gan_RGBXPixel_ui10 **ui10;
00150 } rgbx;
00151
00153 union
00154 {
00155 Gan_RGBASPixel_ui10 **ui10;
00156 } rgbas;
00157
00159 union
00160 {
00161 Gan_YUVX444Pixel_ui8 **ui8;
00162 } yuvx444;
00163
00165 union
00166 {
00167 Gan_YUVA444Pixel_ui8 **ui8;
00168 } yuva444;
00169
00171 union
00172 {
00173 Gan_YUV422Pixel_ui8 **ui8;
00174 } yuv422;
00175 } row_data;
00176
00178 void *row_data_ptr;
00179
00181 size_t row_data_size;
00182
00184 Gan_BitArray *ba;
00185
00187 Gan_Bool ba_alloc;
00188
00190 int offset_x, offset_y;
00191
00193 Gan_Bool row_data_alloc;
00194
00196 Gan_Bool struct_alloc;
00197
00199 void (*data_free_func) (void *);
00200
00202 void (*free_func) ( struct Gan_Image *img );
00203
00204 #ifndef NDEBUG
00205
00207 union
00208 {
00210 union
00211 {
00212 Gan_Bool (*uc) ( struct Gan_Image *, unsigned row, unsigned col, unsigned char pix );
00213 Gan_Bool (*s) ( struct Gan_Image *, unsigned row, unsigned col, short pix );
00214 Gan_Bool (*us) ( struct Gan_Image *, unsigned row, unsigned col, unsigned short pix );
00215 Gan_Bool (*i) ( struct Gan_Image *, unsigned row, unsigned col, int pix );
00216 Gan_Bool (*ui) ( struct Gan_Image *, unsigned row, unsigned col, unsigned int pix );
00217 Gan_Bool (*f) ( struct Gan_Image *, unsigned row, unsigned col, float pix );
00218 Gan_Bool (*d) ( struct Gan_Image *, unsigned row, unsigned col, double pix );
00219 Gan_Bool (*b) ( struct Gan_Image *, unsigned row, unsigned col, Gan_Bool pix );
00220 Gan_Bool (*p) ( struct Gan_Image *, unsigned row, unsigned col, void *pix );
00221 Gan_Bool (*ui10) ( struct Gan_Image *, unsigned row, unsigned col, Gan_YXPixel_ui10 *pix );
00222 Gan_Bool (*ui12) ( struct Gan_Image *, unsigned row, unsigned col, Gan_YXPixel_ui12 *pix );
00223 } gl;
00224
00226 union
00227 {
00228 Gan_Bool (*uc) ( struct Gan_Image *, unsigned row, unsigned col, Gan_GLAPixel_uc *pix );
00229 Gan_Bool (*s) ( struct Gan_Image *, unsigned row, unsigned col, Gan_GLAPixel_s *pix );
00230 Gan_Bool (*us) ( struct Gan_Image *, unsigned row, unsigned col, Gan_GLAPixel_us *pix );
00231 Gan_Bool (*i) ( struct Gan_Image *, unsigned row, unsigned col, Gan_GLAPixel_i *pix );
00232 Gan_Bool (*ui) ( struct Gan_Image *, unsigned row, unsigned col, Gan_GLAPixel_ui *pix );
00233 Gan_Bool (*f) ( struct Gan_Image *, unsigned row, unsigned col, Gan_GLAPixel_f *pix );
00234 Gan_Bool (*d) ( struct Gan_Image *, unsigned row, unsigned col, Gan_GLAPixel_d *pix );
00235 } gla;
00236
00238 union
00239 {
00240 Gan_Bool (*uc) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBPixel_uc *pix );
00241 Gan_Bool (*s) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBPixel_s *pix );
00242 Gan_Bool (*us) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBPixel_us *pix );
00243 Gan_Bool (*i) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBPixel_i *pix );
00244 Gan_Bool (*ui) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBPixel_ui *pix );
00245 Gan_Bool (*d) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBPixel_d *pix );
00246 Gan_Bool (*f) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBPixel_f *pix );
00247 } rgb;
00248
00250 union
00251 {
00252 Gan_Bool (*uc) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBAPixel_uc *pix );
00253 Gan_Bool (*s) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBAPixel_s *pix );
00254 Gan_Bool (*us) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBAPixel_us *pix );
00255 Gan_Bool (*i) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBAPixel_i *pix );
00256 Gan_Bool (*ui) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBAPixel_ui *pix );
00257 Gan_Bool (*d) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBAPixel_d *pix );
00258 Gan_Bool (*f) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBAPixel_f *pix );
00259 Gan_Bool (*ui12) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBAPixel_ui12 *pix );
00260 } rgba;
00261
00263 union
00264 {
00265 Gan_Bool (*f) ( struct Gan_Image *, unsigned row, unsigned col, Gan_Vector2_f *pix );
00266 Gan_Bool (*d) ( struct Gan_Image *, unsigned row, unsigned col, Gan_Vector2 *pix );
00267 Gan_Bool (*s) ( struct Gan_Image *, unsigned row, unsigned col, Gan_Vector2_s *pix );
00268 Gan_Bool (*i) ( struct Gan_Image *, unsigned row, unsigned col, Gan_Vector2_i *pix );
00269 } vfield2D;
00270
00272 union
00273 {
00274 Gan_Bool (*f) ( struct Gan_Image *, unsigned row, unsigned col, Gan_Vector3_f *pix );
00275 Gan_Bool (*d) ( struct Gan_Image *, unsigned row, unsigned col, Gan_Vector3 *pix );
00276 Gan_Bool (*s) ( struct Gan_Image *, unsigned row, unsigned col, Gan_Vector3_s *pix );
00277 Gan_Bool (*i) ( struct Gan_Image *, unsigned row, unsigned col, Gan_Vector3_i *pix );
00278 } vfield3D;
00279
00281 union
00282 {
00283 Gan_Bool (*ui8) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBXPixel_ui8 *pix );
00284 Gan_Bool (*ui10) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBXPixel_ui10 *pix );
00285 } rgbx;
00286
00288 union
00289 {
00290 Gan_Bool (*ui10) ( struct Gan_Image *, unsigned row, unsigned col, Gan_RGBASPixel_ui10 *pix );
00291 } rgbas;
00292
00294 union
00295 {
00296 Gan_Bool (*ui8) ( struct Gan_Image *, unsigned row, unsigned col, Gan_YUVX444Pixel_ui8 *pix );
00297 } yuvx444;
00298
00300 union
00301 {
00302 Gan_Bool (*ui8) ( struct Gan_Image *, unsigned row, unsigned col, Gan_YUVA444Pixel_ui8 *pix );
00303 } yuva444;
00304
00306 union
00307 {
00308 Gan_Bool (*ui8) ( struct Gan_Image *, unsigned row, unsigned col, Gan_YUV422Pixel_ui8 *pix );
00309 } yuv422;
00310 } set_pix;
00311
00313 union
00314 {
00316 union
00317 {
00318 unsigned char (*uc) (const struct Gan_Image *, unsigned row, unsigned col);
00319 short (*s) (const struct Gan_Image *, unsigned row, unsigned col);
00320 unsigned short (*us) (const struct Gan_Image *, unsigned row, unsigned col);
00321 int (*i) (const struct Gan_Image *, unsigned row, unsigned col);
00322 unsigned int (*ui) (const struct Gan_Image *, unsigned row, unsigned col);
00323 float (*f) (const struct Gan_Image *, unsigned row, unsigned col);
00324 double (*d) (const struct Gan_Image *, unsigned row, unsigned col);
00325 Gan_Bool (*b) (const struct Gan_Image *, unsigned row, unsigned col);
00326 void * (*p) (const struct Gan_Image *, unsigned row, unsigned col);
00327 Gan_YXPixel_ui10 (*ui10) ( const struct Gan_Image *, unsigned row, unsigned col );
00328 Gan_YXPixel_ui12 (*ui12) ( const struct Gan_Image *, unsigned row, unsigned col );
00329 } gl;
00330
00332 union
00333 {
00334 Gan_GLAPixel_uc (*uc) ( const struct Gan_Image *, unsigned row, unsigned col );
00335 Gan_GLAPixel_s (*s) ( const struct Gan_Image *, unsigned row, unsigned col );
00336 Gan_GLAPixel_us (*us) ( const struct Gan_Image *, unsigned row, unsigned col );
00337 Gan_GLAPixel_i (*i) ( const struct Gan_Image *, unsigned row, unsigned col );
00338 Gan_GLAPixel_ui (*ui) ( const struct Gan_Image *, unsigned row, unsigned col );
00339 Gan_GLAPixel_f (*f) ( const struct Gan_Image *, unsigned row, unsigned col );
00340 Gan_GLAPixel_d (*d) ( const struct Gan_Image *, unsigned row, unsigned col );
00341 } gla;
00342
00344 union
00345 {
00346 Gan_RGBPixel_uc (*uc) ( const struct Gan_Image *, unsigned row, unsigned col );
00347 Gan_RGBPixel_s (*s) ( const struct Gan_Image *, unsigned row, unsigned col );
00348 Gan_RGBPixel_us (*us) ( const struct Gan_Image *, unsigned row, unsigned col );
00349 Gan_RGBPixel_i (*i) ( const struct Gan_Image *, unsigned row, unsigned col );
00350 Gan_RGBPixel_ui (*ui) ( const struct Gan_Image *, unsigned row, unsigned col );
00351 Gan_RGBPixel_f (*f) ( const struct Gan_Image *, unsigned row, unsigned col );
00352 Gan_RGBPixel_d (*d) ( const struct Gan_Image *, unsigned row, unsigned col );
00353 } rgb;
00354
00356 union
00357 {
00358 Gan_RGBAPixel_uc (*uc) ( const struct Gan_Image *, unsigned row, unsigned col );
00359 Gan_RGBAPixel_s (*s) ( const struct Gan_Image *, unsigned row, unsigned col );
00360 Gan_RGBAPixel_us (*us) ( const struct Gan_Image *, unsigned row, unsigned col );
00361 Gan_RGBAPixel_i (*i) ( const struct Gan_Image *, unsigned row, unsigned col );
00362 Gan_RGBAPixel_ui (*ui) ( const struct Gan_Image *, unsigned row, unsigned col );
00363 Gan_RGBAPixel_f (*f) ( const struct Gan_Image *, unsigned row, unsigned col );
00364 Gan_RGBAPixel_d (*d) ( const struct Gan_Image *, unsigned row, unsigned col );
00365 Gan_RGBAPixel_ui12 (*ui12) ( const struct Gan_Image *, unsigned row, unsigned col );
00366 } rgba;
00367
00369 union
00370 {
00371 Gan_Vector2_f (*f) ( const struct Gan_Image *, unsigned row, unsigned col );
00372 Gan_Vector2 (*d) ( const struct Gan_Image *, unsigned row, unsigned col );
00373 Gan_Vector2_s (*s) ( const struct Gan_Image *, unsigned row, unsigned col );
00374 Gan_Vector2_i (*i) ( const struct Gan_Image *, unsigned row, unsigned col );
00375 } vfield2D;
00376
00378 union
00379 {
00380 Gan_Vector3_f (*f) ( const struct Gan_Image *, unsigned row, unsigned col );
00381 Gan_Vector3 (*d) ( const struct Gan_Image *, unsigned row, unsigned col );
00382 Gan_Vector3_s (*s) ( const struct Gan_Image *, unsigned row, unsigned col );
00383 Gan_Vector3_i (*i) ( const struct Gan_Image *, unsigned row, unsigned col );
00384 } vfield3D;
00385
00387 union
00388 {
00389 Gan_RGBXPixel_ui8 (*ui8) ( const struct Gan_Image *, unsigned row, unsigned col );
00390 Gan_RGBXPixel_ui10 (*ui10) ( const struct Gan_Image *, unsigned row, unsigned col );
00391 } rgbx;
00392
00394 union
00395 {
00396 Gan_RGBASPixel_ui10 (*ui10) ( const struct Gan_Image *, unsigned row, unsigned col );
00397 } rgbas;
00398
00400 union
00401 {
00402 Gan_YUVX444Pixel_ui8 (*ui8) ( const struct Gan_Image *, unsigned row, unsigned col );
00403 } yuvx444;
00404
00406 union
00407 {
00408 Gan_YUVA444Pixel_ui8 (*ui8) ( const struct Gan_Image *, unsigned row, unsigned col );
00409 } yuva444;
00410
00412 union
00413 {
00414 Gan_YUV422Pixel_ui8 (*ui8) ( const struct Gan_Image *, unsigned row, unsigned col );
00415 } yuv422;
00416 } get_pix;
00417
00418 #endif
00419
00421 union
00422 {
00424 union
00425 {
00426 Gan_Bool (*uc) ( struct Gan_Image *, unsigned char pix );
00427 Gan_Bool (*s) ( struct Gan_Image *, short pix );
00428 Gan_Bool (*us) ( struct Gan_Image *, unsigned short pix );
00429 Gan_Bool (*i) ( struct Gan_Image *, int pix );
00430 Gan_Bool (*ui) ( struct Gan_Image *, unsigned int pix );
00431 Gan_Bool (*f) ( struct Gan_Image *, float pix );
00432 Gan_Bool (*d) ( struct Gan_Image *, double pix );
00433 Gan_Bool (*b) ( struct Gan_Image *, Gan_Bool pix );
00434 Gan_Bool (*p) ( struct Gan_Image *, void * pix );
00435 Gan_Bool (*ui10) ( struct Gan_Image *, Gan_YXPixel_ui10 *pix );
00436 Gan_Bool (*ui12) ( struct Gan_Image *, Gan_YXPixel_ui12 *pix );
00437 } gl;
00438
00440 union
00441 {
00442 Gan_Bool (*uc) ( struct Gan_Image *, Gan_GLAPixel_uc *pix );
00443 Gan_Bool (*s) ( struct Gan_Image *, Gan_GLAPixel_s *pix );
00444 Gan_Bool (*us) ( struct Gan_Image *, Gan_GLAPixel_us *pix );
00445 Gan_Bool (*i) ( struct Gan_Image *, Gan_GLAPixel_i *pix );
00446 Gan_Bool (*ui) ( struct Gan_Image *, Gan_GLAPixel_ui *pix );
00447 Gan_Bool (*f) ( struct Gan_Image *, Gan_GLAPixel_f *pix );
00448 Gan_Bool (*d) ( struct Gan_Image *, Gan_GLAPixel_d *pix );
00449 } gla;
00450
00452 union
00453 {
00454 Gan_Bool (*uc) ( struct Gan_Image *, Gan_RGBPixel_uc *pix );
00455 Gan_Bool (*s) ( struct Gan_Image *, Gan_RGBPixel_s *pix );
00456 Gan_Bool (*us) ( struct Gan_Image *, Gan_RGBPixel_us *pix );
00457 Gan_Bool (*i) ( struct Gan_Image *, Gan_RGBPixel_i *pix );
00458 Gan_Bool (*ui) ( struct Gan_Image *, Gan_RGBPixel_ui *pix );
00459 Gan_Bool (*f) ( struct Gan_Image *, Gan_RGBPixel_f *pix );
00460 Gan_Bool (*d) ( struct Gan_Image *, Gan_RGBPixel_d *pix );
00461 } rgb;
00462
00464 union
00465 {
00466 Gan_Bool (*uc) ( struct Gan_Image *, Gan_RGBAPixel_uc *pix );
00467 Gan_Bool (*s) ( struct Gan_Image *, Gan_RGBAPixel_s *pix );
00468 Gan_Bool (*us) ( struct Gan_Image *, Gan_RGBAPixel_us *pix );
00469 Gan_Bool (*i) ( struct Gan_Image *, Gan_RGBAPixel_i *pix );
00470 Gan_Bool (*ui) ( struct Gan_Image *, Gan_RGBAPixel_ui *pix );
00471 Gan_Bool (*f) ( struct Gan_Image *, Gan_RGBAPixel_f *pix );
00472 Gan_Bool (*d) ( struct Gan_Image *, Gan_RGBAPixel_d *pix );
00473 Gan_Bool (*ui12) ( struct Gan_Image *, Gan_RGBAPixel_ui12 *pix );
00474 } rgba;
00475
00477 union
00478 {
00479 Gan_Bool (*f) ( struct Gan_Image *, Gan_Vector2_f *pix );
00480 Gan_Bool (*d) ( struct Gan_Image *, Gan_Vector2 *pix );
00481 Gan_Bool (*s) ( struct Gan_Image *, Gan_Vector2_s *pix );
00482 Gan_Bool (*i) ( struct Gan_Image *, Gan_Vector2_i *pix );
00483 } vfield2D;
00484
00486 union
00487 {
00488 Gan_Bool (*f) ( struct Gan_Image *, Gan_Vector3_f *pix );
00489 Gan_Bool (*d) ( struct Gan_Image *, Gan_Vector3 *pix );
00490 Gan_Bool (*s) ( struct Gan_Image *, Gan_Vector3_s *pix );
00491 Gan_Bool (*i) ( struct Gan_Image *, Gan_Vector3_i *pix );
00492 } vfield3D;
00493
00495 union
00496 {
00497 Gan_Bool (*ui8) ( struct Gan_Image *, Gan_RGBXPixel_ui8 *pix );
00498 Gan_Bool (*ui10) ( struct Gan_Image *, Gan_RGBXPixel_ui10 *pix );
00499 } rgbx;
00500
00502 union
00503 {
00504 Gan_Bool (*ui10) ( struct Gan_Image *, Gan_RGBASPixel_ui10 *pix );
00505 } rgbas;
00506
00508 union
00509 {
00510 Gan_Bool (*ui8) ( struct Gan_Image *, Gan_YUVX444Pixel_ui8 *pix );
00511 } yuvx444;
00512
00514 union
00515 {
00516 Gan_Bool (*ui8) ( struct Gan_Image *, Gan_YUVA444Pixel_ui8 *pix );
00517 } yuva444;
00518
00520 union
00521 {
00522 Gan_Bool (*ui8) ( struct Gan_Image *, Gan_YUV422Pixel_ui8 *pix );
00523 } yuv422;
00524 } fill_const;
00525
00527 struct Gan_Image * (*copy) ( const struct Gan_Image *, struct Gan_Image * );
00528 } Gan_Image;
00529
00530 #define GAN_IMAGE_STRUCT_DEFINED
00531
00533 typedef struct Gan_ImageWindow
00534 {
00536 int c0, r0;
00537
00539 int width, height;
00540 } Gan_ImageWindow;
00541
00559 Gan_Image *gan_image_alloc ( Gan_ImageFormat format, Gan_Type type,
00560 unsigned long height, unsigned long width );
00561
00576 Gan_Image *gan_image_form ( Gan_Image *img,
00577 Gan_ImageFormat format, Gan_Type type,
00578 unsigned long height, unsigned long width );
00579
00601 Gan_Image *gan_image_alloc_data ( Gan_ImageFormat format, Gan_Type type,
00602 unsigned long height, unsigned long width,
00603 void *pix_data, size_t pix_data_size,
00604 void *row_data, size_t row_data_size );
00605
00626 Gan_Image *gan_image_form_data ( Gan_Image *img,
00627 Gan_ImageFormat format, Gan_Type type,
00628 unsigned long height, unsigned long width,
00629 void *pix_data, size_t pix_data_size,
00630 void *row_data, size_t row_data_size );
00631
00637 void gan_image_free ( Gan_Image *img );
00638
00654 Gan_Image *gan_image_copy_q ( const Gan_Image *img_s, Gan_Image *img_d );
00655
00662 Gan_Image *gan_image_copy_s ( const Gan_Image *img );
00663
00681 Gan_Image *gan_image_set_format_type_dims ( Gan_Image *img,
00682 Gan_ImageFormat format,
00683 Gan_Type type,
00684 unsigned long height,
00685 unsigned long width );
00686
00695 Gan_Image *gan_image_set_format_type ( Gan_Image *img,
00696 Gan_ImageFormat format,
00697 Gan_Type type );
00698
00707 Gan_Image *gan_image_set_type ( Gan_Image *img, Gan_Type type );
00708
00717 Gan_Image *gan_image_set_dims ( Gan_Image *img, unsigned long height, unsigned long width );
00718
00734 Gan_Bool gan_image_test_format ( const Gan_Image *img, Gan_ImageFormat format );
00735
00742 Gan_Bool gan_image_test_type ( const Gan_Image *img, Gan_Type type );
00743
00750 Gan_Bool gan_image_test_dims ( const Gan_Image *img1, const Gan_Image *img2 );
00751
00765 Gan_Bool gan_image_fill_zero_window ( Gan_Image *img,
00766 unsigned r0, unsigned c0,
00767 unsigned height, unsigned width );
00768
00773 Gan_Bool gan_image_fill_zero_mask ( Gan_Image *img, Gan_Image *mask );
00774
00784 Gan_Image *gan_image_form_gen ( Gan_Image *img,
00785 Gan_ImageFormat format, Gan_Type type,
00786 unsigned long height, unsigned long width,
00787 unsigned long stride, Gan_Bool alloc_pix_data,
00788 void *pix_data, size_t pix_data_size,
00789 void *row_data, size_t row_data_size );
00790 Gan_Bool gan_image_set_data_free_func ( Gan_Image *img,
00791 void (*data_free_func)(void *) );
00792
00802 size_t gan_image_pixel_size ( Gan_ImageFormat format, Gan_Type type );
00803 size_t gan_image_min_stride ( Gan_ImageFormat format, Gan_Type type,
00804 unsigned long width, size_t alignment );
00805
00815 Gan_Bool gan_image_fill_const ( Gan_Image *img, Gan_Pixel *pixel );
00816 Gan_Bool gan_image_fill_zero ( Gan_Image *img );
00817 Gan_Bool gan_image_fill_const_window ( Gan_Image *img,
00818 unsigned r0, unsigned c0,
00819 unsigned height, unsigned width,
00820 Gan_Pixel *pixel );
00821 Gan_Bool gan_image_fill_const_mask ( Gan_Image *img, Gan_Image *mask, Gan_Pixel *pixel );
00822 Gan_Bool gan_merge_field_into_image(const Gan_Image *field, Gan_Bool flip, Gan_Bool upper, Gan_Bool whole_image, Gan_Image *image);
00823
00833 Gan_Pixel gan_image_get_pix ( const Gan_Image *img, unsigned row, unsigned col );
00834 void *gan_image_get_pixptr ( const Gan_Image *img, unsigned row, unsigned col );
00835 Gan_Bool gan_image_get_pix_zero ( const Gan_Image *img, unsigned row, unsigned col );
00836 Gan_Bool gan_image_set_pix ( Gan_Image *img, unsigned row, unsigned col, Gan_Pixel *pix );
00837 Gan_Bool gan_image_set_pix_zero ( Gan_Image *img, unsigned row, unsigned col );
00838
00848 Gan_Bool gan_image_get_active_subwindow ( const Gan_Image *image, Gan_ImageWindow *subwin );
00849
00850 void gan_image_intersect_subwindows_q ( const Gan_ImageWindow *window1, const Gan_ImageWindow *window2,
00851 Gan_ImageWindow *resultwindow );
00852 Gan_ImageWindow gan_image_intersect_subwindows_s ( const Gan_ImageWindow *window1, const Gan_ImageWindow *window2 );
00853 void gan_image_intersect_subwindows_i ( Gan_ImageWindow *sourcedestwindow, const Gan_ImageWindow *window );
00854 void gan_image_fit_subwindow ( Gan_ImageWindow *subwin, const Gan_Image *image );
00855
00865 Gan_Bool gan_image_mask_window ( Gan_Image *image,
00866 unsigned r0, unsigned c0,
00867 unsigned height, unsigned width );
00868 Gan_Bool gan_image_clear_window ( Gan_Image *image,
00869 unsigned r0, unsigned c0,
00870 unsigned height, unsigned width );
00871
00881 Gan_Bool gan_image_get_minimum_pixel ( Gan_Image *image, Gan_Image *mask, Gan_Pixel *minpix );
00882 Gan_Bool gan_image_get_maximum_pixel ( Gan_Image *image, Gan_Image *mask, Gan_Pixel *maxpix );
00883
00893 void gan_image_free_va ( Gan_Image *img, ... );
00894
00904 Gan_Bool gan_image_has_alpha_channel ( const Gan_Image *img );
00905
00915
00916 Gan_Image *gan_image_set_format_type_dims_gen ( Gan_Image *img,
00917 Gan_ImageFormat format,
00918 Gan_Type type,
00919 unsigned long height,
00920 unsigned long width,
00921 unsigned long stride,
00922 Gan_Bool alloc_pix_data );
00923
00932 #ifdef __cplusplus
00933 }
00934 #endif
00935
00936 #endif