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
00062 MLV_Image* MLV_load_image( const char* file_image );
00063
00064
00074 int MLV_save_image_as_bmp( const MLV_Image* image, const char* file_image );
00075
00083 MLV_Image* MLV_create_image( int width, int height );
00084
00090 void MLV_free_image( MLV_Image *image );
00091
00102 MLV_Image* MLV_copy_image( MLV_Image* image );
00103
00118 MLV_Image* MLV_copy_partial_image(
00119 MLV_Image* image, int x, int y, int width, int height
00120 );
00121
00129 void MLV_get_image_size( MLV_Image* image, int* width, int* height );
00130
00137 int MLV_get_image_width( MLV_Image* image );
00138
00145 int MLV_get_image_height( MLV_Image* image );
00146
00147
00159 void MLV_resize_image( MLV_Image* image, int width, int height );
00160
00166 void MLV_vertical_image_mirror( MLV_Image* image );
00167
00173 void MLV_horizontal_image_mirror( MLV_Image* image );
00174
00192 void MLV_resize_image_with_proportions(
00193 MLV_Image* image, int width, int height
00194 );
00195
00203 void MLV_scale_image( MLV_Image* image, double scalar );
00204
00211 void MLV_rotate_image( MLV_Image* image, double rotation );
00212
00220 void MLV_rotate_and_scale_image( MLV_Image* image, double rotation, double scalar );
00221
00230 void MLV_scale_xy_image( MLV_Image* image, double scalar_x, double scalar_y );
00231
00243 void MLV_rotate_and_scale_xy_image(
00244 MLV_Image* image, double rotation, double scalar_x, double scalar_y
00245 );
00246
00256 void MLV_draw_image( MLV_Image *image, int x, int y );
00257
00275 void MLV_draw_partial_image(
00276 MLV_Image *image, int x_source, int y_source,
00277 int width_source, int height_source,
00278 int x, int y
00279 );
00280
00281
00301 void MLV_set_alpha_on_image( MLV_Alpha alpha, MLV_Image *image );
00302
00313 void MLV_set_pixel_on_image(
00314 int x, int y,
00315 MLV_Color color,
00316 MLV_Image *image
00317 );
00318
00332 void MLV_get_pixel(
00333 int x, int y, int* red, int* green, int* blue, int* alpha
00334 );
00335
00351 void MLV_get_pixel_on_image(
00352 MLV_Image* image, int x, int y,
00353 int* red, int* green, int* blue, int* alpha
00354 );
00355
00374 void MLV_draw_partial_image_on_image(
00375 const MLV_Image* source_image,
00376 int source_x, int source_y,
00377 int width, int height,
00378 const MLV_Image* destination_image,
00379 int destination_x, int destination_y
00380 );
00381
00394 void MLV_draw_image_on_image(
00395 const MLV_Image* source_image,
00396 const MLV_Image* destination_image,
00397 int destination_x, int destination_y
00398 );
00399
00455 SDL_Surface* MLV_get_image_data( MLV_Image* image );
00456
00457
00458 #if 0
00459
00463 typedef enum {
00464 MLV_NONE,
00465 MLV_REPLACE,
00466 MLV_MAX,
00467 MLV_MIN,
00468 MLV_BARYCENTER
00469 } MLV_Mathematic_operations;
00470
00471
00515 void MLV_draw_partial_image_on_image(
00516 const MLV_Image* source_image,
00517 int source_x, int source_y,
00518 int with, int height,
00519 const MLV_Image* destination_image,
00520 int destination_x, int destination_y,
00521 MLV_Mathematic_operations rgb_treatment,
00522 MLV_Mathematic_operations alpha_treatment
00523 );
00524
00560 void MLV_draw_partial_image_on_image_FAST(
00561 const MLV_Image* source_image,
00562 int source_x, int source_y,
00563 int with, int height,
00564 const MLV_Image* destination_image,
00565 int destination_x, int destination_y
00566 );
00567 #endif
00568
00569
00570
00571
00572
00573
00574
00575 #ifdef __cplusplus
00576 }
00577 #endif
00578
00579 #endif