HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
(fit: resize the image with filtering, into a fixed size)

Functions

ImageBuf OIIO_API ImageBufAlgo::fit (const ImageBuf &src, string_view filtername="", float filterwidth=0.0f, bool exact=false, ROI roi={}, int nthreads=0)
 
ImageBuf OIIO_API ImageBufAlgo::fit (const ImageBuf &src, Filter2D *filter, bool exact=false, ROI roi={}, int nthreads=0)
 
bool OIIO_API ImageBufAlgo::fit (ImageBuf &dst, const ImageBuf &src, string_view filtername="", float filterwidth=0.0f, bool exact=false, ROI roi={}, int nthreads=0)
 
bool OIIO_API ImageBufAlgo::fit (ImageBuf &dst, const ImageBuf &src, Filter2D *filter, bool exact=false, ROI roi={}, int nthreads=0)
 

Detailed Description

Fit src into dst (to a size specified by roi, if dst is not initialized), resizing but preserving its original aspect ratio. Thus, it will resize so be the largest size with the same aspect ratio that can fix inside the region, but will not stretch to completely fill it in both dimensions.

If exact is true, will result in an exact match on aspect ratio and centering (partial pixel shift if necessary), whereas exact=false will only preserve aspect ratio and centering to the precision of a whole pixel.

The filter is used to weight the src pixels falling underneath it for each dst pixel. The caller may specify a reconstruction filter by name and width (expressed in pixels units of the dst image), or rotate() will choose a reasonable default high-quality default filter (lanczos3) if the empty string is passed, and a reasonable filter width if filterwidth is 0. (Note that some filter choices only make sense with particular width, in which case this filterwidth parameter may be ignored.)

Function Documentation

ImageBuf OIIO_API ImageBufAlgo::fit ( const ImageBuf src,
string_view  filtername = "",
float  filterwidth = 0.0f,
bool  exact = false,
ROI  roi = {},
int  nthreads = 0 
)
ImageBuf OIIO_API ImageBufAlgo::fit ( const ImageBuf src,
Filter2D filter,
bool  exact = false,
ROI  roi = {},
int  nthreads = 0 
)
bool OIIO_API ImageBufAlgo::fit ( ImageBuf dst,
const ImageBuf src,
string_view  filtername = "",
float  filterwidth = 0.0f,
bool  exact = false,
ROI  roi = {},
int  nthreads = 0 
)
bool OIIO_API ImageBufAlgo::fit ( ImageBuf dst,
const ImageBuf src,
Filter2D filter,
bool  exact = false,
ROI  roi = {},
int  nthreads = 0 
)