CVB++ 14.0
rgba_converter.hpp
1#pragma once
2
3#include "../_cexports/c_webstreaming.h"
4#include "converter.hpp"
5
6namespace Cvb
7{
8
9CVB_BEGIN_INLINE_NS
10
11namespace WebStreaming
12{
13
21 : public Converter
22{
23 private:
24
25 struct PrivateTag {};
26
27 public:
28
30
35 {
36 return Internal::DoResCallShareOut<RGBAConverter>([&](void*& handle)
37 {
38 return CVB_CALL_CAPI(CVWSCreateConverter(CExports::CVWSCT_Rgba, handle));
39 });
40 }
41
42 template<class T>
43 static RGBAConverterPtr FromHandle(HandleGuard<Converter>&& guard)
44 {
45 static_assert(std::is_same<RGBAConverter, T>::value, "CVB: T must be RGBAConverter");
46 if (!guard.Handle())
47 throw std::runtime_error("converter handle invalid");
48 return std::make_shared<T>(std::move(guard), PrivateTag{});
49 }
50
51 RGBAConverter(HandleGuard<Converter> && guard, PrivateTag) noexcept
52 : Converter(std::move(guard))
53 {
54 }
55};
56
57}
58
59CVB_END_INLINE_NS
60
61}
A converter object.
Definition: converter.hpp:29
A RGBA converter object.
Definition: rgba_converter.hpp:22
static RGBAConverterPtr Create()
Creates a new RGBA converter.
Definition: rgba_converter.hpp:34
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24