In order to be able to use the procedures documented here, one shall
(use-modules (slayer image))
. The module provides a symbol
slayer-image
to use with cond-expand
(srfi-0).
Loads an image from an external file, indicated by path. The supported file formats depend on the way the SDL_image library was compiled. The procedure returns an object that represents the image internally, and can be used with
draw-image!
and other procedures. FIXME: if something goes wrong (i.e. the file doesn't exist), the application will probably crash.
Display image on the target (which is the screen by default). Its top left corner will be located at (x, y), which default to (0, 0).
Generates and returns solid rectangle whose width is w, height h and color is color. color is a 32-bit integer value, which can be written as
#xAARRGGBB
, whereAA
means alpha channel,RR
is red component,GG
– green component, andBB
– blue component.
Return a newly allocated image that contains the part of image with upper left corner at (x, y). If given and positive, w and h designate the size of the new image. If non-positive, they tell how many pixels of image should be cropped from the right and the bottom (0 by default).
Return a list of
(red green blue alpha)
components of 32-bit integer color. The returned values range between 0 and 255, the higher being more intensive.
Return a 32-bit integer value (as elements of the array returned by
image->array
are) that represents color with red, green, blue and alpha components.
Returns
#t
if x is an image, and#f
otherwise. An image can be passed to functions likecrop-image
. An image can either besurface?
,texture?
orscreen?
.
Returns
#t
when the given image is internally represented as an OpenGL texture, and#f
otherwise.