mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-01 12:24:16 +00:00
Add RGB565 rendering function to the C++ software renderer
This commit is contained in:
parent
1ecd36d51a
commit
cc36915241
2 changed files with 29 additions and 1 deletions
|
|
@ -295,6 +295,19 @@ public:
|
|||
cbindgen_private::slint_software_renderer_render_rgb8(
|
||||
inner, &window.window_handle().inner, buffer.data(), buffer.size(), pixel_stride);
|
||||
}
|
||||
|
||||
/// Render the window scene into an RGB 565 encoded pixel buffer
|
||||
///
|
||||
/// The buffer must be at least as large as the associated slint::Window
|
||||
///
|
||||
/// The stride is the amount of pixels between two lines in the buffer.
|
||||
/// It is must be at least as large as the width of the window.
|
||||
void render_rgb565(const Window &window, std::span<uint16_t> buffer,
|
||||
std::size_t pixel_stride) const
|
||||
{
|
||||
cbindgen_private::slint_software_renderer_render_rgb565(
|
||||
inner, &window.window_handle().inner, buffer.data(), buffer.size(), pixel_stride);
|
||||
}
|
||||
};
|
||||
|
||||
/// An opaque, low-level window handle that internalizes everything necessary to exchange messages
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue