[[tags: allegro game]] == allegro This document pertains to bitmap related methods found in the Allegro egg. Please see the main [allegro] wiki page for more information. [[toc:]] == Enums === bitmap-flag (bitmap-flag->int bitmap-flag) {{bitmap-flag}} may be one of the following symbols: * memory-bitmap * keep-bitmap-format * force-locking * no-preserve-texture * alpha-test * min-linear * mag-linear * mipmap * no-premultiplied-alpha * video-bitmap (int->bitmap-flag integer) === blend-operation (blend-operation->int blend-operation) {{blend-operation}} may be one of the following symbols: * add * source-minus-destination * destination-minus-source (int->blend-operation integer) === blending-mode (blending-mode->int blending-mode) {{blending-mode}} may be one of the following symbols: * zero * one * alpha * inverse-alpha (int->blending-mode integer) === blitting-flag (blitting-flag->int blitting-flag) {{blitting-flag}} may be one of the following symbols: * flip-horizontal * flip-vertical (int->blitting-flag integer) === locking-flag (locking-flag->int locking-flag) {{locking-flag}} may be one of the following symbols: * read-write * read-only * write-only (int->locking-flag integer) === pixel-format (pixel-format->int pixel-format) {{pixel-format}} may be one of the following symbols: * any * any-no-alpha * any-with-alpha * any-15-no-alpha * any-16-no-alpha * any-16-with-alpha * any-24-no-alpha * any-32-no-alpha * any-32-with-alpha * argb-8888 * rgba-8888 * argb-4444 * rgb-888 * rgb-565 * rgb555 * rgba-5551 * argb-1555 * abgr-8888 * xbgr-8888 * bgr-888 * bgr-565 * bgr-555 * rgbx-8888 * xrgb-8888 * abgr-f32 * abgr-8888-le * rgba-4444 (int->pixel-format integer) == Records === bitmap bitmap === locked-region locked-region (free-locked-region! locked-region) (locked-region-data locked-region) (locked-region-format locked-region) (locked-region-pitch locked-region) (locked-region-pixel-size locked-region) == Functions === Bitmap (new-bitmap-format-set! pixel-format) Implements al_set_new_bitmap_format. (new-bitmap-format) Implements al_get_new_bitmap_flags. (new-bitmap-flags-set! bitmap-flag) Implements al_set_new_bitmap_flags. (new-bitmap-flags) Implements al_get_new_bitmap_flags. (new-bitmap-add-flag bitmap-flag) Implements al_add_new_bitmap_flag. (make-bitmap* (integer width) (integer height)) Implements al_create_bitmap. (make-bitmap (integer width) (integer height)) Implements al_create_bitmap, with (free-bitmap!) declared as a finalizer. (bitmap-draw bitmap (float dx) (float dy) bitmap-flag) Implements al_draw_bitmap. (draw-bitmap bitmap (float dx) (float dy) bitmap-flag) Implements al_draw_bitmap. (bitmap-draw-region bitmap (float sx) (float sy) (float sw) (float sh) (float dx) (float dy) (integer bitmap-flags)) Implements al_draw_bitmap_region. (draw-bitmap-region bitmap (float sx) (float sy) (float sw) (float sh) (float dx) (float dy) (integer bitmap-flags)) Implements al_draw_bitmap_region. (bitmap-draw-scaled bitmap (float sx) (float sy) (float sw) (float sh) (float dx) (float dy) (float dw) (float dh) (integer bitmap-flags)) Implements al_draw_scaled_bitmap. (draw-scaled-bitmap bitmap (float sx) (float sy) (float sw) (float sh) (float dx) (float dy) (float dw) (float dh) (integer bitmap-flags)) Implements al_draw_scaled_bitmap. (bitmap-draw-rotated bitmap (float cx) (float cy) (float dx) (float dy) (float angle) (integer bitmap-flags)) Implements al_draw_rotated_bitmap. (draw-rotated-bitmap bitmap (float cx) (float cy) (float dx) (float dy) (float angle) (integer bitmap-flags)) Implements al_draw_rotated_bitmap. (bitmap-draw-scaled-rotated bitmap (float cx) (float cy) (float dx) (float dy) (float xscale) (float yscale) (float angle) (integer bitmap-flags)) Implements al_draw_scaled_rotated_bitmap. (draw-scaled-rotated-bitmap bitmap (float cx) (float cy) (float dx) (float dy) (float xscale) (float yscale) (float angle) (integer bitmap-flags)) Implements al_draw_scaled_rotated_bitmap. (bitmap-draw-tinted (bitmap bmp) (color tint) (float dx) (float dy) (integer bitmap-flags)) Implements al_draw_tinted_bitmap. (draw-tinted-bitmap (bitmap bmp) (color tint) (float dx) (float dy) (integer bitmap-flags)) Implements al_draw_tinted_bitmap. (bitmap-draw-tinted-region (bitmap bmp) (color tint) (float sx) (float sy) (float sw) (float sh) (float dx) (float dy) (integer bitmap-flags)) Implements al_draw_tinted_bitmap_region. (draw-tinted-bitmap-region (bitmap bmp) (color tint) (float sx) (float sy) (float sw) (float sh) (float dx) (float dy) (integer bitmap-flags)) Implements al_draw_tinted_bitmap_region. (bitmap-draw-tinted-scaled (bitmap bmp) (color tint) (float sx) (float sy) (float sw) (float sh) (float dx) (float dy) (float dw) (float dh) (integer flags)) Implements al_draw_tinted_scale_bitmap. (draw-tinted-scaled-bitmap (bitmap bmp) (color tint) (float sx) (float sy) (float sw) (float sh) (float dx) (float dy) (float dw) (float dh) (integer flags)) Implements al_draw_tinted_scale_bitmap. (bitmap-draw-tinted-rotated (bitmap bmp) (color tint) (float cx) (float cy) (float dx) (float dy) (float angle) (integer flags)) Implements al_draw_tinted_rotated_bitmap. (draw-tinted-rotated-bitmap (bitmap bmp) (color tint) (float cx) (float cy) (float dx) (float dy) (float angle) (integer flags)) Implements al_draw_tinted_rotated_bitmap. (bitmap-draw-tinted-scaled-rotated (bitmap bmp) (color tint) (float cx) (float cy) (float dx) (float dy) (float xscale) (float yscale) (float angle) (integer flags)) Implements al_draw_tinted_scaled_rotated_bitmap. (draw-tinted-scaled-rotated-bitmap (bitmap bmp) (color tint) (float cx) (float cy) (float dx) (float dy) (float xscale) (float yscale) (float angle) (integer flags)) Implements al_draw_tinted_scaled_rotated_bitmap. (bitmap-lock*! bitmap pixel-format (integer locking-flag)) Implements al_lock_bitmap. (lock-bitmap*! bitmap pixel-format (integer locking-flag)) Implements al_lock_bitmap. (bitmap-lock-region*! bitmap (integer x) (integer y) (integer width) (integer height) pixel-format (integer locking-flag)) Implements al_lock_bitmap_region. (lock-bitmap-region*! bitmap (integer x) (integer y) (integer width) (integer height) pixel-format (integer locking-flag)) Implements al_lock_bitmap_region. (bitmap-unlock! bitmap) Implements al_unlock_bitmap. (unlock-bitmap! bitmap) Implements al_unlock_bitmap. (bitmap-lock! bitmap pixel-format (integer bitmap-flags)) Implements al_lock_bitmap, with (bitmap-unlock!) and (free-locked-region!) declared as finalizers. (lock-bitmap! bitmap pixel-format (integer bitmap-flags)) Implements al_lock_bitmap, with (bitmap-unlock!) and (free-locked-region!) declared as finalizers. (bitmap-lock-region! bitmap (integer x) (integer y) (integer width) (integer height) pixel-format (integer bitmap-flags)) Implements al_lock_bitmap_region, with (bitmap-unlock!) and (free-locked-region!) declared as finalizers. (lock-bitmap-region! bitmap (integer x) (integer y) (integer width) (integer height) pixel-format (integer bitmap-flags)) Implements al_lock_bitmap_region, with (bitmap-unlock!) and (free-locked-region!) declared as finalizers. (bitmap-pixel! (bitmap bmp) (int x) (int y) (color c)) Sets the provided color struct to the color value at the given coordinates. (bitmap-pixel* (bitmap bmp) (int x) (int y)) Returns a new color struct of the color value at the given coordinates. (bitmap-pixel (bitmap bmp) (int x) (int y)) Returns a new color struct of the color value at the given coordinates, with (free-color!) declared as a finalizer. (bitmap-width bitmap) Implements al_get_bitmap_width. (bitmap-height bitmap) Implements al_get_bitmap_height. (bitmap-format bitmap) Implements al_get_bitmap_format. (bitmap-flags bitmap) Implements al_get_bitmap_flags. (bitmap-mask->alpha! bitmap color) Implements al_convert_mask_to_alpha. (bitmap-clone* bitmap) Implements al_clone_bitmap. (bitmap-clone bitmap) Implements al_clone_bitmap, with (free-bitmap!) declared as a finalizer. (bitmap-locked? bitmap) Implements al_is_bitmap_locked. (bitmap-put-pixel! bitmap (integer x) (integer y) (color c)) Implements _al_put_pixel. (make-sub-bitmap* bitmap (integer x) (integer y) (integer width) (integer height)) Implements al_create_sub_bitmap. (make-sub-bitmap bitmap (integer x) (integer y) (integer width) (integer height)) Implements al_create_sub_bitmap, with (free-bitmap!) declared as a finalizer. (sub-bitmap? bitmap) Implements al_is_sub_bitmap. (put-pixel (integer x) (integer y) (color c)) Implements al_put_pixel. (put-blended-pixel (integer x) (integer y) (color c)) Implements al_put_blended_pixel. (pixel-size pixel-format) Implements al_get_pixel_size. (color-map-rgb! (color c) (unsigned-byte r) (unsigned-byte g) (unsigned-byte b)) Maps rgb values onto the provided color struct, implementing al_map_rgb. (color-map-rgba! (color c) (unsigned-byte r) (unsigned-byte g) (unsigned-byte b) (unsigned-byte a)) Maps rgba values onto the provided color struct, implementing al_map_rgba. (color-map-rgb-float! (color c) (unsigned-byte r) (unsigned-byte g) (unsigned-byte b)) Maps rgb values onto the provided color struct, implementing al_map_rgb_f. (color-map-rgba-float! (color c) (unsigned-byte r) (unsigned-byte g) (unsigned-byte b) (unsigned-byte a)) Maps rgba values onto the provided color struct, implementing al_map_rgba_f. (map-rgb* r g b) Returns a new color struct mapped to the given rgb values. (map-rgb r g b) Returns a new color struct mapped to the given rgb values, with (free-color!) declared as a finalizer. (map-rgba* r g b a) Prodcues a new color struct mapped to the given rgba values. (map-rgba r g b a) Returns a new color struct mapped to the given rgba values, with (free-color!) declared as a finalizer. (map-rgb-float* r g b) Returns a new color struct mapped to the given rgb values. (map-rgb-float r g b) Returns a new color struct mapped to the given rgb values, with (free-color!) declared as a finalizer. (map-rgba-float* r g b a) Returns a new color struct mapped to the given rgba values. (map-rgba-float r g b a) Returns a new color struct mapped to the given rgba values, with (free-color!) declared as a finalizer. (color-unmap-rgb color) Returns a 3-element list of the rgb values representing a given color struct. (color-unmap-rgba color) Returns a 4-element list of the rgba values representing a given color struct. (color-unmap-rgb-float color) Returns a 3-element list of the rgb values representing a given color struct. (color-unmap-rgba-float color) Returns a 4-element list of the rgb values representing a given color struct. (pixel-format-bits pixel-format) Implements al_get_pixel_format_bits. (clipping-rectangle) Returns a 4-element list of the x, y, width and height values of the current clipping rectangle. (clippingle-rectangle-set! (integer x) (integer y) (integer width) (integer height)) Sets the current clipping rectangle. (blender) Returns a 3-element list of the op, source and destination of the current blender. (blender-set! (blend-operation op) (integer source) (integer destination)) Implements al_set_blender. (separate-blender) Returns a 6-element list of the op, source, destination, alpha op, alpha source, and alpha destination. (separate-blender-set! (blend-operation op) (integer src) (integer destination) (integer alpha-op) (integer alpha-source) (integer alpha-destination)) Implements al_set_separate_blender. === Bitmap I/O (register-bitmap-loader (string extension) (function bitmap ((const c-string)))) Implements al_register_bitmap_loader. (register-bitmap-file-loader (string extension) (function bitmap (file))) Implements al_register_bitmap_loader_f. (register-bitmap-saver (string extension) ((function bool ((const c-string) bitmap)) saver)) Implements al_register_bitmap_saver. (register-bitmap-file-saver (string extension) ((function bool (file bitmap)) saver)) Implements al_register_bitmap_saver_f. (load-bitmap* string) Implements al_load_bitmap. (load-bitmap string) Implements al_load_bitmap, with (free-bitmap!) declared as a finalizer. (load-bitmap-from-file* file string) Implements al_load_bitmap_f. (load-bitmap-from-file file string) Implements al_load_bitmap_f, with (free-bitmap!) declared as a finalizer. (bitmap-save bitmap string) Implements al_save_bitmap. (bitmap-save-to-file bitmap file string) Implements al_save_bitmap_f.