Rectangular crop of a tightly packed image.
More...
|
| sgl_result_t | sgl_generic_crop (sgl_threadpool_t *pool, const sgl_uint8_t *src, sgl_int32_t src_width, sgl_int32_t src_height, sgl_uint8_t *dst, sgl_int32_t x, sgl_int32_t y, sgl_int32_t crop_width, sgl_int32_t crop_height, sgl_int32_t bpp) |
| | Copies a rectangular source region to a compact destination image.
|
| |
| sgl_result_t | sgl_simd_crop (sgl_threadpool_t *pool, const sgl_uint8_t *src, sgl_int32_t src_width, sgl_int32_t src_height, sgl_uint8_t *dst, sgl_int32_t x, sgl_int32_t y, sgl_int32_t crop_width, sgl_int32_t crop_height, sgl_int32_t bpp) |
| | SIMD crop implementation.
|
| |
Rectangular crop of a tightly packed image.
◆ sgl_generic_crop()
Copies a rectangular source region to a compact destination image.
- Parameters
-
| [in] | pool | Worker pool, or SGL_NULL for single-thread execution. |
| [in] | src | Buffer of at least src_width * src_height * bpp bytes. |
| [in] | src_width | Source width in pixels. |
| [in] | src_height | Source height in pixels. |
| [out] | dst | Buffer of at least crop_width * crop_height * bpp bytes. |
| [in] | x | Zero-based source x coordinate of the crop origin. |
| [in] | y | Zero-based source y coordinate of the crop origin. |
| [in] | crop_width | Positive crop width in pixels. |
| [in] | crop_height | Positive crop height in pixels. |
| [in] | bpp | Positive number of bytes per packed pixel. |
- Return values
-
| SGL_SUCCESS | Crop completed. |
| SGL_ERROR_INVALID_ARGUMENTS | Invalid buffer, geometry, or byte count. |
| SGL_ERROR_MEMORY_ALLOCATION | Parallel work storage was unavailable. |
- Precondition
- The crop rectangle lies completely inside the source and the source and destination buffers do not overlap.
◆ sgl_simd_crop()
SIMD crop implementation.
- Parameters
-
| [in] | pool | Worker pool, or SGL_NULL for single-thread execution. |
| [in] | src | Buffer of at least src_width * src_height * bpp bytes. |
| [in] | src_width | Source width in pixels. |
| [in] | src_height | Source height in pixels. |
| [out] | dst | Buffer of at least crop_width * crop_height * bpp bytes. |
| [in] | x | Zero-based source x coordinate of the crop origin. |
| [in] | y | Zero-based source y coordinate of the crop origin. |
| [in] | crop_width | Positive crop width in pixels. |
| [in] | crop_height | Positive crop height in pixels. |
| [in] | bpp | Positive number of bytes per packed pixel. |
- Return values
-
| SGL_SUCCESS | Crop completed. |
| SGL_ERROR_INVALID_ARGUMENTS | Invalid buffer, geometry, or byte count. |
| SGL_ERROR_MEMORY_ALLOCATION | Parallel work storage was unavailable. |
- Precondition
- The crop rectangle lies completely inside the source and the source and destination buffers do not overlap.