Image Utils¶
Description
Image utils class provides additional functionality for working with images.
Include Files
oneapi/ipl.hpp
Domain Dependencies
Headers: oneapi/ipl.hpp
Libraries: oneipl.lib
Syntax
-
class oneapi::ipl::image_utils¶
Provides additional functionality for working with images.
Public Static Functions
-
template<formats Format, typename DataT, typename AllocatorT>
static std::size_t get_width(const ipl::image<Format, DataT, AllocatorT> &image)¶ Returns the width of the ROI (for the whole image returns the width of the image).
- Template Parameters
Format – the given format of an image
DataT – the given type of a pixel component
AllocatorT – the given type of an allocator
- Parameters
image – [in] the given image
- Returns
the width of the ROI
-
template<formats Format, typename DataT, typename AllocatorT>
static std::size_t get_height(const ipl::image<Format, DataT, AllocatorT> &image)¶ Returns the height of the ROI (for the whole image returns the height of the image).
- Template Parameters
Format – the given format of an image
DataT – the given type of a pixel component
AllocatorT – the given type of an allocator
- Parameters
image – [in] the given image
- Returns
the height of the ROI
-
template<formats Format, typename DataT, typename AllocatorT>
static void flush(ipl::image<Format, DataT, AllocatorT> &image)¶ Clears all events associated with the
image
.- Template Parameters
Format – the given format of an image
DataT – the given type of a pixel component
AllocatorT – the given type of an allocator
- Parameters
image – [in] the given image
-
template<formats Format, typename DataT, typename AllocatorT>
The code example below demonstrates how to use the
oneapi::ipl::image_utils
:
// Create queue
sycl::queue queue{};
// Create allocator
shared_usm_allocator_t allocator{ queue };
// RGB image (usm_image)
image<formats::rgb, std::uint8_t> usm_image{ queue, src_data_pointer, image_size, allocator };
const auto width = oneapi::ipl::image_utils::get_width(usm_image);
const auto height = oneapi::ipl::image_utils::get_height(usm_image);
std::cout << "width = " << width << std::endl;
std::cout << "height = " << height << std::endl;