1 module allegro5.bitmap; 2 3 import allegro5.color; 4 import allegro5.internal.da5; 5 6 nothrow @nogc extern (C) 7 { 8 struct ALLEGRO_BITMAP {}; 9 10 /* 11 * Bitmap flags 12 */ 13 enum 14 { 15 ALLEGRO_MEMORY_BITMAP = 0x0001, 16 _ALLEGRO_KEEP_BITMAP_FORMAT = 0x0002, /* now a bitmap loader flag */ 17 ALLEGRO_FORCE_LOCKING = 0x0004, 18 ALLEGRO_NO_PRESERVE_TEXTURE = 0x0008, 19 _ALLEGRO_ALPHA_TEST = 0x0010, /* now a render state flag */ 20 _ALLEGRO_INTERNAL_OPENGL = 0x0020, 21 ALLEGRO_MIN_LINEAR = 0x0040, 22 ALLEGRO_MAG_LINEAR = 0x0080, 23 ALLEGRO_MIPMAP = 0x0100, 24 _ALLEGRO_NO_PREMULTIPLIED_ALPHA = 0x0200, /* now a bitmap loader flag */ 25 ALLEGRO_VIDEO_BITMAP = 0x0400, 26 ALLEGRO_CONVERT_BITMAP = 0x1000 27 } 28 29 void al_set_new_bitmap_format(int format); 30 void al_set_new_bitmap_flags(int flags); 31 int al_get_new_bitmap_format(); 32 int al_get_new_bitmap_flags(); 33 void al_add_new_bitmap_flag(int flag); 34 35 int al_get_bitmap_width(ALLEGRO_BITMAP* bitmap); 36 int al_get_bitmap_height(ALLEGRO_BITMAP* bitmap); 37 int al_get_bitmap_format(ALLEGRO_BITMAP* bitmap); 38 int al_get_bitmap_flags(ALLEGRO_BITMAP* bitmap); 39 40 ALLEGRO_BITMAP* al_create_bitmap(int w, int h); 41 void al_destroy_bitmap(ALLEGRO_BITMAP* bitmap); 42 43 void al_put_pixel(int x, int y, ALLEGRO_COLOR color); 44 void al_put_blended_pixel(int x, int y, ALLEGRO_COLOR color); 45 46 /* Masking */ 47 void al_convert_mask_to_alpha(ALLEGRO_BITMAP* bitmap, ALLEGRO_COLOR mask_color); 48 49 /* Clipping */ 50 void al_set_clipping_rectangle(int x, int y, int width, int height); 51 void al_reset_clipping_rectangle(); 52 void al_get_clipping_rectangle(int* x, int* y, int* w, int* h); 53 54 /* Sub bitmaps */ 55 ALLEGRO_BITMAP* al_create_sub_bitmap(ALLEGRO_BITMAP* parent, int x, int y, int w, int h); 56 bool al_is_sub_bitmap(ALLEGRO_BITMAP* bitmap); 57 ALLEGRO_BITMAP* al_get_parent_bitmap(ALLEGRO_BITMAP* bitmap); 58 int al_get_bitmap_x(ALLEGRO_BITMAP *bitmap); 59 int al_get_bitmap_y(ALLEGRO_BITMAP *bitmap); 60 void al_reparent_bitmap(ALLEGRO_BITMAP *bitmap, 61 ALLEGRO_BITMAP *parent, int x, int y, int w, int h); 62 63 /* Miscellaneous */ 64 ALLEGRO_BITMAP* al_clone_bitmap(ALLEGRO_BITMAP* bitmap); 65 void al_convert_bitmap(ALLEGRO_BITMAP* bitmap); 66 void al_convert_memory_bitmaps(); 67 } 68 69 static import allegro5.color_ret; 70 71 mixin(ColorWrapper("allegro5.color_ret.", "al_get_pixel", "ALLEGRO_BITMAP* bitmap, int x, int y", "bitmap, x, y"));