Provides information and utility functions for pixel formats.
More...
#include <peak_common/types/peak_common_pixel_format.hpp>
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
◆ PixelFormatInfo() [1/2]
Constructs a PixelFormatInfo object for the specified pixel format.
- Parameters
-
| pixelFormat | The pixel format to describe. |
- Since
- ids_peak_common 1.0
◆ PixelFormatInfo() [2/2]
Constructs a PixelFormatInfo object from the name of a pixel format.
- Parameters
-
| name | The name of the pixel format. |
- Since
- ids_peak_common 1.0
◆ 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
-
| channel | The 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()
template<typename T>
| T GetMaximumValuePerChannel |
( |
| ) |
const |
Returns the maximum possible value per channel for the pixel format.
- Template Parameters
-
| T | The value type (default is size_t). |
- Returns
- The maximum value per channel.
- Since
- ids_peak_common 1.0
◆ GetMinimumValuePerChannel()
template<typename T>
| T GetMinimumValuePerChannel |
( |
| ) |
const |
Returns the minimum possible value per channel for the pixel format.
- Template Parameters
-
| T | The 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()
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
-
| size | The 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()
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
-
| channel | The 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()
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()
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
The documentation for this class was generated from the following files: