CVB++ 15.0
detail_vpat.hpp
1#pragma once
2
3#include "../global.hpp"
4
5#include "../_decl/decl_vpat.hpp"
6#include "../_decl/decl_image.hpp"
7
8#include <cassert>
9
10namespace Cvb
11{
12
13 CVB_BEGIN_INLINE_NS
14
15 inline Vpat::Vpat(const Image &image, int plane)
16 : width_(image.Width())
17 {
18 void *basePtr = nullptr;
19 if (!CVB_CALL_CAPI(GetImageVPA(image.Handle(), static_cast<CExports::cvbdim_t>(plane), &basePtr,
20 reinterpret_cast<CExports::PVPAT *>(&vpatPtr_))))
21 Utilities::SystemInfo::ThrowLastError();
22
23 basePtr_ = reinterpret_cast<std::uint8_t *>(basePtr);
24
25 assert(basePtr_ != nullptr && vpatPtr_ != nullptr
26 && width_ > 0); // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
27 }
28
29 CVB_END_INLINE_NS
30
31} // namespace Cvb
The Common Vision Blox image.
Definition decl_image.hpp:50
Vpat() noexcept
cvbbool_t GetImageVPA(IMG Image, cvbval_t PlaneIndex, void **ppBase, PVPAT *ppVPAT)
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17