Image Descriptor Structure#

Description

The oneIPL image descriptor structure contains image metadata and a USM pointer to image data. The user is responsible for providing valid USM pointers accessible on the device where they will be used.

Include Files

oneapi/ipl.hpp

Domain Dependencies

Headers: oneapi/ipl.hpp

Libraries: oneipl.lib

Syntax

template<layouts Layout, typename DataT>
struct image_descriptor#

Class for image descriptor representation.

Template Parameters:
  • Layout – the given layout of an image

  • DataT – the given type of a pixel component

Public Types

using data_t = DataT#

Alias for the type of a pixel component.

using pixel_t = pixel_layout_t<DataT, Layout>#

Alias for image pixel type.

Public Functions

image_descriptor(DataT *data, const std::size_t pitch, const sycl::range<2> &size, const roi_rect &roi_rect)#

Constructor of image descriptor from the given data pointer, pitch, image 2D size and ROI.

Parameters:
  • data[in] pointer to image data

  • pitch[in] image pitch in bytes

  • size[in] 2D size of the image

  • roi_rect – region of interest (ROI)

Public Members

DataT *data#

pointer to image data

std::size_t pitch#

image pitch in bytes

sycl::range<2> size = {0, 0}#

2D size of the image

roi_rect roi = roi_rect{{0, 0}}#

region of interest (ROI)

Public Static Attributes

static constexpr auto layout_v = Layout#

Alias for the layout of an image.

static constexpr auto channel_count_v = detail::channel_count_v<Layout>#

Alias for the number of channels in batch images.

Possible combinations for DataT and not Subsampled formats:

DataT/Layouts

plane

channel3

channel4

plane3

std::uint8_t

std::int8_t

std::uint16_t

std::int16_t

std::uint32_t

std::int32_t

float

double

half

Supported values for subsampled layout (only for std::uint8_t data type):

sub420

sub420i

The code example below demonstrates how a oneapi::ipl::image_descriptor is constructed with USM memory and an image ROI:

using namespace oneapi;

const std::size_t           pitch{ width * 3 * sizeof(std::uint8_t) };
const sycl::range<2>        image_size{ height, width };
const ipl::roi_rect         roi_rect{ image_size / 6, image_size / 3 };

// 3-channel image data
ipl::image_descriptor<ipl::layouts::channel3, std::uint8_t> descriptor{ p_image_data, pitch, image_size, roi_rect };