Template Struct SharedPixelBuffer#
Defined in File slint_image.h
SharedPixelBuffer is a container for storing image data as pixels. It is internally reference counted and cheap to copy.
You can construct a new empty shared pixel buffer with its default constructor, or you can copy it from an existing contiguous buffer that you might already have, using the range constructor.
See the documentation for Image for examples how to use this type to integrate Slint with external rendering functions.
SharedPixelBuffer() = default#
Construct an empty SharedPixelBuffer.
inline SharedPixelBuffer(uint32_t width, uint32_t height)#
Construct a SharedPixelBuffer with the given width and height. The pixels are default initialized.
inline SharedPixelBuffer(uint32_t width, uint32_t height, const Pixel *data)#
Construct a SharedPixelBuffer by copying the data from the data array. The array must be of size width * height .
inline uint32_t width() const#
Returns the width of the buffer in pixels.
inline uint32_t height() const#
Returns the height of the buffer in pixels.
bool operator==(const SharedPixelBuffer &other) const = default#
Compare two SharedPixelBuffers. They are considered equal if all their pixels are equal.
- SharedPixelBuffer() = default#