6#include <cvb/global.hpp>
7#include <cvb/image.hpp>
8#include <cvb/pixel_format_converter.hpp>
27 converter->Execute(*srcImage, *dstImage);
40 std::cout <<
" Saved as: " << path << std::endl;
48 std::cout <<
"As a source, a Bayer pattern image is given." << std::endl;
51 auto srcImageFormatPair =
53 Save(*srcImageFormatPair.first, baseName + ToString(srcImageFormatPair.second) + extension);
55 std::cout <<
"As the destination, an RGB format is given." << std::endl;
58 std::cout <<
"Create a pixel format converter." << std::endl;
59 auto converter = std::make_shared<Cvb::PixelFormatConverter>(srcImageFormatPair.second, dstFormat);
61 std::cout <<
"Convert the source to another." << std::endl;
62 auto dstImage = GetAnotherRepresentation(srcImageFormatPair.first, converter);
64 std::cout <<
"Saving the converted image as a file." << std::endl;
65 Save(*dstImage, baseName + ToString(dstFormat) + extension);
The Common Vision Blox image.
Definition: decl_image.hpp:45
static std::unique_ptr< Image > FromPixelFormat(const Cvb::Size2D< int > &size, Cvb::PfncFormat format)
Creates an image from a specified pixel format.
Definition: decl_image.hpp:537
static std::unique_ptr< Image > Load(const String &fileName)
Loads an image with the given file name.
Definition: detail_image.hpp:32
PfncFormat
GenICam Pixel Format Naming Convention (PFNC) format values.
Definition: pfnc_format.hpp:21
@ BayerGB8
Bayer Green-Blue 8-bit.
std::string String
String for wide characters or unicode characters.
Definition: string.hpp:56