3#include "../_cexports/c_bayer_to_rgb.h"
5#include "../global.hpp"
7#include "../exception.hpp"
8#include "../wrapped_image.hpp"
9#include "../white_balance.hpp"
11#include "../size_2d.hpp"
12#include "../area_2d.hpp"
96 return Internal::DoResCallObjectOut<Image>([&](
void *&resimg) {
100 etCreateOutputImage(dummy->Handle(), resimg,
static_cast<CExports::B2RGB_InterpolationMode
>(mode)));
140 CExports::IMG dstHandle = imageDst.
Handle();
141 CVB_CALL_CAPI_CHECKED(
142 etBayerToRGB(imageSrc.
Handle(), dstHandle,
static_cast<CExports::B2RGB_PixelMode
>(pattern),
143 static_cast<CExports::B2RGB_InterpolationMode
>(conversion),
144 static_cast<CExports::B2RGB_Gamma
>(gamma),
reinterpret_cast<CExports::WB &
>(whiteBalance)));
163 return Internal::DoResCallObjectOut<Image>([&](
void *&resimg) {
166 return CVB_CALL_CAPI(etBayerToRGB(image.
Handle(), resimg,
static_cast<CExports::B2RGB_PixelMode
>(pattern),
167 static_cast<CExports::B2RGB_InterpolationMode
>(conversion),
168 static_cast<CExports::B2RGB_Gamma
>(gamma),
169 reinterpret_cast<CExports::WB &
>(whiteBalance)));
188 return Internal::DoResCallObjectOut<Image>([&](
void *&resimg) {
191 return CVB_CALL_CAPI(etBayerToMono(image.
Handle(), resimg,
static_cast<CExports::B2RGB_PixelMode
>(pattern),
192 static_cast<CExports::B2RGB_InterpolationMode
>(conversion),
193 static_cast<CExports::B2RGB_Gamma
>(gamma),
194 reinterpret_cast<CExports::WB &
>(whiteBalance)));
208 return Internal::DoResCallObjectOut<Image>([&](
void *&resimg) {
209 return CVB_CALL_CAPI(etRGBToBayer(image.
Handle(), resimg,
static_cast<CExports::B2RGB_PixelMode
>(pattern)));
226 CVB_CALL_CAPI_CHECKED(etWhiteBalance(image.
Handle(),
static_cast<CExports::B2RGB_PixelMode
>(pattern),
227 CExports::WB_SET,
reinterpret_cast<CExports::TArea &
>(aoi),
228 reinterpret_cast<CExports::WB &
>(wb)));
Structure that represents an area of interest in the image.
Definition area_2d.hpp:21
The Common Vision Blox image.
Definition decl_image.hpp:50
void RaisePixelContentChanged() const
Inform clients listening to the pixel content changed event, that the image data has been completely ...
Definition decl_image.hpp:448
Rect< int > Bounds() const noexcept
Bounding rectangle of the image in pixels.
Definition decl_image.hpp:438
void * Handle() const noexcept
Classic API image handle.
Definition decl_image.hpp:237
Rectangle object.
Definition rect.hpp:24
Stores a pair of numbers that represents the width and the height of a subject, typically a rectangle...
Definition size_2d.hpp:20
T Height() const noexcept
Gets the vertical component of the size.
Definition size_2d.hpp:77
T Width() const noexcept
Gets the horizontal component of the size.
Definition size_2d.hpp:57
Factors for white balance correction.
Definition white_balance.hpp:22
static WhiteBalanceFactors Identity() noexcept
Identity transformation leaving all values as they are.
Definition white_balance.hpp:112
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
Namespace for collection of functions converting images with a Bayer pattern.
Definition bayer_conversion.hpp:27
BayerPattern
Bayer pattern of the sensor used to acquire the image to be converted.
Definition bayer_conversion.hpp:58
@ GreenRed
Left top pixels are green and red.
Definition bayer_conversion.hpp:66
@ GreenBlue
Left top pixels are green and blue.
Definition bayer_conversion.hpp:60
@ RedGreen
Left top pixels are red and green.
Definition bayer_conversion.hpp:64
@ BlueGreen
Left top pixels are blue and green.
Definition bayer_conversion.hpp:62
GammaCorrection
Different gamma corrections that can be applied while converting from Bayer pattern to RGB.
Definition bayer_conversion.hpp:71
@ Gamma045
Correct with Gamma = 0.45.
Definition bayer_conversion.hpp:75
@ Gamma060
Correct with Gamma = 0.6.
Definition bayer_conversion.hpp:77
@ Gamma100
Correct with Gamma = 1.0 (i.e. no correction).
Definition bayer_conversion.hpp:73
WhiteBalanceFactors GetWhiteBalance(const Image &image, BayerPattern pattern, Area2D aoi)
Determine a suitable white balance from a monochrome image with Bayer pattern.
Definition bayer_conversion.hpp:222
std::unique_ptr< Image > BayerToMono(const Image &image, BayerPattern pattern, RGBConversion conversion, GammaCorrection gamma=GammaCorrection::Gamma100, WhiteBalanceFactors whiteBalance=WhiteBalanceFactors::Identity())
Convert a monochrome image with a Bayer pattern to a proper monochrome image.
Definition bayer_conversion.hpp:184
void BayerToRGB(const Image &imageSrc, Image &imageDst, BayerPattern pattern, RGBConversion conversion, GammaCorrection gamma=GammaCorrection::Gamma100, WhiteBalanceFactors whiteBalance=WhiteBalanceFactors::Identity())
Convert a Bayer-pattern image to an RGB image.
Definition bayer_conversion.hpp:134
RGBConversion
Available conversion modes from Bayer patterns to RGB images.
Definition bayer_conversion.hpp:31
@ Linear
Definition bayer_conversion.hpp:37
@ HalfResolution
Definition bayer_conversion.hpp:50
@ NearestNeighbor
Definition bayer_conversion.hpp:43
std::unique_ptr< Image > RGBToBayer(const Image &image, BayerPattern pattern)
Convert an RGB image to a monochrome image with Bayer pattern.
Definition bayer_conversion.hpp:206
std::unique_ptr< Image > CreateDestinationImage(int width, int height, RGBConversion mode)
Create a destination image for Bayer to RGB conversions.
Definition bayer_conversion.hpp:94
Namespace for the Foundation package.
Definition decl_metric_aqs12_calibration_piece.hpp:11
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17