Struct Texture

Struct Documentation

struct Texture

This structure describes the properties of a texture for blending with TargetPixelBuffer::draw_texture().

Note: This class is still experimental - it’s API is subject to changes and not stabilized yet. To use the class, you must enable the SLINT_FEATURE_EXPERIMENTAL=ON CMake option.

Public Members

std::span<const uint8_t> bytes

A reference to the pixel bytes of the texture. These bytes are in the format specified by pixel_format.

TexturePixelFormat pixel_format

The pixel format of the texture.

uint16_t pixel_stride

The number of pixels per line.

uint16_t width

The width of the texture in pixels.

uint16_t height

The height of the texture in pixels.

uint16_t delta_x

The delta to apply to the source x coordinate between pixels when drawing the texture. This is used when scaling the texture. The delta is specified in 8:8 fixed point format.

uint16_t delta_y

The delta to apply to the source y coordinate between pixels when drawing the texture. This is used when scaling the texture. The delta is specified in 8:8 fixed point format.

uint16_t source_offset_x

The offset within the texture to start reading pixels from in the x direction. The offset is specified in 12:4 fixed point format.

uint16_t source_offset_y

The offset within the texture to start reading pixels from in the y direction. The offset is specified in 12:4 fixed point format.