00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00031 #ifndef __MLV_IMAGE_H__
00032 #define __MLV_IMAGE_H__
00033
00034 #include "MLV_color.h"
00035
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039
00043 typedef struct _MLV_Image MLV_Image;
00044
00066 MLV_Image* MLV_load_image( const char* file_image );
00067
00068
00078 int MLV_save_image_as_bmp( const MLV_Image* image, const char* file_image );
00079
00087 MLV_Image* MLV_create_image( int width, int height );
00088
00094 void MLV_free_image( MLV_Image *image );
00095
00106 MLV_Image* MLV_copy_image( MLV_Image* image );
00107
00122 MLV_Image* MLV_copy_partial_image(
00123 MLV_Image* image, int x, int y, int width, int height
00124 );
00125
00133 void MLV_get_image_size( MLV_Image* image, int* width, int* height );
00134
00141 int MLV_get_image_width( MLV_Image* image );
00142
00149 int MLV_get_image_height( MLV_Image* image );
00150
00151
00163 void MLV_resize_image( MLV_Image* image, int width, int height );
00164
00170 void MLV_vertical_image_mirror( MLV_Image* image );
00171
00177 void MLV_horizontal_image_mirror( MLV_Image* image );
00178
00196 void MLV_resize_image_with_proportions(
00197 MLV_Image* image, int width, int height
00198 );
00199
00207 void MLV_scale_image( MLV_Image* image, double scalar );
00208
00215 void MLV_rotate_image( MLV_Image* image, double rotation );
00216
00224 void MLV_rotate_and_scale_image( MLV_Image* image, double rotation, double scalar );
00225
00234 void MLV_scale_xy_image( MLV_Image* image, double scalar_x, double scalar_y );
00235
00247 void MLV_rotate_and_scale_xy_image(
00248 MLV_Image* image, double rotation, double scalar_x, double scalar_y
00249 );
00250
00260 void MLV_draw_image( MLV_Image *image, int x, int y );
00261
00279 void MLV_draw_partial_image(
00280 MLV_Image *image, int x_source, int y_source,
00281 int width_source, int height_source,
00282 int x, int y
00283 );
00284
00285
00305 void MLV_set_alpha_on_image( MLV_Alpha alpha, MLV_Image *image );
00306
00317 void MLV_set_pixel_on_image(
00318 int x, int y,
00319 MLV_Color color,
00320 MLV_Image *image
00321 );
00322
00336 void MLV_get_pixel(
00337 int x, int y, int* red, int* green, int* blue, int* alpha
00338 );
00339
00355 void MLV_get_pixel_on_image(
00356 MLV_Image* image, int x, int y,
00357 int* red, int* green, int* blue, int* alpha
00358 );
00359
00378 void MLV_draw_partial_image_on_image(
00379 const MLV_Image* source_image,
00380 int source_x, int source_y,
00381 int width, int height,
00382 const MLV_Image* destination_image,
00383 int destination_x, int destination_y
00384 );
00385
00398 void MLV_draw_image_on_image(
00399 const MLV_Image* source_image,
00400 const MLV_Image* destination_image,
00401 int destination_x, int destination_y
00402 );
00403
00459 SDL_Surface* MLV_get_image_data( MLV_Image* image );
00460
00461
00462 #if 0
00463
00467 typedef enum {
00468 MLV_NONE,
00469 MLV_REPLACE,
00470 MLV_MAX,
00471 MLV_MIN,
00472 MLV_BARYCENTER
00473 } MLV_Mathematic_operations;
00474
00475
00519 void MLV_draw_partial_image_on_image(
00520 const MLV_Image* source_image,
00521 int source_x, int source_y,
00522 int with, int height,
00523 const MLV_Image* destination_image,
00524 int destination_x, int destination_y,
00525 MLV_Mathematic_operations rgb_treatment,
00526 MLV_Mathematic_operations alpha_treatment
00527 );
00528
00564 void MLV_draw_partial_image_on_image_FAST(
00565 const MLV_Image* source_image,
00566 int source_x, int source_y,
00567 int with, int height,
00568 const MLV_Image* destination_image,
00569 int destination_x, int destination_y
00570 );
00571 #endif
00572
00573
00574
00575
00576
00577
00578
00579 #ifdef __cplusplus
00580 }
00581 #endif
00582
00583 #endif