Public Member Functions | |
| str | __str__ (self) |
| Return a human-readable string of the PixelFormat object. | |
| str | __repr__ (self) |
| Return an unambiguous string of the PixelFormat object. | |
| Union[int, float] | minimum_value_per_channel (self) |
| Returns the minimum possible value per channel for the pixel format. | |
| Union[int, float] | maximum_value_per_channel (self) |
| Returns the maximum possible value per channel for the pixel format. | |
| int | storage_bits_per_channel (self) |
| Returns the number of bits used per channel for storage. | |
| int | storage_bits_per_pixel (self) |
| Returns the total number of bits used per pixel for storage. | |
| str | string_value (self) |
| Returns the human-readable name of the pixel format. | |
| Tuple[Channel,...] | channels (self) |
| Returns the list of channels in the pixel format. | |
| int | allocated_bits_per_pixel (self) |
| Returns the number of allocated bits per pixel. | |
| str | numpy_dtype (self) |
| Returns the numpy dtype string for this pixel format. | |
| bool | has_intensity_channel (self) |
| Returns True if the pixel format has an intensity channel. | |
| int | number_of_channels (self) |
| Returns the total number of channels in the pixel format. | |
| bool | is_single_channel (self) |
| Returns True if the pixel format has only a single channel. | |
| bool | is_packed (self) |
| Returns True if the pixel format is packed. | |
| bool | is_interleaved (self) |
| Indicates whether the pixel format is interleaved. | |
| PixelFormat | unpacked_format (self) |
| Returns the unpacked pixel format for a packed pixel format. | |
| int | get_channel_index (self, Channel channel) |
| Returns the index of a specific channel within the pixel format. | |
| bool | has_channel (self, Channel channel) |
| Returns True if the pixel format has a specific channel. | |
| int | get_size_in_bytes (self, Size size) |
| Calculates the memory size in bytes for a given image size. | |
| bool | is_float (self) |
Static Public Member Functions | |
| PixelFormat | create_from_string_value (str string_value) |
Data Fields | |
| is_float | |
| channels | |
Protected Member Functions | |
| _PixelFormatMetadata | _metadata (self) |
Enum listing all supported pixel formats and their internal IDs.
Each enumerator represents a specific pixel layout and bit depth, used for interpreting raw image data correctly.
This class also offers methods to query characteristics of specific pixel formats, such as value ranges, storage sizes, and channel configurations.
| str __repr__ | ( | self | ) |
Return an unambiguous string of the PixelFormat object.
| str __str__ | ( | self | ) |
Return a human-readable string of the PixelFormat object.
|
protected |
| int allocated_bits_per_pixel | ( | self | ) |
Returns the number of allocated bits per pixel.
| Tuple[Channel, ...] channels | ( | self | ) |
Returns the list of channels in the pixel format.
|
static |
| int get_channel_index | ( | self, | |
| Channel | channel ) |
Returns the index of a specific channel within the pixel format.
| int get_size_in_bytes | ( | self, | |
| Size | size ) |
Calculates the memory size in bytes for a given image size.
| bool has_channel | ( | self, | |
| Channel | channel ) |
Returns True if the pixel format has a specific channel.
| bool has_intensity_channel | ( | self | ) |
Returns True if the pixel format has an intensity channel.
| bool is_float | ( | self | ) |
| bool is_interleaved | ( | self | ) |
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 | ...
Returns: bool: True if the pixel format is interleaved, otherwise False.
| bool is_packed | ( | self | ) |
Returns True if the pixel format is packed.
| bool is_single_channel | ( | self | ) |
Returns True if the pixel format has only a single channel.
| Union[int, float] maximum_value_per_channel | ( | self | ) |
Returns the maximum possible value per channel for the pixel format.
| Union[int, float] minimum_value_per_channel | ( | self | ) |
Returns the minimum possible value per channel for the pixel format.
| int number_of_channels | ( | self | ) |
Returns the total number of channels in the pixel format.
| str numpy_dtype | ( | self | ) |
Returns the numpy dtype string for this pixel format.
| int storage_bits_per_channel | ( | self | ) |
Returns the number of bits used per channel for storage.
| int storage_bits_per_pixel | ( | self | ) |
Returns the total number of bits used per pixel for storage.
| str string_value | ( | self | ) |
Returns the human-readable name of the pixel format.
| PixelFormat unpacked_format | ( | self | ) |
Returns the unpacked pixel format for a packed pixel format.
If the pixel format is already unpacked, the same format is returned.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| channels |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| is_float |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |