3#include "buffer_base.hpp"
5#include "pfnc_format.hpp"
14 class PFNCBuffer :
public BufferBase
22 PFNCBuffer(HandleGuard<BufferBase> &&guard, PrivateTag)
25 if (!CVB_CALL_CAPI(CVCIsPfncBuffer(
Handle())))
58 CVB_CALL_CAPI(CVCBufferGetPFNCValue(
Handle(), pfncFormat));
59 return static_cast<int>(pfncFormat);
72 CExports::cvbdim_t rank = 0;
73 CVB_CALL_CAPI(CVCBufferGetRank(
Handle(), rank));
74 return static_cast<int>(rank);
90 return static_cast<int>(NativeCall<CExports::cvbint64_t>([
this, dimension](CExports::cvbint64_t &value) {
91 return CVB_CALL_CAPI(CVCBufferGetLength(
Handle(),
static_cast<CExports::cvbdim_t
>(dimension), value));
110 return NativeCall<std::intptr_t>([
this, dimension](
std::intptr_t &ptr) {
111 return CVB_CALL_CAPI(CVCBufferGetIncrement(
Handle(),
static_cast<CExports::cvbdim_t
>(dimension), ptr));
116 template <
class T,
class FN>
117 T NativeCall(
const FN &fn)
const
120 const auto result = fn(value);
122 Utilities::SystemInfo::ThrowLastError(result);
14 class PFNCBuffer :
public BufferBase {
…};
void * Handle() const noexcept
Classic API buffer handle.
Definition buffer_base.hpp:46
int Length(int dimension) const
Gets the number of elements in the given Dimension.
Definition pfnc_buffer.hpp:88
static PFNCBufferPtr FromHandle(HandleGuard< BufferBase > &&guard)
Creates a pfnc buffer from a classic API handle.
Definition pfnc_buffer.hpp:33
int Rank() const noexcept
Gets the number of dimensions of this buffer.
Definition pfnc_buffer.hpp:70
int PFNCValue() const noexcept
Gets the PFNC value (format identifier) of this buffer.
Definition pfnc_buffer.hpp:55
std::intptr_t Increment(int dimension) const
Gets the increment to the next element in the given Dimension.
Definition pfnc_buffer.hpp:108
@ InvalidPixelFormat
Invalid pixel format.
Definition pfnc_format.hpp:997
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17
std::shared_ptr< PFNCBuffer > PFNCBufferPtr
Convenience shared pointer for PFNCBuffer.
Definition global.hpp:70