IDS peak ICV v1.1.0
Loading...
Searching...
No Matches
PixelFormat Class Reference
Inheritance diagram for PixelFormat:

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.
 
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
 

Static Public Attributes

int BAYER_GR_8 = 0x01080008
 
int BAYER_GR_10 = 0x0110000C
 
int BAYER_GR_12 = 0x01100010
 
int BAYER_RG_8 = 0x01080009
 
int BAYER_RG_10 = 0x0110000D
 
int BAYER_RG_12 = 0x01100011
 
int BAYER_GB_8 = 0x0108000A
 
int BAYER_GB_10 = 0x0110000E
 
int BAYER_GB_12 = 0x01100012
 
int BAYER_BG_8 = 0x0108000B
 
int BAYER_BG_10 = 0x0110000F
 
int BAYER_BG_12 = 0x01100013
 
int MONO_8 = 0x01080001
 
int MONO_10 = 0x01100003
 
int MONO_12 = 0x01100005
 
int MONO_16 = 0x01100007
 
int CONFIDENCE_8 = 0x010800C6
 
int CONFIDENCE_16 = 0x011000C7
 
int COORD3D_C8 = 0x010800B1
 
int COORD3D_C16 = 0x011000B8
 
int COORD3D_C32F = 0x012000BF
 
int COORD3D_ABC32F = 0x026000C0
 
int YUV420_8_YY_UV_SEMIPLANAR_IDS = 0x420C0001
 
int YUV420_8_YY_VU_SEMIPLANAR_IDS = 0x420C0002
 
int YUV422_8_UYVY = 0x0210001F
 
int RGB_8 = 0x02180014
 
int RGB_10 = 0x02300018
 
int RGB_12 = 0x0230001A
 
int BGR_8 = 0x02180015
 
int BGR_10 = 0x02300019
 
int BGR_12 = 0x0230001B
 
int RGBA_8 = 0x02200016
 
int RGBA_10 = 0x0240005F
 
int RGBA_12 = 0x02400061
 
int BGRA_8 = 0x02200017
 
int BGRA_10 = 0x0240004C
 
int BGRA_12 = 0x0240004E
 
int BAYER_BG_10_PACKED = 0x010A0052
 
int BAYER_BG_12_PACKED = 0x010C0053
 
int BAYER_GB_10_PACKED = 0x010A0054
 
int BAYER_GB_12_PACKED = 0x010C0055
 
int BAYER_GR_10_PACKED = 0x010A0056
 
int BAYER_GR_12_PACKED = 0x010C0057
 
int BAYER_RG_10_PACKED = 0x010A0058
 
int BAYER_RG_12_PACKED = 0x010C0059
 
int MONO_10_PACKED = 0x010A0046
 
int MONO_12_PACKED = 0x010C0047
 
int RGB_10_PACKED_32 = 0x0220001D
 
int BGR_10_PACKED_32 = 0x0220001E
 
int BAYER_RG_10_GROUPED_40_IDS = 0x40000001
 
int BAYER_GB_10_GROUPED_40_IDS = 0x40000002
 
int BAYER_GR_10_GROUPED_40_IDS = 0x40000003
 
int BAYER_BG_10_GROUPED_40_IDS = 0x40000004
 
int BAYER_RG_12_GROUPED_24_IDS = 0x40000011
 
int BAYER_GB_12_GROUPED_24_IDS = 0x40000012
 
int BAYER_GR_12_GROUPED_24_IDS = 0x40000013
 
int BAYER_BG_12_GROUPED_24_IDS = 0x40000014
 
int MONO_10_GROUPED_40_IDS = 0x4000000f
 
int MONO_12_GROUPED_24_IDS = 0x4000001f
 

Protected Member Functions

_PixelFormatMetadata _metadata (self)
 

Detailed Description

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.

Definition at line 96 of file pixelformat.py.

Member Function Documentation

◆ __repr__()

str __repr__ ( self)

Return an unambiguous string of the PixelFormat object.

Definition at line 207 of file pixelformat.py.

◆ __str__()

str __str__ ( self)

Return a human-readable string of the PixelFormat object.

Definition at line 200 of file pixelformat.py.

◆ _metadata()

_PixelFormatMetadata _metadata ( self)
protected

Definition at line 349 of file pixelformat.py.

◆ allocated_bits_per_pixel()

int allocated_bits_per_pixel ( self)

Returns the number of allocated bits per pixel.

Definition at line 269 of file pixelformat.py.

◆ channels()

Tuple[Channel, ...] channels ( self)

Returns the list of channels in the pixel format.

Definition at line 261 of file pixelformat.py.

◆ create_from_string_value()

PixelFormat create_from_string_value ( str string_value)
static

Definition at line 193 of file pixelformat.py.

◆ get_channel_index()

int get_channel_index ( self,
Channel channel )

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

Definition at line 326 of file pixelformat.py.

◆ get_size_in_bytes()

int get_size_in_bytes ( self,
Size size )

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

Definition at line 340 of file pixelformat.py.

◆ has_channel()

bool has_channel ( self,
Channel channel )

Returns True if the pixel format has a specific channel.

Definition at line 333 of file pixelformat.py.

◆ has_intensity_channel()

bool has_intensity_channel ( self)

Returns True if the pixel format has an intensity channel.

Definition at line 285 of file pixelformat.py.

◆ is_float()

bool is_float ( self)

Definition at line 353 of file pixelformat.py.

◆ is_packed()

bool is_packed ( self)

Returns True if the pixel format is packed.

Definition at line 309 of file pixelformat.py.

◆ is_single_channel()

bool is_single_channel ( self)

Returns True if the pixel format has only a single channel.

Definition at line 301 of file pixelformat.py.

◆ maximum_value_per_channel()

Union[int, float] maximum_value_per_channel ( self)

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

Definition at line 226 of file pixelformat.py.

◆ minimum_value_per_channel()

Union[int, float] minimum_value_per_channel ( self)

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

Definition at line 215 of file pixelformat.py.

◆ number_of_channels()

int number_of_channels ( self)

Returns the total number of channels in the pixel format.

Definition at line 293 of file pixelformat.py.

◆ numpy_dtype()

str numpy_dtype ( self)

Returns the numpy dtype string for this pixel format.

Definition at line 277 of file pixelformat.py.

◆ storage_bits_per_channel()

int storage_bits_per_channel ( self)

Returns the number of bits used per channel for storage.

Definition at line 237 of file pixelformat.py.

◆ storage_bits_per_pixel()

int storage_bits_per_pixel ( self)

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

Definition at line 245 of file pixelformat.py.

◆ string_value()

str string_value ( self)

Returns the human-readable name of the pixel format.

Definition at line 253 of file pixelformat.py.

◆ unpacked_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.

Definition at line 317 of file pixelformat.py.

Field Documentation

◆ BAYER_BG_10

int BAYER_BG_10 = 0x0110000F
static

Definition at line 123 of file pixelformat.py.

◆ BAYER_BG_10_GROUPED_40_IDS

int BAYER_BG_10_GROUPED_40_IDS = 0x40000004
static

Definition at line 182 of file pixelformat.py.

◆ BAYER_BG_10_PACKED

int BAYER_BG_10_PACKED = 0x010A0052
static

Definition at line 161 of file pixelformat.py.

◆ BAYER_BG_12

int BAYER_BG_12 = 0x01100013
static

Definition at line 124 of file pixelformat.py.

◆ BAYER_BG_12_GROUPED_24_IDS

int BAYER_BG_12_GROUPED_24_IDS = 0x40000014
static

Definition at line 187 of file pixelformat.py.

◆ BAYER_BG_12_PACKED

int BAYER_BG_12_PACKED = 0x010C0053
static

Definition at line 162 of file pixelformat.py.

◆ BAYER_BG_8

int BAYER_BG_8 = 0x0108000B
static

Definition at line 122 of file pixelformat.py.

◆ BAYER_GB_10

int BAYER_GB_10 = 0x0110000E
static

Definition at line 119 of file pixelformat.py.

◆ BAYER_GB_10_GROUPED_40_IDS

int BAYER_GB_10_GROUPED_40_IDS = 0x40000002
static

Definition at line 180 of file pixelformat.py.

◆ BAYER_GB_10_PACKED

int BAYER_GB_10_PACKED = 0x010A0054
static

Definition at line 164 of file pixelformat.py.

◆ BAYER_GB_12

int BAYER_GB_12 = 0x01100012
static

Definition at line 120 of file pixelformat.py.

◆ BAYER_GB_12_GROUPED_24_IDS

int BAYER_GB_12_GROUPED_24_IDS = 0x40000012
static

Definition at line 185 of file pixelformat.py.

◆ BAYER_GB_12_PACKED

int BAYER_GB_12_PACKED = 0x010C0055
static

Definition at line 165 of file pixelformat.py.

◆ BAYER_GB_8

int BAYER_GB_8 = 0x0108000A
static

Definition at line 118 of file pixelformat.py.

◆ BAYER_GR_10

int BAYER_GR_10 = 0x0110000C
static

Definition at line 111 of file pixelformat.py.

◆ BAYER_GR_10_GROUPED_40_IDS

int BAYER_GR_10_GROUPED_40_IDS = 0x40000003
static

Definition at line 181 of file pixelformat.py.

◆ BAYER_GR_10_PACKED

int BAYER_GR_10_PACKED = 0x010A0056
static

Definition at line 167 of file pixelformat.py.

◆ BAYER_GR_12

int BAYER_GR_12 = 0x01100010
static

Definition at line 112 of file pixelformat.py.

◆ BAYER_GR_12_GROUPED_24_IDS

int BAYER_GR_12_GROUPED_24_IDS = 0x40000013
static

Definition at line 186 of file pixelformat.py.

◆ BAYER_GR_12_PACKED

int BAYER_GR_12_PACKED = 0x010C0057
static

Definition at line 168 of file pixelformat.py.

◆ BAYER_GR_8

int BAYER_GR_8 = 0x01080008
static

Definition at line 110 of file pixelformat.py.

◆ BAYER_RG_10

int BAYER_RG_10 = 0x0110000D
static

Definition at line 115 of file pixelformat.py.

◆ BAYER_RG_10_GROUPED_40_IDS

int BAYER_RG_10_GROUPED_40_IDS = 0x40000001
static

Definition at line 179 of file pixelformat.py.

◆ BAYER_RG_10_PACKED

int BAYER_RG_10_PACKED = 0x010A0058
static

Definition at line 170 of file pixelformat.py.

◆ BAYER_RG_12

int BAYER_RG_12 = 0x01100011
static

Definition at line 116 of file pixelformat.py.

◆ BAYER_RG_12_GROUPED_24_IDS

int BAYER_RG_12_GROUPED_24_IDS = 0x40000011
static

Definition at line 184 of file pixelformat.py.

◆ BAYER_RG_12_PACKED

int BAYER_RG_12_PACKED = 0x010C0059
static

Definition at line 171 of file pixelformat.py.

◆ BAYER_RG_8

int BAYER_RG_8 = 0x01080009
static

Definition at line 114 of file pixelformat.py.

◆ BGR_10

int BGR_10 = 0x02300019
static

Definition at line 150 of file pixelformat.py.

◆ BGR_10_PACKED_32

int BGR_10_PACKED_32 = 0x0220001E
static

Definition at line 177 of file pixelformat.py.

◆ BGR_12

int BGR_12 = 0x0230001B
static

Definition at line 151 of file pixelformat.py.

◆ BGR_8

int BGR_8 = 0x02180015
static

Definition at line 149 of file pixelformat.py.

◆ BGRA_10

int BGRA_10 = 0x0240004C
static

Definition at line 158 of file pixelformat.py.

◆ BGRA_12

int BGRA_12 = 0x0240004E
static

Definition at line 159 of file pixelformat.py.

◆ BGRA_8

int BGRA_8 = 0x02200017
static

Definition at line 157 of file pixelformat.py.

◆ channels

channels

Definition at line 298 of file pixelformat.py.

◆ CONFIDENCE_16

int CONFIDENCE_16 = 0x011000C7
static

Definition at line 132 of file pixelformat.py.

◆ CONFIDENCE_8

int CONFIDENCE_8 = 0x010800C6
static

Definition at line 131 of file pixelformat.py.

◆ COORD3D_ABC32F

int COORD3D_ABC32F = 0x026000C0
static

Definition at line 138 of file pixelformat.py.

◆ COORD3D_C16

int COORD3D_C16 = 0x011000B8
static

Definition at line 135 of file pixelformat.py.

◆ COORD3D_C32F

int COORD3D_C32F = 0x012000BF
static

Definition at line 136 of file pixelformat.py.

◆ COORD3D_C8

int COORD3D_C8 = 0x010800B1
static

Definition at line 134 of file pixelformat.py.

◆ is_float

is_float

Definition at line 220 of file pixelformat.py.

◆ MONO_10

int MONO_10 = 0x01100003
static

Definition at line 127 of file pixelformat.py.

◆ MONO_10_GROUPED_40_IDS

int MONO_10_GROUPED_40_IDS = 0x4000000f
static

Definition at line 189 of file pixelformat.py.

◆ MONO_10_PACKED

int MONO_10_PACKED = 0x010A0046
static

Definition at line 173 of file pixelformat.py.

◆ MONO_12

int MONO_12 = 0x01100005
static

Definition at line 128 of file pixelformat.py.

◆ MONO_12_GROUPED_24_IDS

int MONO_12_GROUPED_24_IDS = 0x4000001f
static

Definition at line 190 of file pixelformat.py.

◆ MONO_12_PACKED

int MONO_12_PACKED = 0x010C0047
static

Definition at line 174 of file pixelformat.py.

◆ MONO_16

int MONO_16 = 0x01100007
static

Definition at line 129 of file pixelformat.py.

◆ MONO_8

int MONO_8 = 0x01080001
static

Definition at line 126 of file pixelformat.py.

◆ RGB_10

int RGB_10 = 0x02300018
static

Definition at line 146 of file pixelformat.py.

◆ RGB_10_PACKED_32

int RGB_10_PACKED_32 = 0x0220001D
static

Definition at line 176 of file pixelformat.py.

◆ RGB_12

int RGB_12 = 0x0230001A
static

Definition at line 147 of file pixelformat.py.

◆ RGB_8

int RGB_8 = 0x02180014
static

Definition at line 145 of file pixelformat.py.

◆ RGBA_10

int RGBA_10 = 0x0240005F
static

Definition at line 154 of file pixelformat.py.

◆ RGBA_12

int RGBA_12 = 0x02400061
static

Definition at line 155 of file pixelformat.py.

◆ RGBA_8

int RGBA_8 = 0x02200016
static

Definition at line 153 of file pixelformat.py.

◆ YUV420_8_YY_UV_SEMIPLANAR_IDS

int YUV420_8_YY_UV_SEMIPLANAR_IDS = 0x420C0001
static

Definition at line 140 of file pixelformat.py.

◆ YUV420_8_YY_VU_SEMIPLANAR_IDS

int YUV420_8_YY_VU_SEMIPLANAR_IDS = 0x420C0002
static

Definition at line 141 of file pixelformat.py.

◆ YUV422_8_UYVY

int YUV422_8_UYVY = 0x0210001F
static

Definition at line 143 of file pixelformat.py.