CVB++ 15.0
PixelFormatConverter Class Referencefinal

Helper class that takes care of pixel format conversion. More...

#include <cvb/pixel_format_converter.hpp>

Public Member Functions

 PixelFormatConverter (PfncFormat sourceFormat, PfncFormat destinationFormat)
 Constructor. More...
 
void * Handle () const noexcept
 Classic API handle. More...
 
Cvb::PfncFormat SourceFormat () const noexcept
 Gets the source pixel format. More...
 
Cvb::PfncFormat DestinationFormat () const noexcept
 Gets the destination pixel format. More...
 
template<class T >
void Execute (const T &sourceObject, Image &destinationObject)
 Converts a PFNC compliant object to another. More...
 

Static Public Member Functions

static std::unique_ptr< PixelFormatConverterCreate (PfncFormat sourceFormat, PfncFormat destinationFormat)
 Creates a pixel format converter. More...
 

Detailed Description

Helper class that takes care of pixel format conversion.

Constructor & Destructor Documentation

◆ PixelFormatConverter()

PixelFormatConverter ( PfncFormat  sourceFormat,
PfncFormat  destinationFormat 
)
inline

Constructor.

Parameters
[in]sourceFormatSource pixel format.
[in]destinationFormatDestination pixel format.
Exceptions
Anyexception derived from std::exception including CvbException.

Instantiates a converter object that converts source pixel format image to destination pixel format image.

See also
Execute

Member Function Documentation

◆ Create()

static std::unique_ptr< PixelFormatConverter > Create ( PfncFormat  sourceFormat,
PfncFormat  destinationFormat 
)
inlinestatic

Creates a pixel format converter.

Parameters
[in]sourceFormatSource pixel format.
[in]destinationFormatDestination pixel format.
Returns
Pointer to the created pixel format converter.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ DestinationFormat()

Cvb::PfncFormat DestinationFormat ( ) const
inlinenoexcept

Gets the destination pixel format.

Returns
Destination pixel format.
Exceptions
Doesnot throw any exception.

◆ Execute()

void Execute ( const T &  sourceObject,
Image destinationObject 
)
inline

Converts a PFNC compliant object to another.

Parameters
[in]sourceObjectData source to be converted.
[out]destinationObjectDestination object that stores the converted data.
Template Parameters
TInput object type.
Exceptions
Anyexception derived from std::exception including CvbException.

Note that the source object must implement IPFNCBuffer class, and both arguments must follow the converter's pixel format configuration.

See also
SourceFormat DestinationFormat

◆ Handle()

void * Handle ( ) const
inlinenoexcept

Classic API handle.

Returns
Classic API handle.
Exceptions
Doesnot throw any exception.

It is normally not necessary to work with this handle.

◆ SourceFormat()

Cvb::PfncFormat SourceFormat ( ) const
inlinenoexcept

Gets the source pixel format.

Returns
Source pixel format.
Exceptions
Doesnot throw any exception.