IDSpeakIPL  v1.9.0
peak::ipl::PixelFormat Class Referencefinal

Represents a pixel format and its specific properties. More...

#include <peak_ipl/types/peak_ipl_pixel_format.hpp>

Public Member Functions

 PixelFormat ()
 Constructor for a new PixelFormat instance. More...
 
 PixelFormat (peak::ipl::PixelFormatName name)
 Constructor for a new PixelFormat instance. More...
 
 ~PixelFormat ()=default
 Destructor for the PixelFormat instance. More...
 
 PixelFormat (PixelFormat &&other)=default
 Copy Constructor for a new PixelFormat instance. More...
 
 PixelFormat (const PixelFormat &other)=default
 Move constructor for PixelFormat instance. More...
 
PixelFormat & operator= (const PixelFormat &other)=default
 Copy assigment for PixelFormat instance. More...
 
PixelFormat & operator= (PixelFormat &&other)=default
 Move assignment for PixelFormat instance. More...
 
PEAK_IPL_NO_DISCARD std::string Name () const
 Returns the name of the pixel format as String. More...
 
PEAK_IPL_NO_DISCARD peak::ipl::PixelFormatName PixelFormatName () const
 Returns the name of the pixel format as enum value. More...
 
PEAK_IPL_NO_DISCARD bool operator== (const PixelFormat &other) const
 Compare PixelFormat. More...
 
PEAK_IPL_NO_DISCARD size_t NumSignificantBitsPerChannel () const
 Returns the number of significant bits per pixel per channel of the given pixel format. More...
 
PEAK_IPL_NO_DISCARD size_t NumStorageBitsPerChannel () const
 Returns the number of storage bits per pixel per channel of the given pixel format. More...
 
PEAK_IPL_NO_DISCARD size_t NumChannels () const
 Returns the number of channels the given pixel format has. More...
 
PEAK_IPL_NO_DISCARD uint32_t MaximumValuePerChannel () const
 Returns the maximum value of one pixel channel the given pixel format has. More...
 
PEAK_IPL_NO_DISCARD size_t NumSignificantBitsPerPixel () const
 Returns the number of significant bits per pixel the given pixel format has. More...
 
PEAK_IPL_NO_DISCARD size_t NumStorageBitsPerPixel () const
 Returns the number of storage bits per pixel the given pixel format has. More...
 
PEAK_IPL_NO_DISCARD peak::ipl::Endianness Endianness () const
 Returns the endianness of the given pixel format. More...
 
PEAK_IPL_NO_DISCARD uint64_t CalculateStorageSizeOfPixels (uint64_t numPixels) const
 Returns the storage size the given number pixels of the given pixel format in bytes. More...
 
PEAK_IPL_NO_DISCARD bool IsPacked () const
 Returns whether the pixel format is packed. More...
 
PEAK_IPL_NO_DISCARD bool IsBayered () const
 Returns whether the pixel format is a bayer format. More...
 
PEAK_IPL_NO_DISCARD bool IsYUV () const
 Returns whether the pixel format is a yuv format. More...
 
PEAK_IPL_NO_DISCARD peak::ipl::BayerPattern BayerPattern () const
 Queries the bayer pattern of the given pixel format. More...
 

Detailed Description

Represents a pixel format and its specific properties.

Constructor & Destructor Documentation

◆ PixelFormat() [1/4]

peak::ipl::PixelFormat::PixelFormat ( )
inline

Constructor for a new PixelFormat instance.

Creates a new PixelFormat instance. The PixelFormatName is initialized to PixelFormatName::Invalid.

Since
1.0

◆ PixelFormat() [2/4]

peak::ipl::PixelFormat::PixelFormat ( peak::ipl::PixelFormatName  name)
inline

Constructor for a new PixelFormat instance.

Creates a new PixelFormat instance. The PixelFormatName is initialized to name.

Parameters
[in]nameUsed Pixel Format Name.
Since
1.0

◆ ~PixelFormat()

peak::ipl::PixelFormat::~PixelFormat ( )
default

Destructor for the PixelFormat instance.

Destroys a PixelFormat instance.

Since
1.0

◆ PixelFormat() [3/4]

peak::ipl::PixelFormat::PixelFormat ( PixelFormat &&  other)
default

Copy Constructor for a new PixelFormat instance.

Creates a new PixelFormat instance. The PixelFormatName is copied from other

Parameters
[in]otherThe other instance to copy the PixelFormatName from.
Since
1.0

◆ PixelFormat() [4/4]

peak::ipl::PixelFormat::PixelFormat ( const PixelFormat &  other)
default

Move constructor for PixelFormat instance.

Moves the PixelFormatName from other to this. Afterwards other is invalid.

Parameters
[in]otherThe other instance to move the PixelFormatName from.
Since
1.0

Member Function Documentation

◆ BayerPattern()

peak::ipl::BayerPattern peak::ipl::PixelFormat::BayerPattern ( ) const
inline

Queries the bayer pattern of the given pixel format.

Returns
The bayer pattern if the format is a bayer format. Or BayerPattern::None if the format has no Bayer pattern.
Since
1.8
Exceptions
ExceptionAn internal error has occurred.

◆ CalculateStorageSizeOfPixels()

uint64_t peak::ipl::PixelFormat::CalculateStorageSizeOfPixels ( uint64_t  numPixels) const
inline

Returns the storage size the given number pixels of the given pixel format in bytes.

For example, the calculation of the required buffer size, supply width multiplied by height here.

Parameters
[in]numPixelsThe number of pixels.
Returns
The calculated storage size for the number of pixels.
Since
1.0
Exceptions
ExceptionAn internal error has occurred.

◆ Endianness()

peak::ipl::Endianness peak::ipl::PixelFormat::Endianness ( ) const
inline

Returns the endianness of the given pixel format.

Returns
The endianness of the pixel format.
Since
1.0
Exceptions
ExceptionAn internal error has occurred.

◆ IsBayered()

bool peak::ipl::PixelFormat::IsBayered ( ) const
inline

Returns whether the pixel format is a bayer format.

Returns
Whether the pixel format is a bayer format. True for Bayer, false for all else.
Since
1.7
Exceptions
ExceptionAn internal error has occurred.

◆ IsPacked()

bool peak::ipl::PixelFormat::IsPacked ( ) const
inline

Returns whether the pixel format is packed.

Returns
Whether the pixel format is packed. True for packed, false for unpacked.
Since
1.7
Exceptions
ExceptionAn internal error has occurred.

◆ IsYUV()

bool peak::ipl::PixelFormat::IsYUV ( ) const
inline

Returns whether the pixel format is a yuv format.

Returns
Whether the pixel format is a yuv format. True for yuv, false for all else.
Since
1.9
Exceptions
ExceptionAn internal error has occurred.

◆ MaximumValuePerChannel()

uint32_t peak::ipl::PixelFormat::MaximumValuePerChannel ( ) const
inline

Returns the maximum value of one pixel channel the given pixel format has.

Returns
Maximum value of one pixel channel.
Since
1.0
Exceptions
ExceptionAn internal error has occurred.

◆ Name()

PEAK_IPL_NO_DISCARD std::string peak::ipl::PixelFormat::Name ( ) const
inline

Returns the name of the pixel format as String.

Returns
Name
Since
1.0

◆ NumChannels()

size_t peak::ipl::PixelFormat::NumChannels ( ) const
inline

Returns the number of channels the given pixel format has.

Returns
Number of channels for pixel format.
Since
1.0
Exceptions
ExceptionAn internal error has occurred.

◆ NumSignificantBitsPerChannel()

size_t peak::ipl::PixelFormat::NumSignificantBitsPerChannel ( ) const
inline

Returns the number of significant bits per pixel per channel of the given pixel format.

Returns
Number of significant bits per pixel per channel.
Since
1.0
Exceptions
ExceptionAn internal error has occurred.

◆ NumSignificantBitsPerPixel()

size_t peak::ipl::PixelFormat::NumSignificantBitsPerPixel ( ) const
inline

Returns the number of significant bits per pixel the given pixel format has.

Returns
Number of significant bits used.
Since
1.0
Exceptions
ExceptionAn internal error has occurred.

◆ NumStorageBitsPerChannel()

size_t peak::ipl::PixelFormat::NumStorageBitsPerChannel ( ) const
inline

Returns the number of storage bits per pixel per channel of the given pixel format.

Returns
Number of storage bits per pixel per channel.
Since
1.0
Exceptions
ExceptionAn internal error has occurred.

◆ NumStorageBitsPerPixel()

size_t peak::ipl::PixelFormat::NumStorageBitsPerPixel ( ) const
inline

Returns the number of storage bits per pixel the given pixel format has.

For unpacked formats, this is normally a multiple of 8. For packed formats, this is normally the same as NumSignificantBitsPerPixel.

Returns
Number of storage bits used.
Since
1.0
Exceptions
ExceptionAn internal error has occurred.

◆ operator=() [1/2]

PixelFormat& peak::ipl::PixelFormat::operator= ( const PixelFormat &  other)
default

Copy assigment for PixelFormat instance.

Copies the PixelFormatName from other to this instance.

Parameters
[in]otherThe other instance to copy the PixelFormatName from.
Since
1.0

◆ operator=() [2/2]

PixelFormat& peak::ipl::PixelFormat::operator= ( PixelFormat &&  other)
default

Move assignment for PixelFormat instance.

Moves the PixelFormatName from other to this.

Parameters
[in]otherThe other instance to move the PixelFormatName from.
Since
1.0

◆ operator==()

PEAK_IPL_NO_DISCARD bool peak::ipl::PixelFormat::operator== ( const PixelFormat &  other) const
inline

Compare PixelFormat.

Compares the PixelFormatName from other to this instance

Parameters
[in]otherThe other instance to compare.
Returns
True if equal, false otherwise.
Since
1.0

◆ PixelFormatName()

PEAK_IPL_NO_DISCARD peak::ipl::PixelFormatName peak::ipl::PixelFormat::PixelFormatName ( ) const
inline

Returns the name of the pixel format as enum value.

Returns
PixelFormatName
Since
1.0

The documentation for this class was generated from the following file: