5#include "../global.hpp"
7#include "decl_image.hpp"
15 inline HandleGuard<WrappedImage>::HandleGuard(
void *handle) noexcept
16 : HandleGuard<WrappedImage>(handle, [](
void *handle) { CVB_CALL_CAPI(
ReleaseObject(handle)); })
27 class WrappedImage :
public Image
47 DataType dataType,
int pixelStride,
int lineStride)
50 return Create(buffer, bufferSize, width, height, dataType, pixelStride, lineStride, 0, planeOrder);
82 DataType dataType,
int pixelStride,
int lineStride,
86 return Create(buffer, bufferSize, width, height, dataType, pixelStride, lineStride, planeStride, planeOrder);
105 DataType dataType,
int pixelStride,
int lineStride,
109 return Create(buffer, bufferSize, width, height, dataType, pixelStride, lineStride, planeStride, planeOrder);
134 explicit WrappedImage(HandleGuard<Image> &&guard) noexcept
139 template <std::
size_t N>
141 int pixelStride,
int lineStride,
int planeStride,
144 return Internal::DoResCallObjectOut<WrappedImage>([=](
void *&handle) {
147 buffer,
static_cast<std::size_t>(bufferSize),
static_cast<CExports::cvbdim_t
>(width),
148 static_cast<CExports::cvbdim_t
>(height),
static_cast<CExports::cvbdim_t
>(N),
149 static_cast<CExports::cvbdatatype_t
>(dataType.NativeDescriptor()),
static_cast<std::intptr_t>(pixelStride),
151 [](
void *,
void *) {},
nullptr, handle));
27 class WrappedImage :
public Image {
…};
Data type description for an image plane.
Definition data_type.hpp:23
static DataType FromNativeType() noexcept
Construct a data type descriptor from one of the native data type value equivalents.
Definition data_type.hpp:173
Array interface.
Definition iarray.hpp:16
The Common Vision Blox image.
Definition decl_image.hpp:50
static std::unique_ptr< Image > FromHandle(HandleGuard< Image > &&guard)
Creates an image from a classic API handle.
Definition decl_image.hpp:160
A wrapped image wraps another pixel buffer without owning it.
Definition decl_wrapped_image.hpp:28
static std::unique_ptr< WrappedImage > FromRgbPixels(void *buffer, int bufferSize, int width, int height, DataType dataType, int pixelStride, int lineStride, int planeStride)
Wraps, without copying, the given RGB pixel buffer in a CvbImage.
Definition decl_wrapped_image.hpp:81
static std::unique_ptr< WrappedImage > FromHandle(HandleGuard< WrappedImage > &&guard)
Creates a wrapped image from a classic API handle.
Definition decl_wrapped_image.hpp:128
static std::unique_ptr< WrappedImage > FromGrey8Pixels(void *buffer, int width, int height)
Wraps, without copying, the given Mono8 pixel buffer in a CvbImage.
Definition decl_wrapped_image.hpp:61
static std::unique_ptr< WrappedImage > FromBgrPixels(void *buffer, int bufferSize, int width, int height, DataType dataType, int pixelStride, int lineStride, int planeStride)
Wraps, without copying, the given BGR pixel buffer in a CvbImage.
Definition decl_wrapped_image.hpp:104
static std::unique_ptr< WrappedImage > FromGreyPixels(void *buffer, int bufferSize, int width, int height, DataType dataType, int pixelStride, int lineStride)
Wraps, without copying, the given monochrome pixel buffer in an image.
Definition decl_wrapped_image.hpp:46
cvbres_t CreateImageFromPointer(void *pImageMemory, size_t MemorySize, cvbdim_t Width, cvbdim_t Height, cvbdim_t NumPlanes, cvbdatatype_t DataType, intptr_t PitchX, intptr_t PitchY, intptr_t PitchPlane, const cvbval_t PlaneOrder[], PFFINALRELEASE ReleaseCallback, void *pPrivate, IMG &ImageOut)
cvbbool_t ReleaseObject(OBJ &Object)
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17