4#include "codec_bridge.hpp"
5#include "../global.hpp"
6#include "../utilities/system_info.hpp"
17 inline HandleGuard<CodecBridge::FormatConverter>::HandleGuard(
void* handle) noexcept
18 : HandleGuard<CodecBridge::FormatConverter>(handle, [](
void* handle) { CVB_CALL_CAPI(ReleaseObject(handle)); })
47 return Internal::DoResCallObjectOut<FormatConverter>([&](
void*& handle)
49 return CVB_CALL_CAPI(CVCBCreateFormatConverter(srcSize.
Width(), srcSize.
Height(),
static_cast<CExports::CVCBPixelFormat
>(srcFormat),
50 dstSize.
Width(), dstSize.
Height(),
static_cast<CExports::CVCBPixelFormat
>(dstFormat),
51 static_cast<CExports::CVCBInterpolation
>(method), handle));
60 return std::make_unique<FormatConverter>(std::move(guard));
63 explicit FormatConverter(HandleGuard<FormatConverter>&& guard) noexcept
64 : handle_(std::move(guard))
69 FormatConverter(
const FormatConverter& other) =
delete;
70 FormatConverter& operator=(
const FormatConverter& other) =
delete;
71 FormatConverter(FormatConverter&& other) =
delete;
72 FormatConverter& operator=(FormatConverter&& other) =
delete;
74 ~FormatConverter() =
default;
76 void* Handle() const noexcept
78 return handle_.Handle();
91 CVB_CALL_CAPI(CVCBFormatConverterExecute(Handle(), srcFrame.Handle(), dstFrame.Handle()));
97 HandleGuard<FormatConverter> handle_;
A video frame for encoding and decoding.
Definition: frame.hpp:30
T Height() const noexcept
Gets the vertical component of the size.
Definition: size_2d.hpp:79
T Width() const noexcept
Gets the horizontal component of the size.
Definition: size_2d.hpp:59
PixelFormat
Subset of FFmpeg pixel formats.
Definition: codec_bridge.hpp:92
Interpolation
Interpolation method when scaling frames.
Definition: codec_bridge.hpp:176
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24