diff options
| author | Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> | 2025-02-05 11:28:23 +0200 |
|---|---|---|
| committer | Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> | 2025-03-26 15:44:00 +0200 |
| commit | a9e7ecab862183399c5947931f2bad69ecec393d (patch) | |
| tree | 6c02b4e7a4cb19f9af1421afccd87eef1b084d3a /kms++util/src/cpuframebuffer.cpp | |
| parent | 8b1c053359ed7593e43222daccb8c0db8fcc441f (diff) | |
PixelFormats: New PixelFormatInfo code
New pixel format code, from Python pixutils library.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Diffstat (limited to 'kms++util/src/cpuframebuffer.cpp')
| -rw-r--r-- | kms++util/src/cpuframebuffer.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kms++util/src/cpuframebuffer.cpp b/kms++util/src/cpuframebuffer.cpp index c3bc248..8eac8c4 100644 --- a/kms++util/src/cpuframebuffer.cpp +++ b/kms++util/src/cpuframebuffer.cpp @@ -14,11 +14,10 @@ CPUFramebuffer::CPUFramebuffer(uint32_t width, uint32_t height, PixelFormat form m_num_planes = format_info.num_planes; for (unsigned i = 0; i < format_info.num_planes; ++i) { - const PixelFormatPlaneInfo& pi = format_info.planes[i]; FramebufferPlane& plane = m_planes[i]; - plane.stride = width * pi.bitspp / 8; - plane.size = plane.stride * height / pi.ysub; + plane.stride = format_info.stride(width, i); + plane.size = format_info.planesize(plane.stride, height, i); plane.offset = 0; plane.map = new uint8_t[plane.size]; } |
