|
ImageBuf OIIO_API | ImageBufAlgo::fit (const ImageBuf &src, string_view filtername="", float filterwidth=0.0f, string_view fillmode="letterbox", bool exact=false, ROI roi={}, int nthreads=0) |
|
ImageBuf OIIO_API | ImageBufAlgo::fit (const ImageBuf &src, Filter2D *filter, string_view fillmode="letterbox", 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, string_view fillmode="letterbox", bool exact=false, ROI roi={}, int nthreads=0) |
|
bool OIIO_API | ImageBufAlgo::fit (ImageBuf &dst, const ImageBuf &src, Filter2D *filter, string_view fillmode="letterbox", bool exact=false, ROI roi={}, int nthreads=0) |
|
ImageBuf OIIO_API | ImageBufAlgo::fit (const ImageBuf &src, string_view filtername, float filterwidth, bool exact, ROI roi={}, int nthreads=0) |
|
ImageBuf OIIO_API | ImageBufAlgo::fit (const ImageBuf &src, Filter2D *filter, bool exact, ROI roi={}, int nthreads=0) |
|
bool OIIO_API | ImageBufAlgo::fit (ImageBuf &dst, const ImageBuf &src, string_view filtername, float filterwidth, bool exact, ROI roi={}, int nthreads=0) |
|
bool OIIO_API | ImageBufAlgo::fit (ImageBuf &dst, const ImageBuf &src, Filter2D *filter, bool exact, ROI roi={}, int nthreads=0) |
|
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 to be the largest size with the same aspect ratio that can fit inside the region, but will not stretch to completely fill it in both dimensions.
The fillmode
determines which of several methods will be used to determine how the image will fill the new frame, if its aspect ratio does not precisely match the original source aspect ratio:
- "width" exactly fills the width of the new frame, either cropping or letterboxing the height if it isn't precisely the right size to preserve the original aspect ratio.
- "height" exactly fills the height of the new frame, either cropping or letterboxing the width if it isn't precisely the right size to preserve the original aspect ratio.
- "letterbox" (the default) chooses whichever of "width" or "height" will maximally fill the new frame with no image data lost (it will only letterbox, never crop).
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.)