Buffer formats and conversions.
More...
Buffer formats and conversions.
The SRMFormat module provides structures and functions for working with various buffer formats, including conversions between DRM and OpenGL formats, format lists, and format-related operations.
◆ srmFormatDRMToGL()
Convert a DRM buffer format to an equivalent OpenGL format.
- Parameters
-
format | The DRM buffer format code to convert. |
- Returns
- A pointer to the SRMGLFormat structure representing the equivalent OpenGL format.
◆ srmFormatsListAddFormat()
Add a buffer format to a list of formats.
- Parameters
-
formatsList | A list of formats to add to. |
format | The buffer format code to add. |
modifier | The modifier associated with the format. |
- Returns
- A pointer to the newly added SRMFormat structure.
◆ srmFormatIsInList()
Check if a format/modifier pair is in the list.
- Parameters
-
format | The buffer format code. |
modifier | The modifier associated with the format. |
- Returns
- 1 if in the list, 0 otherwise.
◆ srmFormatListFirstMatchFormat()
Find the first format matching the specified format code in a list of formats.
- Parameters
-
formatsList | A list of formats to search in. |
format | The buffer format code to match. |
- Returns
- A pointer to the first SRMFormat structure matching the format code, or
NULL
if not found.
◆ srmFormatGetDepthBpp()
Get the depth and bits per pixel (BPP) of a buffer format.
- Parameters
-
format | The buffer format code. |
depth | A pointer to store the depth of the format. |
bpp | A pointer to store the bits per pixel (BPP) of the format. |
- Returns
- 1 if the depth and BPP were successfully retrieved, 0 if the format is not recognized.
◆ srmFormatsListCopy()
Create a copy of a list of formats.
- Parameters
-
formatsList | A list of formats to copy. |
- Returns
- A new list containing a copy of the input formats.
◆ srmFormatsListDestroy()
void srmFormatsListDestroy |
( |
SRMList ** |
formatsList | ) |
|
Destroy a list of formats and free associated resources.
- Parameters
-
formatsList | A pointer to the list of formats to destroy. The pointer is set to NULL after destruction. |
◆ srmFormatGetAlphaSubstitute()
Returns an equivalent format with (or without) alpha channel.
If the format doesn't have a substitute, the same value is returned.