((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/allegro" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "allegro" "game")) (section 2 "allegro" (p "This document pertains to bitmap related methods found in the Allegro egg.") (p "Please see the main [allegro] wiki page for more information.") (toc)) (section 2 "Enums" (section 3 "bitmap-flag" (def (sig (procedure "(bitmap-flag->int bitmap-flag)" (id bitmap-flag->int))) (p (tt "bitmap-flag") " may be one of the following symbols:") (ul (li "memory-bitmap") (li "keep-bitmap-format") (li "force-locking") (li "no-preserve-texture") (li "alpha-test") (li "min-linear") (li "mag-linear") (li "mipmap") (li "no-premultiplied-alpha") (li "video-bitmap"))) (def (sig (procedure "(int->bitmap-flag integer)" (id int->bitmap-flag))))) (section 3 "blend-operation" (def (sig (procedure "(blend-operation->int blend-operation)" (id blend-operation->int))) (p (tt "blend-operation") " may be one of the following symbols:") (ul (li "add") (li "source-minus-destination") (li "destination-minus-source"))) (def (sig (procedure "(int->blend-operation integer)" (id int->blend-operation))))) (section 3 "blending-mode" (def (sig (procedure "(blending-mode->int blending-mode)" (id blending-mode->int))) (p (tt "blending-mode") " may be one of the following symbols:") (ul (li "zero") (li "one") (li "alpha") (li "inverse-alpha"))) (def (sig (procedure "(int->blending-mode integer)" (id int->blending-mode))))) (section 3 "blitting-flag" (def (sig (procedure "(blitting-flag->int blitting-flag)" (id blitting-flag->int))) (p (tt "blitting-flag") " may be one of the following symbols:") (ul (li "flip-horizontal") (li "flip-vertical"))) (def (sig (procedure "(int->blitting-flag integer)" (id int->blitting-flag))))) (section 3 "locking-flag" (def (sig (procedure "(locking-flag->int locking-flag)" (id locking-flag->int))) (p (tt "locking-flag") " may be one of the following symbols:") (ul (li "read-write") (li "read-only") (li "write-only"))) (def (sig (procedure "(int->locking-flag integer)" (id int->locking-flag))))) (section 3 "pixel-format" (def (sig (procedure "(pixel-format->int pixel-format)" (id pixel-format->int))) (p (tt "pixel-format") " may be one of the following symbols:") (ul (li "any") (li "any-no-alpha") (li "any-with-alpha") (li "any-15-no-alpha") (li "any-16-no-alpha") (li "any-16-with-alpha") (li "any-24-no-alpha") (li "any-32-no-alpha") (li "any-32-with-alpha") (li "argb-8888") (li "rgba-8888") (li "argb-4444") (li "rgb-888") (li "rgb-565") (li "rgb555") (li "rgba-5551") (li "argb-1555") (li "abgr-8888") (li "xbgr-8888") (li "bgr-888") (li "bgr-565") (li "bgr-555") (li "rgbx-8888") (li "xrgb-8888") (li "abgr-f32") (li "abgr-8888-le") (li "rgba-4444"))) (def (sig (procedure "(int->pixel-format integer)" (id int->pixel-format)))))) (section 2 "Records" (section 3 "bitmap" (def (sig (record "bitmap" (id bitmap))))) (section 3 "locked-region" (def (sig (record "locked-region" (id locked-region)) (procedure "(free-locked-region! locked-region)" (id free-locked-region!)) (procedure "(locked-region-data locked-region)" (id locked-region-data)) (procedure "(locked-region-format locked-region)" (id locked-region-format)) (procedure "(locked-region-pitch locked-region)" (id locked-region-pitch)) (procedure "(locked-region-pixel-size locked-region)" (id locked-region-pixel-size)))))) (section 2 "Functions" (section 3 "Bitmap" (def (sig (procedure "(new-bitmap-format-set! pixel-format)" (id new-bitmap-format-set!))) (p "Implements al_set_new_bitmap_format.")) (def (sig (procedure "(new-bitmap-format)" (id new-bitmap-format))) (p "Implements al_get_new_bitmap_flags.")) (def (sig (procedure "(new-bitmap-flags-set! bitmap-flag)" (id new-bitmap-flags-set!))) (p "Implements al_set_new_bitmap_flags.")) (def (sig (procedure "(new-bitmap-flags)" (id new-bitmap-flags))) (p "Implements al_get_new_bitmap_flags.")) (def (sig (procedure "(new-bitmap-add-flag bitmap-flag)" (id new-bitmap-add-flag))) (p "Implements al_add_new_bitmap_flag.")) (def (sig (procedure "(make-bitmap* (integer width) (integer height))" (id make-bitmap*))) (p "Implements al_create_bitmap.")) (def (sig (procedure "(make-bitmap (integer width) (integer height))" (id make-bitmap))) (p "Implements al_create_bitmap, with (free-bitmap!) declared as a finalizer.")) (def (sig (procedure "(bitmap-draw bitmap (float dx) (float dy) bitmap-flag)" (id bitmap-draw))) (p "Implements al_draw_bitmap.")) (def (sig (procedure "(draw-bitmap bitmap (float dx) (float dy) bitmap-flag)" (id draw-bitmap))) (p "Implements al_draw_bitmap.")) (def (sig (procedure "(bitmap-draw-region bitmap (float sx) (float sy) (float sw) (float sh) (float dx) (float dy) (integer bitmap-flags))" (id bitmap-draw-region))) (p "Implements al_draw_bitmap_region.")) (def (sig (procedure "(draw-bitmap-region bitmap (float sx) (float sy) (float sw) (float sh) (float dx) (float dy) (integer bitmap-flags))" (id draw-bitmap-region))) (p "Implements al_draw_bitmap_region.")) (def (sig (procedure "(bitmap-draw-scaled bitmap (float sx) (float sy) (float sw) (float sh) (float dx) (float dy) (float dw) (float dh) (integer bitmap-flags))" (id bitmap-draw-scaled))) (p "Implements al_draw_scaled_bitmap.")) (def (sig (procedure "(draw-scaled-bitmap bitmap (float sx) (float sy) (float sw) (float sh) (float dx) (float dy) (float dw) (float dh) (integer bitmap-flags))" (id draw-scaled-bitmap))) (p "Implements al_draw_scaled_bitmap.")) (def (sig (procedure "(bitmap-draw-rotated bitmap (float cx) (float cy) (float dx) (float dy) (float angle) (integer bitmap-flags))" (id bitmap-draw-rotated))) (p "Implements al_draw_rotated_bitmap.")) (def (sig (procedure "(draw-rotated-bitmap bitmap (float cx) (float cy) (float dx) (float dy) (float angle) (integer bitmap-flags))" (id draw-rotated-bitmap))) (p "Implements al_draw_rotated_bitmap.")) (def (sig (procedure "(bitmap-draw-scaled-rotated bitmap (float cx) (float cy) (float dx) (float dy) (float xscale) (float yscale) (float angle) (integer bitmap-flags))" (id bitmap-draw-scaled-rotated))) (p "Implements al_draw_scaled_rotated_bitmap.")) (def (sig (procedure "(draw-scaled-rotated-bitmap bitmap (float cx) (float cy) (float dx) (float dy) (float xscale) (float yscale) (float angle) (integer bitmap-flags))" (id draw-scaled-rotated-bitmap))) (p "Implements al_draw_scaled_rotated_bitmap.")) (def (sig (procedure "(bitmap-draw-tinted (bitmap bmp) (color tint) (float dx) (float dy) (integer bitmap-flags))" (id bitmap-draw-tinted))) (p "Implements al_draw_tinted_bitmap.")) (def (sig (procedure "(draw-tinted-bitmap (bitmap bmp) (color tint) (float dx) (float dy) (integer bitmap-flags))" (id draw-tinted-bitmap))) (p "Implements al_draw_tinted_bitmap.")) (def (sig (procedure "(bitmap-draw-tinted-region (bitmap bmp) (color tint) (float sx) (float sy) (float sw) (float sh) (float dx) (float dy) (integer bitmap-flags))" (id bitmap-draw-tinted-region))) (p "Implements al_draw_tinted_bitmap_region.")) (def (sig (procedure "(draw-tinted-bitmap-region (bitmap bmp) (color tint) (float sx) (float sy) (float sw) (float sh) (float dx) (float dy) (integer bitmap-flags))" (id draw-tinted-bitmap-region))) (p "Implements al_draw_tinted_bitmap_region.")) (def (sig (procedure "(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))" (id bitmap-draw-tinted-scaled))) (p "Implements al_draw_tinted_scale_bitmap.")) (def (sig (procedure "(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))" (id draw-tinted-scaled-bitmap))) (p "Implements al_draw_tinted_scale_bitmap.")) (def (sig (procedure "(bitmap-draw-tinted-rotated (bitmap bmp) (color tint) (float cx) (float cy) (float dx) (float dy) (float angle) (integer flags))" (id bitmap-draw-tinted-rotated))) (p "Implements al_draw_tinted_rotated_bitmap.")) (def (sig (procedure "(draw-tinted-rotated-bitmap (bitmap bmp) (color tint) (float cx) (float cy) (float dx) (float dy) (float angle) (integer flags))" (id draw-tinted-rotated-bitmap))) (p "Implements al_draw_tinted_rotated_bitmap.")) (def (sig (procedure "(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))" (id bitmap-draw-tinted-scaled-rotated))) (p "Implements al_draw_tinted_scaled_rotated_bitmap.")) (def (sig (procedure "(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))" (id draw-tinted-scaled-rotated-bitmap))) (p "Implements al_draw_tinted_scaled_rotated_bitmap.")) (def (sig (procedure "(bitmap-lock*! bitmap pixel-format (integer locking-flag))" (id bitmap-lock*!))) (p "Implements al_lock_bitmap.")) (def (sig (procedure "(lock-bitmap*! bitmap pixel-format (integer locking-flag))" (id lock-bitmap*!))) (p "Implements al_lock_bitmap.")) (def (sig (procedure "(bitmap-lock-region*! bitmap (integer x) (integer y) (integer width) (integer height) pixel-format (integer locking-flag))" (id bitmap-lock-region*!))) (p "Implements al_lock_bitmap_region.")) (def (sig (procedure "(lock-bitmap-region*! bitmap (integer x) (integer y) (integer width) (integer height) pixel-format (integer locking-flag))" (id lock-bitmap-region*!))) (p "Implements al_lock_bitmap_region.")) (def (sig (procedure "(bitmap-unlock! bitmap)" (id bitmap-unlock!))) (p "Implements al_unlock_bitmap.")) (def (sig (procedure "(unlock-bitmap! bitmap)" (id unlock-bitmap!))) (p "Implements al_unlock_bitmap.")) (def (sig (procedure "(bitmap-lock! bitmap pixel-format (integer bitmap-flags))" (id bitmap-lock!))) (p "Implements al_lock_bitmap, with (bitmap-unlock!) and (free-locked-region!) declared as finalizers.")) (def (sig (procedure "(lock-bitmap! bitmap pixel-format (integer bitmap-flags))" (id lock-bitmap!))) (p "Implements al_lock_bitmap, with (bitmap-unlock!) and (free-locked-region!) declared as finalizers.")) (def (sig (procedure "(bitmap-lock-region! bitmap (integer x) (integer y) (integer width) (integer height) pixel-format (integer bitmap-flags))" (id bitmap-lock-region!))) (p "Implements al_lock_bitmap_region, with (bitmap-unlock!) and (free-locked-region!) declared as finalizers.")) (def (sig (procedure "(lock-bitmap-region! bitmap (integer x) (integer y) (integer width) (integer height) pixel-format (integer bitmap-flags))" (id lock-bitmap-region!))) (p "Implements al_lock_bitmap_region, with (bitmap-unlock!) and (free-locked-region!) declared as finalizers.")) (def (sig (procedure "(bitmap-pixel! (bitmap bmp) (int x) (int y) (color c))" (id bitmap-pixel!))) (p "Sets the provided color struct to the color value at the given coordinates.")) (def (sig (procedure "(bitmap-pixel* (bitmap bmp) (int x) (int y))" (id bitmap-pixel*))) (p "Returns a new color struct of the color value at the given coordinates.")) (def (sig (procedure "(bitmap-pixel (bitmap bmp) (int x) (int y))" (id bitmap-pixel))) (p "Returns a new color struct of the color value at the given coordinates, with (free-color!) declared as a finalizer.")) (def (sig (procedure "(bitmap-width bitmap)" (id bitmap-width))) (p "Implements al_get_bitmap_width.")) (def (sig (procedure "(bitmap-height bitmap)" (id bitmap-height))) (p "Implements al_get_bitmap_height.")) (def (sig (procedure "(bitmap-format bitmap)" (id bitmap-format))) (p "Implements al_get_bitmap_format.")) (def (sig (procedure "(bitmap-flags bitmap)" (id bitmap-flags))) (p "Implements al_get_bitmap_flags.")) (def (sig (procedure "(bitmap-mask->alpha! bitmap color)" (id bitmap-mask->alpha!))) (p "Implements al_convert_mask_to_alpha.")) (def (sig (procedure "(bitmap-clone* bitmap)" (id bitmap-clone*))) (p "Implements al_clone_bitmap.")) (def (sig (procedure "(bitmap-clone bitmap)" (id bitmap-clone))) (p "Implements al_clone_bitmap, with (free-bitmap!) declared as a finalizer.")) (def (sig (procedure "(bitmap-locked? bitmap)" (id bitmap-locked?))) (p "Implements al_is_bitmap_locked.")) (def (sig (procedure "(bitmap-put-pixel! bitmap (integer x) (integer y) (color c))" (id bitmap-put-pixel!))) (p "Implements _al_put_pixel.")) (def (sig (procedure "(make-sub-bitmap* bitmap (integer x) (integer y) (integer width) (integer height))" (id make-sub-bitmap*))) (p "Implements al_create_sub_bitmap.")) (def (sig (procedure "(make-sub-bitmap bitmap (integer x) (integer y) (integer width) (integer height))" (id make-sub-bitmap))) (p "Implements al_create_sub_bitmap, with (free-bitmap!) declared as a finalizer.")) (def (sig (procedure "(sub-bitmap? bitmap)" (id sub-bitmap?))) (p "Implements al_is_sub_bitmap.")) (def (sig (procedure "(put-pixel (integer x) (integer y) (color c))" (id put-pixel))) (p "Implements al_put_pixel.")) (def (sig (procedure "(put-blended-pixel (integer x) (integer y) (color c))" (id put-blended-pixel))) (p "Implements al_put_blended_pixel.")) (def (sig (procedure "(pixel-size pixel-format)" (id pixel-size))) (p "Implements al_get_pixel_size.")) (def (sig (procedure "(color-map-rgb! (color c) (unsigned-byte r) (unsigned-byte g) (unsigned-byte b))" (id color-map-rgb!))) (p "Maps rgb values onto the provided color struct, implementing al_map_rgb.")) (def (sig (procedure "(color-map-rgba! (color c) (unsigned-byte r) (unsigned-byte g) (unsigned-byte b) (unsigned-byte a))" (id color-map-rgba!))) (p "Maps rgba values onto the provided color struct, implementing al_map_rgba.")) (def (sig (procedure "(color-map-rgb-float! (color c) (unsigned-byte r) (unsigned-byte g) (unsigned-byte b))" (id color-map-rgb-float!))) (p "Maps rgb values onto the provided color struct, implementing al_map_rgb_f.")) (def (sig (procedure "(color-map-rgba-float! (color c) (unsigned-byte r) (unsigned-byte g) (unsigned-byte b) (unsigned-byte a))" (id color-map-rgba-float!))) (p "Maps rgba values onto the provided color struct, implementing al_map_rgba_f.")) (def (sig (procedure "(map-rgb* r g b)" (id map-rgb*))) (p "Returns a new color struct mapped to the given rgb values.")) (def (sig (procedure "(map-rgb r g b)" (id map-rgb))) (p "Returns a new color struct mapped to the given rgb values, with (free-color!) declared as a finalizer.")) (def (sig (procedure "(map-rgba* r g b a)" (id map-rgba*))) (p "Prodcues a new color struct mapped to the given rgba values.")) (def (sig (procedure "(map-rgba r g b a)" (id map-rgba))) (p "Returns a new color struct mapped to the given rgba values, with (free-color!) declared as a finalizer.")) (def (sig (procedure "(map-rgb-float* r g b)" (id map-rgb-float*))) (p "Returns a new color struct mapped to the given rgb values.")) (def (sig (procedure "(map-rgb-float r g b)" (id map-rgb-float))) (p "Returns a new color struct mapped to the given rgb values, with (free-color!) declared as a finalizer.")) (def (sig (procedure "(map-rgba-float* r g b a)" (id map-rgba-float*))) (p "Returns a new color struct mapped to the given rgba values.")) (def (sig (procedure "(map-rgba-float r g b a)" (id map-rgba-float))) (p "Returns a new color struct mapped to the given rgba values, with (free-color!) declared as a finalizer.")) (def (sig (procedure "(color-unmap-rgb color)" (id color-unmap-rgb))) (p "Returns a 3-element list of the rgb values representing a given color struct.")) (def (sig (procedure "(color-unmap-rgba color)" (id color-unmap-rgba))) (p "Returns a 4-element list of the rgba values representing a given color struct.")) (def (sig (procedure "(color-unmap-rgb-float color)" (id color-unmap-rgb-float))) (p "Returns a 3-element list of the rgb values representing a given color struct.")) (def (sig (procedure "(color-unmap-rgba-float color)" (id color-unmap-rgba-float))) (p "Returns a 4-element list of the rgb values representing a given color struct.")) (def (sig (procedure "(pixel-format-bits pixel-format)" (id pixel-format-bits))) (p "Implements al_get_pixel_format_bits.")) (def (sig (procedure "(clipping-rectangle)" (id clipping-rectangle))) (p "Returns a 4-element list of the x, y, width and height values of the current clipping rectangle.")) (def (sig (procedure "(clippingle-rectangle-set! (integer x) (integer y) (integer width) (integer height))" (id clippingle-rectangle-set!))) (p "Sets the current clipping rectangle.")) (def (sig (procedure "(blender)" (id blender))) (p "Returns a 3-element list of the op, source and destination of the current blender.")) (def (sig (procedure "(blender-set! (blend-operation op) (integer source) (integer destination))" (id blender-set!))) (p "Implements al_set_blender.")) (def (sig (procedure "(separate-blender)" (id separate-blender))) (p "Returns a 6-element list of the op, source, destination, alpha op, alpha source, and alpha destination.")) (def (sig (procedure "(separate-blender-set! (blend-operation op) (integer src) (integer destination) (integer alpha-op) (integer alpha-source) (integer alpha-destination))" (id separate-blender-set!))) (p "Implements al_set_separate_blender."))) (section 3 "Bitmap I/O" (def (sig (procedure "(register-bitmap-loader (string extension) (function bitmap ((const c-string))))" (id register-bitmap-loader))) (p "Implements al_register_bitmap_loader.")) (def (sig (procedure "(register-bitmap-file-loader (string extension) (function bitmap (file)))" (id register-bitmap-file-loader))) (p "Implements al_register_bitmap_loader_f.")) (def (sig (procedure "(register-bitmap-saver (string extension) ((function bool ((const c-string) bitmap)) saver))" (id register-bitmap-saver))) (p "Implements al_register_bitmap_saver.")) (def (sig (procedure "(register-bitmap-file-saver (string extension) ((function bool (file bitmap)) saver))" (id register-bitmap-file-saver))) (p "Implements al_register_bitmap_saver_f.")) (def (sig (procedure "(load-bitmap* string)" (id load-bitmap*))) (p "Implements al_load_bitmap.")) (def (sig (procedure "(load-bitmap string)" (id load-bitmap))) (p "Implements al_load_bitmap, with (free-bitmap!) declared as a finalizer.")) (def (sig (procedure "(load-bitmap-from-file* file string)" (id load-bitmap-from-file*))) (p "Implements al_load_bitmap_f.")) (def (sig (procedure "(load-bitmap-from-file file string)" (id load-bitmap-from-file))) (p "Implements al_load_bitmap_f, with (free-bitmap!) declared as a finalizer.")) (def (sig (procedure "(bitmap-save bitmap string)" (id bitmap-save))) (p "Implements al_save_bitmap.")) (def (sig (procedure "(bitmap-save-to-file bitmap file string)" (id bitmap-save-to-file))) (p "Implements al_save_bitmap_f.")))))