Nearest-neighbor, bilinear, and bicubic packed-image resize.
More...
|
| sgl_nearest_neighbor_lookup_t * | sgl_generic_create_nearest_neighbor_lut (sgl_int32_t d_width, sgl_int32_t d_height, sgl_int32_t s_width, sgl_int32_t s_height) |
| | Creates a nearest-neighbor lookup table for one resize geometry.
|
| |
| sgl_bilinear_lookup_t * | sgl_generic_create_bilinear_lut (sgl_int32_t d_width, sgl_int32_t d_height, sgl_int32_t s_width, sgl_int32_t s_height) |
| | Creates a bilinear lookup table.
|
| |
| sgl_bicubic_lookup_t * | sgl_generic_create_bicubic_lut (sgl_int32_t d_width, sgl_int32_t d_height, sgl_int32_t s_width, sgl_int32_t s_height) |
| | Creates a bicubic lookup table.
|
| |
| void | sgl_generic_destroy_nearest_neighbor_lut (sgl_nearest_neighbor_lookup_t *lut) |
| | Destroys a nearest-neighbor LUT.
|
| |
| void | sgl_generic_destroy_bilinear_lut (sgl_bilinear_lookup_t *lut) |
| | Destroys a bilinear LUT.
|
| |
| void | sgl_generic_destroy_bicubic_lut (sgl_bicubic_lookup_t *lut) |
| | Destroys a bicubic LUT.
|
| |
| sgl_result_t | sgl_generic_resize_nearest (sgl_threadpool_t *pool, sgl_nearest_neighbor_lookup_t *ext_lut, sgl_uint8_t *dst, sgl_int32_t d_width, sgl_int32_t d_height, sgl_uint8_t *src, sgl_int32_t s_width, sgl_int32_t s_height, sgl_int32_t bpp) |
| | Resizes a packed image using nearest-neighbor sampling.
|
| |
| sgl_result_t | sgl_generic_resize_bilinear (sgl_threadpool_t *pool, sgl_bilinear_lookup_t *ext_lut, sgl_uint8_t *dst, sgl_int32_t d_width, sgl_int32_t d_height, sgl_uint8_t *src, sgl_int32_t s_width, sgl_int32_t s_height, sgl_int32_t bpp) |
| | Resizes a packed image using bilinear interpolation.
|
| |
| sgl_result_t | sgl_generic_resize_bicubic (sgl_threadpool_t *pool, sgl_bicubic_lookup_t *ext_lut, sgl_uint8_t *dst, sgl_int32_t d_width, sgl_int32_t d_height, sgl_uint8_t *src, sgl_int32_t s_width, sgl_int32_t s_height, sgl_int32_t bpp) |
| | Resizes a packed image using bicubic interpolation.
|
| |
| sgl_result_t | sgl_simd_resize_nearest (sgl_threadpool_t *pool, sgl_nearest_neighbor_lookup_t *ext_lut, sgl_uint8_t *dst, sgl_int32_t d_width, sgl_int32_t d_height, sgl_uint8_t *src, sgl_int32_t s_width, sgl_int32_t s_height, sgl_int32_t bpp) |
| | SIMD nearest-neighbor resize.
|
| |
| sgl_result_t | sgl_simd_resize_bilinear (sgl_threadpool_t *pool, sgl_bilinear_lookup_t *ext_lut, sgl_uint8_t *dst, sgl_int32_t d_width, sgl_int32_t d_height, sgl_uint8_t *src, sgl_int32_t s_width, sgl_int32_t s_height, sgl_int32_t bpp) |
| | SIMD bilinear resize.
|
| |
| sgl_result_t | sgl_simd_resize_bicubic (sgl_threadpool_t *pool, sgl_bicubic_lookup_t *ext_lut, sgl_uint8_t *dst, sgl_int32_t d_width, sgl_int32_t d_height, sgl_uint8_t *src, sgl_int32_t s_width, sgl_int32_t s_height, sgl_int32_t bpp) |
| | SIMD bicubic resize.
|
| |
Nearest-neighbor, bilinear, and bicubic packed-image resize.
Buffers use tightly packed rows of width * bpp bytes. A SGL_NULL pool selects synchronous single-thread execution. A reusable LUT avoids geometry allocation on repeated calls with identical dimensions; a SGL_NULL or dimension-mismatched LUT causes the operation to allocate a temporary LUT.
◆ sgl_generic_create_bicubic_lut()
Creates a bicubic lookup table.
- Parameters
-
| [in] | d_width | Destination width; must be at least 2. |
| [in] | d_height | Destination height; must be at least 2. |
| [in] | s_width | Source width; must be at least 2. |
| [in] | s_height | Source height; must be at least 2. |
- Returns
- New lookup table, or SGL_NULL when allocation fails.
◆ sgl_generic_create_bilinear_lut()
Creates a bilinear lookup table.
- Parameters
-
| [in] | d_width | Destination width; must be at least 2. |
| [in] | d_height | Destination height; must be at least 2. |
| [in] | s_width | Source width; must be at least 2. |
| [in] | s_height | Source height; must be at least 2. |
- Returns
- New lookup table, or SGL_NULL when allocation fails.
◆ sgl_generic_create_nearest_neighbor_lut()
Creates a nearest-neighbor lookup table for one resize geometry.
- Parameters
-
| [in] | d_width | Destination width; must be at least 2. |
| [in] | d_height | Destination height; must be at least 2. |
| [in] | s_width | Source width; must be at least 2. |
| [in] | s_height | Source height; must be at least 2. |
- Returns
- New lookup table, or SGL_NULL when allocation fails.
◆ sgl_generic_destroy_bicubic_lut()
Destroys a bicubic LUT.
- Parameters
-
◆ sgl_generic_destroy_bilinear_lut()
Destroys a bilinear LUT.
- Parameters
-
◆ sgl_generic_destroy_nearest_neighbor_lut()
Destroys a nearest-neighbor LUT.
- Parameters
-
◆ sgl_generic_resize_bicubic()
Resizes a packed image using bicubic interpolation.
- Parameters
-
| [in] | pool | Worker pool, or SGL_NULL for single-thread execution. |
| [in] | ext_lut | Reusable LUT for these dimensions, or SGL_NULL. |
| [out] | dst | Buffer of at least d_width * d_height * bpp bytes. |
| [in] | d_width | Destination width in pixels. |
| [in] | d_height | Destination height in pixels. |
| [in] | src | Buffer of at least s_width * s_height * bpp bytes. |
| [in] | s_width | Source width in pixels. |
| [in] | s_height | Source height in pixels. |
| [in] | bpp | Positive number of bytes per packed pixel. |
- Return values
-
| SGL_SUCCESS | Resize completed. |
| SGL_ERROR_INVALID_ARGUMENTS | A pointer, dimension, or bpp is invalid. |
| SGL_ERROR_MEMORY_ALLOCATION | Temporary work storage was unavailable. |
| SGL_ERROR_NOT_SUPPORTED | A non-NULL pool was supplied to a build without thread support. |
- Precondition
- Source and destination buffers do not overlap. Dimensions are at least 2 when source and destination sizes differ.
◆ sgl_generic_resize_bilinear()
Resizes a packed image using bilinear interpolation.
- Parameters
-
| [in] | pool | Worker pool, or SGL_NULL for single-thread execution. |
| [in] | ext_lut | Reusable LUT for these dimensions, or SGL_NULL. |
| [out] | dst | Buffer of at least d_width * d_height * bpp bytes. |
| [in] | d_width | Destination width in pixels. |
| [in] | d_height | Destination height in pixels. |
| [in] | src | Buffer of at least s_width * s_height * bpp bytes. |
| [in] | s_width | Source width in pixels. |
| [in] | s_height | Source height in pixels. |
| [in] | bpp | Positive number of bytes per packed pixel. |
- Return values
-
| SGL_SUCCESS | Resize completed. |
| SGL_ERROR_INVALID_ARGUMENTS | A pointer, dimension, or bpp is invalid. |
| SGL_ERROR_MEMORY_ALLOCATION | Temporary work storage was unavailable. |
| SGL_ERROR_NOT_SUPPORTED | A non-NULL pool was supplied to a build without thread support. |
- Precondition
- Source and destination buffers do not overlap. Dimensions are at least 2 when source and destination sizes differ.
◆ sgl_generic_resize_nearest()
Resizes a packed image using nearest-neighbor sampling.
- Parameters
-
| [in] | pool | Worker pool, or SGL_NULL for single-thread execution. |
| [in] | ext_lut | Reusable LUT for these dimensions, or SGL_NULL. |
| [out] | dst | Buffer of at least d_width * d_height * bpp bytes. |
| [in] | d_width | Destination width in pixels. |
| [in] | d_height | Destination height in pixels. |
| [in] | src | Buffer of at least s_width * s_height * bpp bytes. |
| [in] | s_width | Source width in pixels. |
| [in] | s_height | Source height in pixels. |
| [in] | bpp | Positive number of bytes per packed pixel. |
- Return values
-
| SGL_SUCCESS | Resize completed. |
| SGL_ERROR_INVALID_ARGUMENTS | A pointer, dimension, or bpp is invalid. |
| SGL_ERROR_MEMORY_ALLOCATION | Temporary work storage was unavailable. |
| SGL_ERROR_NOT_SUPPORTED | A non-NULL pool was supplied to a build without thread support. |
- Precondition
- Source and destination buffers do not overlap. Dimensions are at least 2 when source and destination sizes differ.
◆ sgl_simd_resize_bicubic()
SIMD bicubic resize.
- Parameters
-
| [in] | pool | Worker pool, or SGL_NULL for single-thread execution. |
| [in] | ext_lut | Reusable LUT for these dimensions, or SGL_NULL. |
| [out] | dst | Buffer of at least d_width * d_height * bpp bytes. |
| [in] | d_width | Destination width in pixels. |
| [in] | d_height | Destination height in pixels. |
| [in] | src | Buffer of at least s_width * s_height * bpp bytes. |
| [in] | s_width | Source width in pixels. |
| [in] | s_height | Source height in pixels. |
| [in] | bpp | Positive number of bytes per packed pixel. |
- Return values
-
| SGL_SUCCESS | Resize completed. |
| SGL_ERROR_INVALID_ARGUMENTS | A pointer, dimension, or bpp is invalid. |
| SGL_ERROR_MEMORY_ALLOCATION | Temporary work storage was unavailable. |
| SGL_ERROR_NOT_SUPPORTED | A non-NULL pool was supplied to a build without thread support. |
- Precondition
- Source and destination buffers do not overlap. Dimensions are at least 2 when source and destination sizes differ.
◆ sgl_simd_resize_bilinear()
SIMD bilinear resize.
- Parameters
-
| [in] | pool | Worker pool, or SGL_NULL for single-thread execution. |
| [in] | ext_lut | Reusable LUT for these dimensions, or SGL_NULL. |
| [out] | dst | Buffer of at least d_width * d_height * bpp bytes. |
| [in] | d_width | Destination width in pixels. |
| [in] | d_height | Destination height in pixels. |
| [in] | src | Buffer of at least s_width * s_height * bpp bytes. |
| [in] | s_width | Source width in pixels. |
| [in] | s_height | Source height in pixels. |
| [in] | bpp | Positive number of bytes per packed pixel. |
- Return values
-
| SGL_SUCCESS | Resize completed. |
| SGL_ERROR_INVALID_ARGUMENTS | A pointer, dimension, or bpp is invalid. |
| SGL_ERROR_MEMORY_ALLOCATION | Temporary work storage was unavailable. |
| SGL_ERROR_NOT_SUPPORTED | A non-NULL pool was supplied to a build without thread support. |
- Precondition
- Source and destination buffers do not overlap. Dimensions are at least 2 when source and destination sizes differ.
◆ sgl_simd_resize_nearest()
SIMD nearest-neighbor resize.
- Parameters
-
| [in] | pool | Worker pool, or SGL_NULL for single-thread execution. |
| [in] | ext_lut | Reusable LUT for these dimensions, or SGL_NULL. |
| [out] | dst | Buffer of at least d_width * d_height * bpp bytes. |
| [in] | d_width | Destination width in pixels. |
| [in] | d_height | Destination height in pixels. |
| [in] | src | Buffer of at least s_width * s_height * bpp bytes. |
| [in] | s_width | Source width in pixels. |
| [in] | s_height | Source height in pixels. |
| [in] | bpp | Positive number of bytes per packed pixel. |
- Return values
-
| SGL_SUCCESS | Resize completed. |
| SGL_ERROR_INVALID_ARGUMENTS | A pointer, dimension, or bpp is invalid. |
| SGL_ERROR_MEMORY_ALLOCATION | Temporary work storage was unavailable. |
| SGL_ERROR_NOT_SUPPORTED | A non-NULL pool was supplied to a build without thread support. |
- Precondition
- Source and destination buffers do not overlap. Dimensions are at least 2 when source and destination sizes differ.