You copied the Doc URL to your clipboard.

Struct VisRasterLayout

This struct defines the layout of the pixel data in a frame-buffer.

The lock() method of the LCD protocol expects to be given a pointer to this structure. You can generate a suitable instance by calling VisRasterRegion::lock().

The structure contains these fields:

uint8_t *buffer
This points to the buffer for the rasterized pixel data. The controller can write pixels into this buffer, but must stick within the bounds specified by the width and height.
uint32_t pitch
The number of bytes between consecutive raster lines in the pixel data. This can be greater than the number of bytes per line.
uint32_t width
The width, in pixels, of the render area. This value can be less than the width requested by the LCD controller when it called lock().
uint32_t height
The height, in pixels, of the render area. This value can be less than the height requested by the LCD controller when it called lock().
VisPixelFormat format
This structure defines the format of the pixel data in the raster buffer.
bool changed
This is set to true if the pixel format or buffer size has changed since the previous call to lock().

Pixel data is represented as a one-dimensional array of bytes. The top-left pixel is pointed to by the buffer member. Each pixel takes up a number of bytes, given by format.pbytes.

The pixel at location (x, y) is stored in the memory bytes starting at buffer[y * pitch + x * format.pbytes].

Was this page helpful? Yes No