Conversion between the RGB and YUV formats in sgl-fourcc.h.
More...
|
| sgl_result_t | sgl_generic_rgb2yuv (sgl_threadpool_t *pool, const sgl_uint8_t *src, sgl_fourcc_t src_format, sgl_uint8_t *dst, sgl_fourcc_t dst_format, sgl_int32_t width, sgl_int32_t height) |
| | Converts any supported RGB layout to any supported YUV layout.
|
| |
| sgl_result_t | sgl_generic_rgb2rgb (sgl_threadpool_t *pool, const sgl_uint8_t *src, sgl_fourcc_t src_format, sgl_uint8_t *dst, sgl_fourcc_t dst_format, sgl_int32_t width, sgl_int32_t height) |
| | Converts between any two supported RGB layouts.
|
| |
| sgl_result_t | sgl_generic_yuv2rgb (sgl_threadpool_t *pool, const sgl_uint8_t *src, sgl_fourcc_t src_format, sgl_uint8_t *dst, sgl_fourcc_t dst_format, sgl_int32_t width, sgl_int32_t height) |
| | Converts any supported YUV layout to any supported RGB layout.
|
| |
| sgl_result_t | sgl_generic_yuv2yuv (sgl_threadpool_t *pool, const sgl_uint8_t *src, sgl_fourcc_t src_format, sgl_uint8_t *dst, sgl_fourcc_t dst_format, sgl_int32_t width, sgl_int32_t height) |
| | Converts between any two supported YUV layouts.
|
| |
| sgl_result_t | sgl_simd_rgb2yuv (sgl_threadpool_t *pool, const sgl_uint8_t *src, sgl_fourcc_t src_format, sgl_uint8_t *dst, sgl_fourcc_t dst_format, sgl_int32_t width, sgl_int32_t height) |
| | SIMD RGB-to-YUV conversion.
|
| |
| sgl_result_t | sgl_simd_rgb2rgb (sgl_threadpool_t *pool, const sgl_uint8_t *src, sgl_fourcc_t src_format, sgl_uint8_t *dst, sgl_fourcc_t dst_format, sgl_int32_t width, sgl_int32_t height) |
| | SIMD RGB-to-RGB conversion.
|
| |
| sgl_result_t | sgl_simd_yuv2rgb (sgl_threadpool_t *pool, const sgl_uint8_t *src, sgl_fourcc_t src_format, sgl_uint8_t *dst, sgl_fourcc_t dst_format, sgl_int32_t width, sgl_int32_t height) |
| | SIMD YUV-to-RGB conversion.
|
| |
| sgl_result_t | sgl_simd_yuv2yuv (sgl_threadpool_t *pool, const sgl_uint8_t *src, sgl_fourcc_t src_format, sgl_uint8_t *dst, sgl_fourcc_t dst_format, sgl_int32_t width, sgl_int32_t height) |
| | SIMD YUV-to-YUV conversion.
|
| |
Conversion between the RGB and YUV formats in sgl-fourcc.h.
Buffers are tightly packed according to their FourCC layout and support odd image dimensions by rounding chroma dimensions upward. RGB/YUV conversion uses fixed-point color equations. Alpha is preserved between alpha-bearing RGB formats, synthesized as 255 when absent, and discarded by YUV formats. A SGL_NULL pool selects single-thread execution.
◆ sgl_generic_rgb2rgb()
Converts between any two supported RGB layouts.
- Parameters
-
| [in] | pool | Worker pool, or SGL_NULL for single-thread execution. |
| [in] | src | Source image in src_format. |
| [in] | src_format | Any supported RGB FourCC value. |
| [out] | dst | Destination image in dst_format. |
| [in] | dst_format | Any supported RGB FourCC value. |
| [in] | width | Positive image width in pixels. |
| [in] | height | Positive image height in pixels. |
- Return values
-
| SGL_SUCCESS | Conversion completed. |
| SGL_ERROR_INVALID_ARGUMENTS | Invalid buffer, dimensions, or size. |
| SGL_ERROR_NOT_SUPPORTED | A FourCC is not an RGB format. |
| SGL_ERROR_MEMORY_ALLOCATION | Parallel work storage was unavailable. |
- Precondition
- Source and destination buffers do not overlap.
◆ sgl_generic_rgb2yuv()
Converts any supported RGB layout to any supported YUV layout.
- Parameters
-
| [in] | pool | Worker pool, or SGL_NULL for single-thread execution. |
| [in] | src | Source image in src_format. |
| [in] | src_format | One of the RGB FourCC values in sgl-fourcc.h. |
| [out] | dst | Destination image in dst_format. |
| [in] | dst_format | One of the YUV FourCC values in sgl-fourcc.h. |
| [in] | width | Positive image width in pixels. |
| [in] | height | Positive image height in pixels. |
- Return values
-
| SGL_SUCCESS | Conversion completed. |
| SGL_ERROR_INVALID_ARGUMENTS | Invalid buffer, dimensions, or size. |
| SGL_ERROR_NOT_SUPPORTED | FourCC category or build feature unsupported. |
| SGL_ERROR_MEMORY_ALLOCATION | Parallel work storage was unavailable. |
- Precondition
- Source and destination buffers do not overlap.
- See also
- Pixel formats
◆ sgl_generic_yuv2rgb()
Converts any supported YUV layout to any supported RGB layout.
- Parameters
-
| [in] | pool | Worker pool, or SGL_NULL for single-thread execution. |
| [in] | src | Source image in src_format. |
| [in] | src_format | Any supported YUV FourCC value. |
| [out] | dst | Destination image in dst_format. |
| [in] | dst_format | Any supported RGB FourCC value. |
| [in] | width | Positive image width in pixels. |
| [in] | height | Positive image height in pixels. |
- Return values
-
| SGL_SUCCESS | Conversion completed. |
| SGL_ERROR_INVALID_ARGUMENTS | Invalid buffer, dimensions, or size. |
| SGL_ERROR_NOT_SUPPORTED | Invalid source or destination category. |
| SGL_ERROR_MEMORY_ALLOCATION | Parallel work storage was unavailable. |
- Precondition
- Source and destination buffers do not overlap.
◆ sgl_generic_yuv2yuv()
Converts between any two supported YUV layouts.
- Parameters
-
| [in] | pool | Worker pool, or SGL_NULL for single-thread execution. |
| [in] | src | Source image in src_format. |
| [in] | src_format | Any supported YUV FourCC value. |
| [out] | dst | Destination image in dst_format. |
| [in] | dst_format | Any supported YUV FourCC value. |
| [in] | width | Positive image width in pixels. |
| [in] | height | Positive image height in pixels. |
- Return values
-
| SGL_SUCCESS | Conversion completed. |
| SGL_ERROR_INVALID_ARGUMENTS | Invalid buffer, dimensions, or size. |
| SGL_ERROR_NOT_SUPPORTED | A FourCC is not a YUV format. |
| SGL_ERROR_MEMORY_ALLOCATION | Parallel work storage was unavailable. |
- Precondition
- Source and destination buffers do not overlap.
◆ sgl_simd_rgb2rgb()
SIMD RGB-to-RGB conversion.
- Parameters
-
| [in] | pool | Worker pool, or SGL_NULL for single-thread execution. |
| [in] | src | Source image in src_format. |
| [in] | src_format | Any supported RGB FourCC value. |
| [out] | dst | Destination image in dst_format. |
| [in] | dst_format | Any supported RGB FourCC value. |
| [in] | width | Positive image width in pixels. |
| [in] | height | Positive image height in pixels. |
- Return values
-
| SGL_SUCCESS | Conversion completed. |
| SGL_ERROR_INVALID_ARGUMENTS | Invalid buffer, dimensions, or size. |
| SGL_ERROR_NOT_SUPPORTED | A FourCC is not an RGB format. |
| SGL_ERROR_MEMORY_ALLOCATION | Parallel work storage was unavailable. |
- Precondition
- Source and destination buffers do not overlap.
◆ sgl_simd_rgb2yuv()
SIMD RGB-to-YUV conversion.
- Parameters
-
| [in] | pool | Worker pool, or SGL_NULL for single-thread execution. |
| [in] | src | Source image in src_format. |
| [in] | src_format | One of the RGB FourCC values in sgl-fourcc.h. |
| [out] | dst | Destination image in dst_format. |
| [in] | dst_format | One of the YUV FourCC values in sgl-fourcc.h. |
| [in] | width | Positive image width in pixels. |
| [in] | height | Positive image height in pixels. |
- Return values
-
| SGL_SUCCESS | Conversion completed. |
| SGL_ERROR_INVALID_ARGUMENTS | Invalid buffer, dimensions, or size. |
| SGL_ERROR_NOT_SUPPORTED | FourCC category or build feature unsupported. |
| SGL_ERROR_MEMORY_ALLOCATION | Parallel work storage was unavailable. |
- Precondition
- Source and destination buffers do not overlap.
- See also
- Pixel formats
◆ sgl_simd_yuv2rgb()
SIMD YUV-to-RGB conversion.
- Parameters
-
| [in] | pool | Worker pool, or SGL_NULL for single-thread execution. |
| [in] | src | Source image in src_format. |
| [in] | src_format | Any supported YUV FourCC value. |
| [out] | dst | Destination image in dst_format. |
| [in] | dst_format | Any supported RGB FourCC value. |
| [in] | width | Positive image width in pixels. |
| [in] | height | Positive image height in pixels. |
- Return values
-
| SGL_SUCCESS | Conversion completed. |
| SGL_ERROR_INVALID_ARGUMENTS | Invalid buffer, dimensions, or size. |
| SGL_ERROR_NOT_SUPPORTED | Invalid source or destination category. |
| SGL_ERROR_MEMORY_ALLOCATION | Parallel work storage was unavailable. |
- Precondition
- Source and destination buffers do not overlap.
◆ sgl_simd_yuv2yuv()
SIMD YUV-to-YUV conversion.
- Parameters
-
| [in] | pool | Worker pool, or SGL_NULL for single-thread execution. |
| [in] | src | Source image in src_format. |
| [in] | src_format | Any supported YUV FourCC value. |
| [out] | dst | Destination image in dst_format. |
| [in] | dst_format | Any supported YUV FourCC value. |
| [in] | width | Positive image width in pixels. |
| [in] | height | Positive image height in pixels. |
- Return values
-
| SGL_SUCCESS | Conversion completed. |
| SGL_ERROR_INVALID_ARGUMENTS | Invalid buffer, dimensions, or size. |
| SGL_ERROR_NOT_SUPPORTED | A FourCC is not a YUV format. |
| SGL_ERROR_MEMORY_ALLOCATION | Parallel work storage was unavailable. |
- Precondition
- Source and destination buffers do not overlap.