An sdl_texture holds pixels that the SDL renderer draws itself,
without Cairo. An sdl_layer places it in an sdl_window or sdl_canvas, or
maps it onto the triangles of an sdl_mesh. The pixels keep the format
they arrived in: camera->texture
stores the frames of a camera in, e.g., YUY2,
and the renderer converts them to RGB when it draws them, on the GPU if
it can. This makes it suitable for video.
Copying the pixels from and to an image is cheap for pixels in ARGB: these are stored with premultiplied alpha, as Cairo stores them.
The renderer of each frame that shows the texture keeps its own copy. After the pixels change, these copies are updated and the frames are drawn again; the Cairo drawings of the windows are not redrawn.
new(T, sdl_texture(image('pce.png'))),
new(W, sdl_window),
send(W, append, sdl_layer(T)),
send(W, open).
none and around which the layer
rotates. @nil
places the top-left corner and rotates around the centre. Copied from
the image or set to the origin of the graphical the texture is made
from.
|size|graphical].g., a
glow, and holds the graphical drawn with Cairo. If the origin of the
graphical, the point (0,0) of its coordinates, is on the texture, it
becomes
sdl_texture<-hot_spot:
a figure drawn around its origin thus becomes a sprite that rotates
around that point. Without an argument the texture has no pixels until, e.g.,
a camera delivers a frame.->draw_in.
Pixels in another format than ARGB, such as a camera frame, are first
converted to ARGB. The texture is shown again where it is displayed.->copy
copies the pixels into an existing image.size(0,0) if there are no pixels..g., argb8888
or the yuy2 and nv12 of cameras. @nil
if there are no pixels.