Mirror

Mirrors an image about the specified axis.

Description

This function mirrors the source image about the axis defined in mirror_spec class. This function supports only vertical axis and uses it by default. This function can operate with ROI (see Image Regions of Interest).

Headers

oneapi/ipl/transform/mirror.hpp

Syntax

template<formats Format, typename DataT, typename SrcAllocatorT, typename DstAllocatorT>
sycl::event oneapi::ipl::mirror(sycl::queue &queue, image<Format, DataT, SrcAllocatorT> &src, image<Format, DataT, DstAllocatorT> &dst, const mirror_spec &spec = {}, const std::vector<sycl::event> &dependencies = {})

Mirror.

Template Parameters
  • Format – the given format of an image

  • DataT – the given type of a pixel component

  • SrcAllocatorT – the given type of source image memory allocator

  • DstAllocatorT – the given type of destination image memory allocator

Parameters
  • queue – SYCL queue

  • src – source image

  • dst – destination image

  • spec – algorithmic specification

  • dependencies – dependencies

Returns

SYCL event

Parameters

axis type support

Type of axis. Possible values are:

vertical - Specifies the vertical axis to mirror the image about.

class oneapi::ipl::mirror_spec

Mirror specification.

Public Functions

constexpr mirror_spec() noexcept = default

Construct mirror specification with default vertical axis.

inline explicit constexpr mirror_spec(const ipl::axes axis) noexcept

Construct mirror specification.

Parameters

axis – of mirror

inline constexpr ipl::axes get_axis() const noexcept

Returns the axis of mirror.

Returns

the axis of mirror

Supported values for ComputeT:

float

double

half

v

v

x

Supported combinations for DataT/Formats:

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

Supported values for subsampled Format (only for DataT = std::uint8_t):

nv12

i420

x

x

Errors

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 ROI sizes of the source image and the destination image are not equal.

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 axis defined in mirror specification class has an illegal value.

The code example below demonstrates how to use the oneapi::ipl::mirror:

// Create queue
sycl::queue queue{};

// Create source and destination images
image<formats::rgba, std::uint8_t> src_image{ src_data_pointer, size };
image<formats::rgba, std::uint8_t> dst_image{ size };

// Create mirror image. Axis of mirror is vertical by default
(void)mirror(queue, src_image, dst_image);