Next: , Previous: , Up: API Reference   [Contents][Index]


3.6 Surfaces

(use-modules (sdl2 surface))
Procedure: color? c

Return #t if c is a color.

Procedure: color-r c
Procedure: color-g c
Procedure: color-b c
Procedure: color-a c
Procedure: palette? p

Return #t if p is a palette.

Procedure: palette-length palette

Return the number of colors in palette.

Procedure: palette-colors palette

Return the colors in palette.

Procedure: pixel-format? pf

Return #t if pf is a pixel format.

Procedure: pixel-format-name pf

Return the symbolic name of the pixel format pf.

Procedure: pixel-format-palette pf

Return the palette for the pixel format pf.

Procedure: pixel-format-bits-per-pixel pf

Return the number of bits per pixel for the pixel format pf.

Procedure: pixel-format-bytes-per-pixel pf

Return the number of bytes per pixel for the pixel format pf.

Procedure: pixel-format-red-mask pf

Return the bitmask for the red component of a pixel in the pixel format pf.

Procedure: pixel-format-green-mask pf

Return the bitmask for the green component of a pixel in the pixel format pf.

Procedure: pixel-format-blue-mask pf

Return the bitmask for the blue component of a pixel in the pixel format pf.

Procedure: pixel-format-alpha-mask pf

Return the bitmask for the alpha component of a pixel in the pixel format pf.

Procedure: make-rgb-surface width height depth

Create a new SDL surface with the dimensions width and height and depth bits per pixel.

Procedure: bytevector->surface bv width height depth pitch

Convert bv, a bytevector of pixel data with dimensions widthxheight, to an SDL surface. Each pixel is depth bits in size, and each row of pixels is pitch bytes in size.

Procedure: delete-surface! surface

Free the memory used by surface.

Procedure: call-with-surface surface proc

Call proc, passing it surface and deleting surface upon exit of proc.

Procedure: load-bmp file

Create a new surface from the bitmap data in file.

Procedure: surface-width surface

Return the width of surface in pixels.

Procedure: surface-height surface

Return the height of surface in pixels.

Procedure: surface-pitch surface

Return the length of a row of pixels in surface in bytes.

Procedure: surface-pixels surface

Return a bytevector containing the raw pixel data in surface.

Procedure: surface-pixel-format surface

Return the pixel format for surface.

Procedure: convert-surface-format surface format

Convert the pixels in surface to format, a symbol representing a specific pixel format, and return a new surface object.

Valid format types are:

Procedure: blit-surface src src-rect dst dst-rect

Blit the rectangle src-rect from the surface src to dst-rect of the surface dst.

Procedure: blit-scaled src src-rect dst dst-rect

Blit the rectangle src-rect from the surface src to dst-rect of the surface dst, scaling the source to fit the destination.

Procedure: fill-rect dst rect color

Fill rect with color, a 32-bit color encoded as an integer value, in the surface dst.


Next: , Previous: , Up: API Reference   [Contents][Index]