.. SPDX-FileCopyrightText: 2021 Intel Corporation .. .. SPDX-License-Identifier: CC-BY-4.0 .. _resize_bilinear: Resize with Bilinear Interpolation =================================== Changes an image size using the linear interpolation method. .. rubric:: Description :class: sectiontitle This function changes the image size using the linear interpolation method. The image size may be either reduced or increased in each direction, depending on the destination image size. The linear interpolation algorithm must use source image intensities at the four pixels in the neighborhood of the point in the source image. The weighted values of these pixels must be used for the destination image. Algorithm parameters must be set through the ``resize_bilinear_spec`` class. The border pixels are processed in accordance with the border type. This function can operate with ROI (see :ref:`image-regions-of-interest`). .. rubric:: Headers :class: sectiontitle ``oneapi/ipl/transform/resize_bilinear.hpp`` .. rubric:: Syntax :class: sectiontitle .. doxygenfunction:: oneapi::ipl::resize_bilinear(sycl::queue&, image&, image&, const resize_bilinear_spec&, const std::vector&) :project: oneIPL .. rubric:: Supported values for ComputeT: :class: sectiontitle .. csv-table:: :align: center :header: **float**,**double**,**half** v,v,x .. rubric:: Supported combinations for DataT/Formats: :class: sectiontitle .. csv-table:: :align: center :header: **DataT/Formats**,**plane**,**rgb/bgr**,**rgba/bgra**,**rgbp** **std::uint8_t** ,v,v,v,x **std::int8_t** ,v,v,v,x **std::uint16_t**,v,v,v,x **std::int16_t** ,v,v,v,x **std::uint32_t**,v,v,v,x **std::int32_t** ,v,v,v,x **float** ,v,v,v,x **double** ,v,v,v,x .. rubric:: Supported values for subsampled Format (only for DataT = ``std::uint8_t``): :class: sectiontitle .. csv-table:: :align: center :header: **nv12**,**i420** v,v .. rubric:: Parameters :class: sectiontitle .. list-table:: :header-rows: 0 * - border type support - Type of border. Possible values are: ``repl`` - Border is replicated from the edge pixels. .. doxygenclass:: oneapi::ipl::resize_bilinear_spec :project: oneIPL :members: .. rubric:: Errors :class: sectiontitle .. list-table:: :header-rows: 0 * - compile-time format check - Indicates an error when image format is not supported. * - compile-time data type check - Indicates an error when image data type is not supported. * - compile-time compute data type check - Indicates an error when compute data type is not supported. * - ``invalid_argument`` exception - Indicates an error when one of the pitch values is not divisible by size of component data type in bytes. * - ``unimplemented`` exception - Indicates an error when border type is not supported. The code example below demonstrates how to use the ``oneapi::ipl::resize_bilinear``: .. code-block:: cpp // Create queue sycl::queue queue{}; // Source rgba image data (image_image) image src_image{ src_data_pointer, src_size }; // Destination rgba image data (image_image) image dst_image{ dst_size }; (void)resize_bilinear(queue, src_image, dst_image);