You are here: Start » Function Reference » Image » Image Spatial Transforms » ResizeImage
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationLite |
Enlarges or shrinks an image to new dimensions.
Syntax
void fil::ResizeImage ( const fil::Image& inImage, ftl::Optional<const fil::Box&> inRoi, ftl::Optional<int> inNewWidth, ftl::Optional<int> inNewHeight, fil::ResizeMethod::Type inResizeMethod, fil::Image& outImage )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inImage | const Image& | Input image | ||
![]() |
inRoi | Optional<const Box&> | NIL | Box defining a subimage to be cropped and resized. | |
![]() |
inNewWidth | Optional<int> | 1 - 65535 | NIL | |
![]() |
inNewHeight | Optional<int> | 1 - 65535 | NIL | |
![]() |
inResizeMethod | ResizeMethod::Type | |||
![]() |
outImage | Image& | Output image |
Description
The operation stretches or shrinks the inImage so that the dimensions of the outImage equal inNewWidth, inNewHeight. Three modes of pixel interpolation are available, with Area mode giving best results, but being most computationally expensive.
Examples
![]() |
![]() |
ResizeImage performed on the sample image with inNewWidth = 300, inNewHeight = 200.
Hardware Acceleration
This operation supports automatic parallelization for multicore and multiprocessor systems.
This operation is optimized for SSE2 technology for pixels of types: UINT8 (when inResizeMethod = Area), UINT16 (when inResizeMethod = Area), 3xUINT8 (when inResizeMethod = Area), 3xUINT16 (when inResizeMethod = Area).
This operation is optimized for SSE41 technology for pixels of types: UINT8(when inResizeMethod = Bilinear), 3xUINT8(when inResizeMethod = Bilinear).
This operation is optimized for AVX2 technology for pixels of types: UINT8 (when inResizeMethod = Area or inResizeMethod = Bilinear), UINT16 (when inResizeMethod = Area), 3xUINT8 (when inResizeMethod = Area or inResizeMethod = Bilinear), 3xUINT16 (when inResizeMethod = Area).
This operation is optimized for NEON technology for pixels of types: UINT8 (when inResizeMethod = Area), 3xUINT8 (when inResizeMethod = Area), UINT16 (when inResizeMethod = Area), 3xUINT16 (when inResizeMethod = Area).
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Empty image on input in ResizeImage. |
DomainError | Input and output images are not distinct in ResizeImage. |
DomainError | ROI is out of inImage range in ResizeImage. |
See Also
- ResizeImage_Relative – Resizes an image by a factor along each axis.