Difference between revisions of "Function:Resize"
From CUVI Wiki
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
Re-sizes input image to fit into the output image size. | |||
===Function=== | ===Function=== | ||
{| | {| | ||
| Line 7: | Line 7: | ||
CuviStatus resize(const CuviImage& src, | CuviStatus resize(const CuviImage& src, | ||
CuviImage& dst, | CuviImage& dst, | ||
CuviInterpolationType inter = CUVI_INTER_LINEAR, | |||
const CuviStream& stream = CuviStream()); | const CuviStream& stream = CuviStream()); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 27: | Line 28: | ||
| CuviImage& | | CuviImage& | ||
| Output Image | | Output Image | ||
|- | |||
| inter | |||
| CuviInterpolationType | |||
| Type of interpolation to use for re-sizing. Supports: | |||
{| | |||
|CUVI_INTER_NN | |||
|- | |||
|CUVI_INTER_LINEAR | |||
|- | |||
|CUVI_INTER_CUBIC | |||
|} | |||
|- | |- | ||
| stream | | stream | ||
| Line 33: | Line 45: | ||
|} | |} | ||
===Image Type Support=== | ===Image Type Support=== | ||
| Line 88: | Line 98: | ||
const Cuvi32s newHeight = static_cast<Cuvi32s>(gimg.height() * yScale); | const Cuvi32s newHeight = static_cast<Cuvi32s>(gimg.height() * yScale); | ||
CuviImage gout(newWidth,newHeight,gimg. | CuviImage gout(newWidth,newHeight,gimg.type()); | ||
// | //Re-sizing input image to fit output container using bicubic interpolation | ||
cuvi::geometryTransforms::resize(gimg,gout); | cuvi::geometryTransforms::resize(gimg,gout, CUVI_INTER_CUBIC); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
Latest revision as of 07:10, 16 June 2014
Re-sizes input image to fit into the output image size.
Function
|
Parameters
| Name | Type | Description | |||
|---|---|---|---|---|---|
| src | const CuviImage& | Input Image | |||
| dst | CuviImage& | Output Image | |||
| inter | CuviInterpolationType | Type of interpolation to use for re-sizing. Supports:
| |||
| stream | const CuviStream& | GPU stream ID for execution |
Image Type Support
| Input | Output |
|---|---|
| 8uC1 | 8uC1 |
| 8uC3 | 8uC3 |
| 16uC1 | 16uC1 |
| 16uC3 | 16uC3 |
| 32fC1 | 32fC1 |
| 32fC3 | 32fC3 |
Samples
Example
|



