|
Ream v0.1.0-1
C++ graphics library for Linux
|
Describes the memory layout properties of a DRM pixel format. More...
#include <RDRMFormat.h>
Public Member Functions | |
| constexpr UInt32 | pixelsPerBlock () const noexcept |
| Returns the total number of pixels covered by a single block. | |
| constexpr UInt32 | blocksPerRow (UInt32 width) const noexcept |
| Computes the number of blocks required to cover a given image width. | |
| constexpr UInt32 | minStride (UInt32 width) const noexcept |
| Calculates the minimum required stride (in bytes) for a given image width. | |
| constexpr bool | validateStride (UInt32 width, UInt32 stride) const noexcept |
| Validates whether the provided stride matches the alignment and is sufficient for the image width. | |
Public Attributes | |
| RFormat | format |
| The DRM format. | |
| UInt32 | bytesPerBlock |
| Number of bytes required to store one block of pixels. | |
| UInt32 | blockWidth |
| Width of one block of pixels. | |
| UInt32 | blockHeight |
| Height of one block of pixels. | |
| UInt32 | bpp |
| Bits per pixel. | |
| UInt32 | depth |
| Number of bits that are actually used to represent color information — often excluding alpha or padding bits. | |
| UInt32 | planes |
| Number of separate memory planes used to store pixel data. | |
| bool | alpha |
true if the format includes an alpha channel. | |
Describes the memory layout properties of a DRM pixel format.
Provides block dimensions, byte sizes and plane counts, along with helpers to compute strides and validate buffer layouts for a given image width.
|
inlineconstexprnoexcept |
Returns the total number of pixels covered by a single block.
This is calculated as blockWidth × blockHeight.
|
inlineconstexprnoexcept |
Computes the number of blocks required to cover a given image width.
This uses ceiling division to ensure partial blocks are counted. Important for compressed formats where data is grouped in blocks of multiple pixels.
| width | Image width in pixels. |
|
inlineconstexprnoexcept |
Calculates the minimum required stride (in bytes) for a given image width.
The stride must be at least this value to ensure a full row of image data can be represented in memory. This value is based on the number of blocks per row and the number of bytes per block.
| width | Image width in pixels. |
|
inlineconstexprnoexcept |
Validates whether the provided stride matches the alignment and is sufficient for the image width.
| width | Image width in pixels. |
| stride | Stride in bytes. |
true if stride is valid, false otherwise. | RFormat format |
The DRM format.
| UInt32 bytesPerBlock |
Number of bytes required to store one block of pixels.
For uncompressed formats with 1x1 blocks, this typically equals the number of bytes per pixel.
| UInt32 blockWidth |
Width of one block of pixels.
The number of pixels wide in a single block for this image format (1 for uncompressed formats). For example, in a format with a blockWidth of 4, each block covers 4 pixels horizontally. This is important for formats that compress or group pixels in blocks rather than individually.
| UInt32 blockHeight |
Height of one block of pixels.
The number of pixels tall in a single block for this image format (1 for uncompressed formats). For example, if blockHeight is 2, each block covers 2 pixels vertically. This matters for formats that group or compress pixels in blocks instead of individually.
| UInt32 bpp |
Bits per pixel.
| UInt32 depth |
Number of bits that are actually used to represent color information — often excluding alpha or padding bits.
| UInt32 planes |
Number of separate memory planes used to store pixel data.
Typically 1 for packed RGB formats, 2–3 for planar YUV formats.
| bool alpha |
true if the format includes an alpha channel.