IDS peak ICV v1.6.0
Loading...
Searching...
No Matches
PixelFormatInfo Class Reference

#include <peak_common/types/peak_common_pixel_format.hpp>

Public Member Functions

 PixelFormatInfo (peak::common::PixelFormat pixelFormat)
 Constructs a PixelFormatInfo object for the specified pixel format.
 
 PixelFormatInfo (const std::string &name)
 Constructs a PixelFormatInfo object from the name of a pixel format.
 
template<typename T = size_t>
T GetMinimumValuePerChannel () const
 Returns the minimum possible value per channel for the pixel format.
 
template<typename T = size_t>
T GetMaximumValuePerChannel () const
 Returns the maximum possible value per channel for the pixel format.
 
size_t GetStorageBitsPerPixel () const
 Returns the total number of bits used per pixel for storage.
 
size_t GetStorageBitsPerChannel () const
 Returns the number of bits used per channel for storage.
 
std::string GetName () const
 Returns the human-readable name of the pixel format.
 
std::vector< Channel > GetChannels () const
 Returns the list of channels in the pixel format.
 
size_t GetAllocatedBitsPerPixel () const
 Returns the number of allocated bits per pixel.
 
bool HasIntensityChannel () const
 Checks whether the pixel format includes an intensity channel.
 
size_t GetChannelIndex (Channel channel) const
 Returns the index of a specific channel within the pixel format.
 
size_t GetNumberOfChannels () const
 Returns the total number of channels in the pixel format.
 
bool IsSingleChannel () const
 Checks whether the pixel format contains only a single channel.
 
bool HasChannel (Channel channel) const
 Checks whether a specific channel is present in the pixel format.
 
peak::common::PixelFormat GetPixelFormat () const
 Returns the underlying pixel format enumeration value.
 
size_t GetSizeInBytes (const Size &size) const
 Calculates the memory size in bytes for a given image size.
 
bool IsPacked () const
 Returns whether the pixel format is packed.
 
bool IsInterleaved () const
 Indicates whether the pixel format is interleaved.
 
bool IsFloat () const
 Returns whether the pixel format uses floating points.
 
PixelFormat GetUnpackedPixelFormat () const
 Returns the unpacked pixel format for a packed pixel format.
 
template<>
size_t GetMinimumValuePerChannel () const
 
template<>
float GetMinimumValuePerChannel () const
 
template<>
size_t GetMaximumValuePerChannel () const
 
template<>
float GetMaximumValuePerChannel () const
 

Detailed Description

Provides information and utility functions for pixel formats.

The PixelFormatInfo class offers methods to query characteristics of specific pixel formats, such as value ranges, storage sizes, and channel configurations.

Since
ids_peak_common 1.0

Constructor & Destructor Documentation

◆ PixelFormatInfo() [1/2]

PixelFormatInfo ( peak::common::PixelFormat pixelFormat)
inlineexplicit

Constructs a PixelFormatInfo object for the specified pixel format.

Parameters
pixelFormatThe pixel format to describe.
Since
ids_peak_common 1.0

◆ PixelFormatInfo() [2/2]

PixelFormatInfo ( const std::string & name)
inlineexplicit

Constructs a PixelFormatInfo object from the name of a pixel format.

Parameters
nameThe name of the pixel format.
Since
ids_peak_common 1.0

Member Function Documentation

◆ GetAllocatedBitsPerPixel()

size_t GetAllocatedBitsPerPixel ( ) const
inline

Returns the number of allocated bits per pixel.

Returns
Number of allocated bits per pixel.
Since
ids_peak_common 1.0

◆ GetChannelIndex()

size_t GetChannelIndex ( Channel channel) const
inline

Returns the index of a specific channel within the pixel format.

Parameters
channelThe channel to locate.
Returns
The zero-based index of the channel.
Since
ids_peak_common 1.0

◆ GetChannels()

std::vector< Channel > GetChannels ( ) const
inline

Returns the list of channels in the pixel format.

Returns
A vector containing the channels present in the pixel format.
Since
ids_peak_common 1.0

◆ GetMaximumValuePerChannel() [1/3]

template<>
size_t GetMaximumValuePerChannel ( ) const
inline

◆ GetMaximumValuePerChannel() [2/3]

template<>
float GetMaximumValuePerChannel ( ) const
inline

◆ GetMaximumValuePerChannel() [3/3]

template<typename T >
T GetMaximumValuePerChannel ( ) const

Returns the maximum possible value per channel for the pixel format.

Template Parameters
TThe value type (default is size_t).
Returns
The maximum value per channel.
Since
ids_peak_common 1.0

◆ GetMinimumValuePerChannel() [1/3]

template<>
size_t GetMinimumValuePerChannel ( ) const
inline

◆ GetMinimumValuePerChannel() [2/3]

template<>
float GetMinimumValuePerChannel ( ) const
inline

◆ GetMinimumValuePerChannel() [3/3]

template<typename T >
T GetMinimumValuePerChannel ( ) const

Returns the minimum possible value per channel for the pixel format.

Template Parameters
TThe value type (default is size_t).
Returns
The minimum value per channel.
Since
ids_peak_common 1.0

◆ GetName()

std::string GetName ( ) const
inline

Returns the human-readable name of the pixel format.

Returns
Name of the pixel format.
Since
ids_peak_common 1.0

◆ GetNumberOfChannels()

size_t GetNumberOfChannels ( ) const
inline

Returns the total number of channels in the pixel format.

Returns
Number of channels.
Since
ids_peak_common 1.0

◆ GetPixelFormat()

peak::common::PixelFormat GetPixelFormat ( ) const
inline

Returns the underlying pixel format enumeration value.

Returns
The pixel format.
Since
ids_peak_common 1.0

◆ GetSizeInBytes()

size_t GetSizeInBytes ( const Size & size) const
inline

Calculates the memory size in bytes for a given image size.

Parameters
sizeThe size of the image.
Returns
The total memory size in bytes.
Since
ids_peak_common 1.0

◆ GetStorageBitsPerChannel()

size_t GetStorageBitsPerChannel ( ) const
inline

Returns the number of bits used per channel for storage.

Returns
Bits per channel used for storage.
Since
ids_peak_common 1.0

◆ GetStorageBitsPerPixel()

size_t GetStorageBitsPerPixel ( ) const
inline

Returns the total number of bits used per pixel for storage.

Returns
Bits per pixel used for storage.
Since
ids_peak_common 1.0

◆ GetUnpackedPixelFormat()

PixelFormat GetUnpackedPixelFormat ( ) const
inline

Returns the unpacked pixel format for a packed pixel format.

If the pixel format is already unpacked, the same format is returned.

Returns
An unpacked pixel format
Since
ids_peak_common 1.1

◆ HasChannel()

bool HasChannel ( Channel channel) const
inline

Checks whether a specific channel is present in the pixel format.

Parameters
channelThe channel to check for.
Returns
True if the channel exists in the pixel format, false otherwise.
Since
ids_peak_common 1.0

◆ HasIntensityChannel()

bool HasIntensityChannel ( ) const
inline

Checks whether the pixel format includes an intensity channel.

Returns
True if an intensity channel is present, false otherwise.
Since
ids_peak_common 1.0

◆ IsFloat()

bool IsFloat ( ) const
inline

Returns whether the pixel format uses floating points.

Returns
Bool whether format uses floating points
Since
ids_peak_common 1.1

◆ IsInterleaved()

bool IsInterleaved ( ) const
inline

Indicates whether the pixel format is interleaved.

Interleaved pixel formats arrange multiple image streams in memory using different patterns. The exact interleaving strategy depends on the pixel format family:

Mono*_A_B Images A and B alternate by row:

Memory row 1: Image A (row 1) Memory row 2: Image B (row 1) Memory row 3: Image A (row 2) Memory row 4: Image B (row 2) ...

Bayer*_A_B Images A and B are grouped in pairs of rows:

Memory row 1: Image A (row 1) Memory row 2: Image A (row 2) Memory row 3: Image B (row 1) Memory row 4: Image B (row 2) Memory row 5: Image A (row 3) Memory row 6: Image A (row 4) Memory row 7: Image B (row 3) Memory row 8: Image B (row 4) ...

Mono*_AB_CD Four image streams (A, B, C, D) are interleaved within each row:

Memory row 1: | A | B | A | B | A | B | Memory row 2: | C | D | C | D | C | D | Memory row 3: | A | B | A | B | A | B | Memory row 4: | C | D | C | D | C | D | ...

Since
ids_peak_common 1.2

◆ IsPacked()

bool IsPacked ( ) const
inline

Returns whether the pixel format is packed.

Returns
Bool whether format is packed
Since
ids_peak_common 1.1

◆ IsSingleChannel()

bool IsSingleChannel ( ) const
inline

Checks whether the pixel format contains only a single channel.

Returns
True if the pixel format is single-channel, false otherwise.
Since
ids_peak_common 1.0