Copy Operation#

Copies the image data.

Description

This function copies pixel values in the source image to the destination image. This function can operate with ROI (see Image Regions of Interest).

Headers

oneapi/ipl/misc/copy.hpp

Syntax

template<typename SrcImageT, typename DstImageT>
sycl::event oneapi::ipl::copy(sycl::queue &queue, SrcImageT &src, DstImageT &dst, const copy_spec &spec = {}, const std::vector<sycl::event> &dependencies = {})#

Copy image without type conversion.

Template Parameters
  • SrcImageT – Source image type

  • DstImageT – Destination image type

Parameters
  • queue – SYCL queue

  • src – source image

  • dst – destination image

  • dependencies – dependencies

Returns

SYCL event

Supported combinations for DataT/Layouts:

DataT/Layouts

plane

channel3

channel4

plane3

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 layout (only for std::uint8_t data type):

sub420

sub420i

x

x

Parameters

class copy_spec#

Copy specification (empty class, no parameters).

Errors

compile-time memory layout check

Indicates an error when image memory layout is not supported.

compile-time data type check

Indicates an error when image 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.

The code example below demonstrates how shall be called oneapi::ipl::copy:

using namespace oneapi;

sycl::queue                 queue;
ipl::shared_usm_allocator_t allocator{ queue };
const sycl::range<2>        image_size{ height, width };

// Source 4-channel image data
ipl::image<ipl::layouts::channel4, std::uint8_t> src_image{ queue, p_image_data, image_size, allocator };
// Destination 4-channel image data
ipl::image<ipl::layouts::channel4, std::uint8_t> dst_image{ image_size, allocator };

// Copy image
auto event = ipl::copy(queue, src_image, dst_image);