IDS peak ICV v1.2.0
Loading...
Searching...
No Matches
pixelformat.py
Go to the documentation of this file.
1from __future__ import annotations
2
3from enum import Enum
4from typing import Tuple, Union, NamedTuple, cast
5
6from ids_peak_common._internal.constants import FLOAT32_MAX, FLOAT32_MIN
8from ids_peak_common.exceptions import NotSupportedException
9
10
11class Channel(Enum):
12 """!
13 @brief
14 Channels
15
16 @ingroup ids_peak_common_python_types
17 """
18
19 INTENSITY = 0,
20 """!
21 @brief
22 Luminance or grayscale intensity channel. Common in single-channel images.
23 """
24
25 RED = 1,
26 """!
27 @brief
28 Red color channel. May appear in various layouts (e.g., RGB, ARGB).
29 """
30
31 GREEN = 2,
32 """!
33 @brief
34 Green color channel. Commonly part of multichannel color formats.
35 """
36
37 BLUE = 3,
38 """!
39 @brief
40 Blue color channel. Present in formats like BGR, RGBA, etc.
41 """
42
43 ALPHA = 4,
44 """!
45 @brief
46 Alpha (opacity or transparency) channel. Often used for blending and masking.
47 """
48
49 X = 5,
50 """!
51 @brief
52 Represents the X coordinate channel (e.g., in point clouds).
53 """
54
55 Y = 6,
56 """!
57 @brief
58 Represents the Y coordinate channel (e.g., in point clouds).
59 """
60
61 Z = 7,
62 """!
63 @brief
64 Represents the Z coordinate channel (e.g., in point clouds).
65 """
66
67 BAYER = 8,
68 """!
69 @brief
70 Raw Bayer pattern data from image sensors (e.g., BGGR, RGGB).
71 """
72
73 CHROMA_U = 9,
74 """!
75 @brief
76 Chrominance U channel (Cb). Represents the blue-difference chroma component in YUV/YCbCr color spaces.
77 """
78
79 CHROMA_V = 10
80 """!
81 @brief
82 Chrominance V channel (Cr). Represents the red-difference chroma component in YUV/YCbCr color spaces.
83 """
84
85
86class _PixelFormatMetadata(NamedTuple):
87 string_value: str
88 channels: tuple[Channel, ...]
89 storage_bits_per_channel: int
90 allocated_bits_per_pixel: int
91 numpy_dtype: str
92 is_packed: bool
93 is_interleaved: bool
94 unpacked_format: PixelFormat
95
96
97class PixelFormat(Enum):
98 """!
99 @brief
100 Enum listing all supported pixel formats and their internal IDs.
101
102 Each enumerator represents a specific pixel layout and bit depth,
103 used for interpreting raw image data correctly.
104
105 This class also offers methods to query characteristics of specific
106 pixel formats, such as value ranges, storage sizes, and channel configurations.
107
108 @ingroup ids_peak_common_python_types
109 """
110
111 BAYER_GR_8 = 0x01080008
112 BAYER_GR_10 = 0x0110000C
113 BAYER_GR_12 = 0x01100010
114
115 BAYER_RG_8 = 0x01080009
116 BAYER_RG_10 = 0x0110000D
117 BAYER_RG_12 = 0x01100011
118
119 BAYER_GB_8 = 0x0108000A
120 BAYER_GB_10 = 0x0110000E
121 BAYER_GB_12 = 0x01100012
122
123 BAYER_BG_8 = 0x0108000B
124 BAYER_BG_10 = 0x0110000F
125 BAYER_BG_12 = 0x01100013
126
127 MONO_8 = 0x01080001
128 MONO_10 = 0x01100003
129 MONO_12 = 0x01100005
130 MONO_16 = 0x01100007
131
132 CONFIDENCE_8 = 0x010800C6
133 CONFIDENCE_16 = 0x011000C7
134
135 COORD3D_C8 = 0x010800B1
136 COORD3D_C16 = 0x011000B8
137 COORD3D_C32F = 0x012000BF
138
139 COORD3D_ABC32F = 0x026000C0
140
141 YUV420_8_YY_UV_SEMIPLANAR_IDS = 0x420C0001
142 YUV420_8_YY_VU_SEMIPLANAR_IDS = 0x420C0002
143
144 YUV422_8_UYVY = 0x0210001F
145
146 RGB_8 = 0x02180014
147 RGB_10 = 0x02300018
148 RGB_12 = 0x0230001A
149
150 BGR_8 = 0x02180015
151 BGR_10 = 0x02300019
152 BGR_12 = 0x0230001B
153
154 RGBA_8 = 0x02200016
155 RGBA_10 = 0x0240005F
156 RGBA_12 = 0x02400061
157
158 BGRA_8 = 0x02200017
159 BGRA_10 = 0x0240004C
160 BGRA_12 = 0x0240004E
161
162 BAYER_BG_10_PACKED = 0x010A0052
163 BAYER_BG_12_PACKED = 0x010C0053
164
165 BAYER_GB_10_PACKED = 0x010A0054
166 BAYER_GB_12_PACKED = 0x010C0055
167
168 BAYER_GR_10_PACKED = 0x010A0056
169 BAYER_GR_12_PACKED = 0x010C0057
170
171 BAYER_RG_10_PACKED = 0x010A0058
172 BAYER_RG_12_PACKED = 0x010C0059
173
174 MONO_10_PACKED = 0x010A0046
175 MONO_12_PACKED = 0x010C0047
176
177 RGB_10_PACKED_32 = 0x0220001D
178 BGR_10_PACKED_32 = 0x0220001E
179
180 BAYER_RG_10_GROUPED_40_IDS = 0x40000001
181 BAYER_GB_10_GROUPED_40_IDS = 0x40000002
182 BAYER_GR_10_GROUPED_40_IDS = 0x40000003
183 BAYER_BG_10_GROUPED_40_IDS = 0x40000004
184
185 BAYER_RG_12_GROUPED_24_IDS = 0x40000011
186 BAYER_GB_12_GROUPED_24_IDS = 0x40000012
187 BAYER_GR_12_GROUPED_24_IDS = 0x40000013
188 BAYER_BG_12_GROUPED_24_IDS = 0x40000014
189
190 MONO_10_GROUPED_40_IDS = 0x4000000f
191 MONO_12_GROUPED_24_IDS = 0x4000001f
192
193 MONO_32F_IDS = 0x81200020
194 RGB_32F_IDS = 0x82600021
195
196 MONO_10_GROUPED_40_IDS_INTERLEAVED_A_B = 0x9200000F
197 BAYER_RG_10_GROUPED_40_IDS_INTERLEAVED_A_B = 0x92000001
198 BAYER_BG_10_GROUPED_40_IDS_INTERLEAVED_A_B = 0x92000004
199 BAYER_GR_10_GROUPED_40_IDS_INTERLEAVED_A_B = 0x92000003
200 BAYER_GB_10_GROUPED_40_IDS_INTERLEAVED_A_B = 0x92000002
201 MONO_12_GROUPED_24_IDS_INTERLEAVED_A_B = 0x9200001F
202 BAYER_RG_12_GROUPED_24_IDS_INTERLEAVED_A_B = 0x92000011
203 BAYER_BG_12_GROUPED_24_IDS_INTERLEAVED_A_B = 0x92000014
204 BAYER_GR_12_GROUPED_24_IDS_INTERLEAVED_A_B = 0x92000013
205 BAYER_GB_12_GROUPED_24_IDS_INTERLEAVED_A_B = 0x92000012
206 MONO_8_INTERLEAVED_A_B = 0x92080001
207 BAYER_RG_8_INTERLEAVED_A_B = 0x92080009
208 BAYER_BG_8_INTERLEAVED_A_B = 0x9208000B
209 BAYER_GR_8_INTERLEAVED_A_B = 0x92080008
210 BAYER_GB_8_INTERLEAVED_A_B = 0x9208000A
211 MONO_10_INTERLEAVED_A_B = 0x92100003
212 BAYER_RG_10_INTERLEAVED_A_B = 0x9210000D
213 BAYER_BG_10_INTERLEAVED_A_B = 0x9210000F
214 BAYER_GR_10_INTERLEAVED_A_B = 0x9210000C
215 BAYER_GB_10_INTERLEAVED_A_B = 0x9210000E
216 MONO_12_INTERLEAVED_A_B = 0x92100005
217 BAYER_RG_12_INTERLEAVED_A_B = 0x92100011
218 BAYER_BG_12_INTERLEAVED_A_B = 0x92100013
219 BAYER_GR_12_INTERLEAVED_A_B = 0x92100010
220 BAYER_GB_12_INTERLEAVED_A_B = 0x92100012
221 MONO_10_PACKED_INTERLEAVED_A_B = 0x920A0046
222 BAYER_RG_10_PACKED_INTERLEAVED_A_B = 0x920A0058
223 BAYER_BG_10_PACKED_INTERLEAVED_A_B = 0x920A0052
224 BAYER_GR_10_PACKED_INTERLEAVED_A_B = 0x920A0056
225 BAYER_GB_10_PACKED_INTERLEAVED_A_B = 0x920A0054
226 MONO_12_PACKED_INTERLEAVED_A_B = 0x920C0047
227 BAYER_RG_12_PACKED_INTERLEAVED_A_B = 0x920C0059
228 BAYER_BG_12_PACKED_INTERLEAVED_A_B = 0x920C0053
229 BAYER_GR_12_PACKED_INTERLEAVED_A_B = 0x920C0057
230 BAYER_GB_12_PACKED_INTERLEAVED_A_B = 0x920C0055
231 MONO_8_INTERLEAVED_AB_CD = 0xB2080001
232 MONO_10_INTERLEAVED_AB_CD = 0xB2100003
233 MONO_12_INTERLEAVED_AB_CD = 0xB2100005
234 MONO_10_PACKED_INTERLEAVED_AB_CD = 0xB20A0046
235 MONO_12_PACKED_INTERLEAVED_AB_CD = 0xB20C0047
236 MONO_10_GROUPED_40_IDS_INTERLEAVED_AB_CD = 0xB200000F
237 MONO_12_GROUPED_24_IDS_INTERLEAVED_AB_CD = 0xB200001F
238
239 MONO_10_AB = 0x81200022
240 BAYER_RG_10_AB = 0x81100003
241 BAYER_BG_10_AB = 0x81100004
242 BAYER_GR_10_AB = 0x81100005
243 BAYER_GB_10_AB = 0x81100006
244 MONO_12_AB = 0x81100007
245 BAYER_RG_12_AB = 0x81100008
246 BAYER_BG_12_AB = 0x81100009
247 BAYER_GR_12_AB = 0x8110000a
248 BAYER_GB_12_AB = 0x8110000b
249 MONO_8_AB = 0x8110000c
250 BAYER_RG_8_AB = 0x8110000d
251 BAYER_BG_8_AB = 0x8110000e
252 BAYER_GR_8_AB = 0x8110000f
253 BAYER_GB_8_AB = 0x81100010
254 MONO_8_ABCD = 0x81200011
255 MONO_10_ABCD = 0x81400012
256 MONO_12_ABCD = 0x81400013
257
258 @staticmethod
259 def create_from_string_value(string_value: str) -> PixelFormat:
260 for pixelformat in _pixel_format_metadata:
261 if pixelformat.string_value == string_value:
262 return pixelformat
263
264 raise NotSupportedException(f"The given pixelformat is not supported. Given: {string_value}")
265
266 def __str__(self) -> str:
267 """!
268 @brief
269 Return a human-readable string of the PixelFormat object.
270 """
271 return self.name
272
273 def __repr__(self) -> str:
274 """!
275 @brief
276 Return an unambiguous string of the PixelFormat object.
277 """
278 return f"PixelFormat.{self.name}(value={hex(self._value_)}, string_value={self.string_value!r})"
279
280 @property
281 def minimum_value_per_channel(self) -> Union[int, float]:
282 """!
283 @brief
284 Returns the minimum possible value per channel for the pixel format.
285 """
286 if not self.is_floatis_float:
287 return 0
288 else:
289 return FLOAT32_MIN
290
291 @property
292 def maximum_value_per_channel(self) -> Union[int, float]:
293 """!
294 @brief
295 Returns the maximum possible value per channel for the pixel format.
296 """
297 if not self.is_floatis_float:
298 return int(2 ** self.storage_bits_per_channel - 1)
299 else:
300 return FLOAT32_MAX
301
302 @property
303 def storage_bits_per_channel(self) -> int:
304 """!
305 @brief
306 Returns the number of bits used per channel for storage.
307 """
308 return self._metadata.storage_bits_per_channel
309
310 @property
311 def storage_bits_per_pixel(self) -> int:
312 """!
313 @brief
314 Returns the total number of bits used per pixel for storage.
315 """
316 return self._metadata.storage_bits_per_channel * self.number_of_channels
317
318 @property
319 def string_value(self) -> str:
320 """!
321 @brief
322 Returns the human-readable name of the pixel format.
323 """
324 return self._metadata.string_value
325
326 @property
327 def channels(self) -> Tuple[Channel, ...]:
328 """!
329 @brief
330 Returns the list of channels in the pixel format.
331 """
332 return self._metadata.channels
333
334 @property
335 def allocated_bits_per_pixel(self) -> int:
336 """!
337 @brief
338 Returns the number of allocated bits per pixel.
339 """
340 return self._metadata.allocated_bits_per_pixel
341
342 @property
343 def numpy_dtype(self) -> str:
344 """!
345 @brief
346 Returns the numpy dtype string for this pixel format.
347 """
348 return self._metadata.numpy_dtype
349
350 @property
351 def has_intensity_channel(self) -> bool:
352 """!
353 @brief
354 Returns True if the pixel format has an intensity channel.
355 """
356 return Channel.INTENSITY in self.channelschannels
357
358 @property
359 def number_of_channels(self) -> int:
360 """!
361 @brief
362 Returns the total number of channels in the pixel format.
363 """
364 return len(self.channelschannels)
365
366 @property
367 def is_single_channel(self) -> bool:
368 """!
369 @brief
370 Returns True if the pixel format has only a single channel.
371 """
372 return len(self.channelschannels) == 1
373
374 @property
375 def is_packed(self) -> bool:
376 """!
377 @brief
378 Returns True if the pixel format is packed.
379 """
380 return self._metadata.is_packed
381
382 @property
383 def is_interleaved(self) -> bool:
384 """!
385 @brief
386 Indicates whether the pixel format is interleaved.
387
388 Interleaved pixel formats arrange multiple image streams in memory
389 using different patterns. The exact interleaving strategy depends
390 on the pixel format family:
391
392 **Mono*_A_B**
393 Images A and B alternate by row:
394
395 Memory row 1: Image A (row 1)
396 Memory row 2: Image B (row 1)
397 Memory row 3: Image A (row 2)
398 Memory row 4: Image B (row 2)
399 ...
400
401 **Bayer*_A_B**
402 Images A and B are grouped in pairs of rows:
403
404 Memory row 1: Image A (row 1)
405 Memory row 2: Image A (row 2)
406 Memory row 3: Image B (row 1)
407 Memory row 4: Image B (row 2)
408 Memory row 5: Image A (row 3)
409 Memory row 6: Image A (row 4)
410 Memory row 7: Image B (row 3)
411 Memory row 8: Image B (row 4)
412 ...
413
414 **Mono*_AB_CD**
415 Four image streams (A, B, C, D) are interleaved within each row:
416
417 Memory row 1: | A | B | A | B | A | B |
418 Memory row 2: | C | D | C | D | C | D |
419 Memory row 3: | A | B | A | B | A | B |
420 Memory row 4: | C | D | C | D | C | D |
421 ...
422
423 Returns:
424 bool: True if the pixel format is interleaved, otherwise False.
425 """
426 return self._metadata.is_interleaved
427
428 @property
429 def unpacked_format(self) -> PixelFormat:
430 """!
431 @brief
432 Returns the unpacked pixel format for a packed pixel format.
433 If the pixel format is already unpacked,
434 the same format is returned.
435 """
436 return self._metadata.unpacked_format
437
438 def get_channel_index(self, channel: Channel) -> int:
439 """!
440 @brief
441 Returns the index of a specific channel within the pixel format.
442 """
443 return self.channelschannels.index(channel)
444
445 def has_channel(self, channel: Channel) -> bool:
446 """!
447 @brief
448 Returns True if the pixel format has a specific channel.
449 """
450 return channel in self.channelschannels
451
452 def get_size_in_bytes(self, size: Size) -> int:
453 """!
454 @brief
455 Calculates the memory size in bytes for a given image size.
456 """
457 area = size.width * size.height
458 return int((area * self.allocated_bits_per_pixel + 7) // 8)
459
460 @property
461 def _metadata(self) -> _PixelFormatMetadata:
462 return cast(_PixelFormatMetadata, _pixel_format_metadata.get(self))
463
464 @property
465 def is_float(self) -> bool:
466 return self._metadata.numpy_dtype == "float32"
467
468
469_pixel_format_metadata = {
470 PixelFormat.BAYER_GR_8: _PixelFormatMetadata(
471 string_value="BayerGR8",
472 channels=(Channel.BAYER,),
473 storage_bits_per_channel=8,
474 allocated_bits_per_pixel=8,
475 numpy_dtype="uint8",
476 is_packed=False,
477 is_interleaved=False,
478 unpacked_format=PixelFormat.BAYER_GR_8
479 ),
480
481 PixelFormat.BAYER_GR_10: _PixelFormatMetadata(
482 string_value="BayerGR10",
483 channels=(Channel.BAYER,),
484 storage_bits_per_channel=10,
485 allocated_bits_per_pixel=16,
486 numpy_dtype="uint16",
487 is_packed=False,
488 is_interleaved=False,
489 unpacked_format=PixelFormat.BAYER_GR_10
490 ),
491
492 PixelFormat.BAYER_GR_12: _PixelFormatMetadata(
493 string_value="BayerGR12",
494 channels=(Channel.BAYER,),
495 storage_bits_per_channel=12,
496 allocated_bits_per_pixel=16,
497 numpy_dtype="uint16",
498 is_packed=False,
499 is_interleaved=False,
500 unpacked_format=PixelFormat.BAYER_GR_12
501 ),
502
503 PixelFormat.BAYER_RG_8: _PixelFormatMetadata(
504 string_value="BayerRG8",
505 channels=(Channel.BAYER,),
506 storage_bits_per_channel=8,
507 allocated_bits_per_pixel=8,
508 numpy_dtype="uint8",
509 is_packed=False,
510 is_interleaved=False,
511 unpacked_format=PixelFormat.BAYER_RG_8
512 ),
513
514 PixelFormat.BAYER_RG_10: _PixelFormatMetadata(
515 string_value="BayerRG10",
516 channels=(Channel.BAYER,),
517 storage_bits_per_channel=10,
518 allocated_bits_per_pixel=16,
519 numpy_dtype="uint16",
520 is_packed=False,
521 is_interleaved=False,
522 unpacked_format=PixelFormat.BAYER_RG_10
523 ),
524
525 PixelFormat.BAYER_RG_12: _PixelFormatMetadata(
526 string_value="BayerRG12",
527 channels=(Channel.BAYER,),
528 storage_bits_per_channel=12,
529 allocated_bits_per_pixel=16,
530 numpy_dtype="uint16",
531 is_packed=False,
532 is_interleaved=False,
533 unpacked_format=PixelFormat.BAYER_RG_12
534 ),
535
536 PixelFormat.BAYER_GB_8: _PixelFormatMetadata(
537 string_value="BayerGB8",
538 channels=(Channel.BAYER,),
539 storage_bits_per_channel=8,
540 allocated_bits_per_pixel=8,
541 numpy_dtype="uint8",
542 is_packed=False,
543 is_interleaved=False,
544 unpacked_format=PixelFormat.BAYER_GB_8
545 ),
546
547 PixelFormat.BAYER_GB_10: _PixelFormatMetadata(
548 string_value="BayerGB10",
549 channels=(Channel.BAYER,),
550 storage_bits_per_channel=10,
551 allocated_bits_per_pixel=16,
552 numpy_dtype="uint16",
553 is_packed=False,
554 is_interleaved=False,
555 unpacked_format=PixelFormat.BAYER_GB_10
556 ),
557
558 PixelFormat.BAYER_GB_12: _PixelFormatMetadata(
559 string_value="BayerGB12",
560 channels=(Channel.BAYER,),
561 storage_bits_per_channel=12,
562 allocated_bits_per_pixel=16,
563 numpy_dtype="uint16",
564 is_packed=False,
565 is_interleaved=False,
566 unpacked_format=PixelFormat.BAYER_GB_12
567 ),
568
569 PixelFormat.BAYER_BG_8: _PixelFormatMetadata(
570 string_value="BayerBG8",
571 channels=(Channel.BAYER,),
572 storage_bits_per_channel=8,
573 allocated_bits_per_pixel=8,
574 numpy_dtype="uint8",
575 is_packed=False,
576 is_interleaved=False,
577 unpacked_format=PixelFormat.BAYER_BG_8
578 ),
579
580 PixelFormat.BAYER_BG_10: _PixelFormatMetadata(
581 string_value="BayerBG10",
582 channels=(Channel.BAYER,),
583 storage_bits_per_channel=10,
584 allocated_bits_per_pixel=16,
585 numpy_dtype="uint16",
586 is_packed=False,
587 is_interleaved=False,
588 unpacked_format=PixelFormat.BAYER_BG_10
589 ),
590
591 PixelFormat.BAYER_BG_12: _PixelFormatMetadata(
592 string_value="BayerBG12",
593 channels=(Channel.BAYER,),
594 storage_bits_per_channel=12,
595 allocated_bits_per_pixel=16,
596 numpy_dtype="uint16",
597 is_packed=False,
598 is_interleaved=False,
599 unpacked_format=PixelFormat.BAYER_BG_12
600 ),
601
602 PixelFormat.MONO_8: _PixelFormatMetadata(
603 string_value="Mono8",
604 channels=(Channel.INTENSITY,),
605 storage_bits_per_channel=8,
606 allocated_bits_per_pixel=8,
607 numpy_dtype="uint8",
608 is_packed=False,
609 is_interleaved=False,
610 unpacked_format=PixelFormat.MONO_8
611 ),
612
613 PixelFormat.MONO_10: _PixelFormatMetadata(
614 string_value="Mono10",
615 channels=(Channel.INTENSITY,),
616 storage_bits_per_channel=10,
617 allocated_bits_per_pixel=16,
618 numpy_dtype="uint16",
619 is_packed=False,
620 is_interleaved=False,
621 unpacked_format=PixelFormat.MONO_10
622 ),
623
624 PixelFormat.MONO_12: _PixelFormatMetadata(
625 string_value="Mono12",
626 channels=(Channel.INTENSITY,),
627 storage_bits_per_channel=12,
628 allocated_bits_per_pixel=16,
629 numpy_dtype="uint16",
630 is_packed=False,
631 is_interleaved=False,
632 unpacked_format=PixelFormat.MONO_12
633 ),
634
635 PixelFormat.MONO_16: _PixelFormatMetadata(
636 string_value="Mono16",
637 channels=(Channel.INTENSITY,),
638 storage_bits_per_channel=16,
639 allocated_bits_per_pixel=16,
640 numpy_dtype="uint16",
641 is_packed=False,
642 is_interleaved=False,
643 unpacked_format=PixelFormat.MONO_16
644 ),
645
646 PixelFormat.CONFIDENCE_8: _PixelFormatMetadata(
647 string_value="Confidence8",
648 channels=(Channel.INTENSITY,),
649 storage_bits_per_channel=8,
650 allocated_bits_per_pixel=8,
651 numpy_dtype="uint8",
652 is_packed=False,
653 is_interleaved=False,
654 unpacked_format=PixelFormat.CONFIDENCE_8
655 ),
656
657 PixelFormat.CONFIDENCE_16: _PixelFormatMetadata(
658 string_value="Confidence16",
659 channels=(Channel.INTENSITY,),
660 storage_bits_per_channel=16,
661 allocated_bits_per_pixel=16,
662 numpy_dtype="uint16",
663 is_packed=False,
664 is_interleaved=False,
665 unpacked_format=PixelFormat.CONFIDENCE_16
666 ),
667
668 PixelFormat.COORD3D_C8: _PixelFormatMetadata(
669 string_value="Coord3D_C8",
670 channels=(Channel.INTENSITY,),
671 storage_bits_per_channel=8,
672 allocated_bits_per_pixel=8,
673 numpy_dtype="uint8",
674 is_packed=False,
675 is_interleaved=False,
676 unpacked_format=PixelFormat.COORD3D_C8
677 ),
678
679 PixelFormat.COORD3D_C16: _PixelFormatMetadata(
680 string_value="Coord3D_C16",
681 channels=(Channel.INTENSITY,),
682 storage_bits_per_channel=16,
683 allocated_bits_per_pixel=16,
684 numpy_dtype="uint16",
685 is_packed=False,
686 is_interleaved=False,
687 unpacked_format=PixelFormat.COORD3D_C16
688 ),
689
690 PixelFormat.COORD3D_C32F: _PixelFormatMetadata(
691 string_value="Coord3D_C32f",
692 channels=(Channel.INTENSITY,),
693 storage_bits_per_channel=32,
694 allocated_bits_per_pixel=32,
695 numpy_dtype="float32",
696 is_packed=False,
697 is_interleaved=False,
698 unpacked_format=PixelFormat.COORD3D_C32F
699 ),
700
701 PixelFormat.COORD3D_ABC32F: _PixelFormatMetadata(
702 string_value="Coord3D_ABC32f",
703 channels=(Channel.X, Channel.Y, Channel.Z),
704 storage_bits_per_channel=32,
705 allocated_bits_per_pixel=96,
706 numpy_dtype="float32",
707 is_packed=False,
708 is_interleaved=False,
709 unpacked_format=PixelFormat.COORD3D_ABC32F
710 ),
711
712 PixelFormat.YUV420_8_YY_UV_SEMIPLANAR_IDS: _PixelFormatMetadata(
713 string_value="YUV420_8_YY_UV_SemiplanarIDS",
714 channels=(Channel.INTENSITY, Channel.CHROMA_U, Channel.CHROMA_V),
715 storage_bits_per_channel=8,
716 allocated_bits_per_pixel=12,
717 numpy_dtype="uint8",
718 is_packed=False,
719 is_interleaved=False,
720 unpacked_format=PixelFormat.YUV420_8_YY_UV_SEMIPLANAR_IDS
721 ),
722
723 PixelFormat.YUV420_8_YY_VU_SEMIPLANAR_IDS: _PixelFormatMetadata(
724 string_value="YUV420_8_YY_VU_SemiplanarIDS",
725 channels=(Channel.INTENSITY, Channel.CHROMA_V, Channel.CHROMA_U),
726 storage_bits_per_channel=8,
727 allocated_bits_per_pixel=12,
728 numpy_dtype="uint8",
729 is_packed=False,
730 is_interleaved=False,
731 unpacked_format=PixelFormat.YUV420_8_YY_VU_SEMIPLANAR_IDS
732 ),
733
734 PixelFormat.YUV422_8_UYVY: _PixelFormatMetadata(
735 string_value="YUV422_8_UYVY",
736 channels=(Channel.INTENSITY, Channel.CHROMA_U, Channel.CHROMA_V),
737 storage_bits_per_channel=8,
738 allocated_bits_per_pixel=16,
739 numpy_dtype="uint8",
740 is_packed=False,
741 is_interleaved=False,
742 unpacked_format=PixelFormat.YUV422_8_UYVY
743 ),
744
745 PixelFormat.RGB_8: _PixelFormatMetadata(
746 string_value="RGB8",
747 channels=(Channel.RED, Channel.GREEN, Channel.BLUE),
748 storage_bits_per_channel=8,
749 allocated_bits_per_pixel=24,
750 numpy_dtype="uint8",
751 is_packed=False,
752 is_interleaved=False,
753 unpacked_format=PixelFormat.RGB_8
754 ),
755
756 PixelFormat.RGB_10: _PixelFormatMetadata(
757 string_value="RGB10",
758 channels=(Channel.RED, Channel.GREEN, Channel.BLUE),
759 storage_bits_per_channel=10,
760 allocated_bits_per_pixel=48,
761 numpy_dtype="uint16",
762 is_packed=False,
763 is_interleaved=False,
764 unpacked_format=PixelFormat.RGB_10
765 ),
766
767 PixelFormat.RGB_12: _PixelFormatMetadata(
768 string_value="RGB12",
769 channels=(Channel.RED, Channel.GREEN, Channel.BLUE),
770 storage_bits_per_channel=12,
771 allocated_bits_per_pixel=48,
772 numpy_dtype="uint16",
773 is_packed=False,
774 is_interleaved=False,
775 unpacked_format=PixelFormat.RGB_12
776 ),
777
778 PixelFormat.BGR_8: _PixelFormatMetadata(
779 string_value="BGR8",
780 channels=(Channel.BLUE, Channel.GREEN, Channel.RED),
781 storage_bits_per_channel=8,
782 allocated_bits_per_pixel=24,
783 numpy_dtype="uint8",
784 is_packed=False,
785 is_interleaved=False,
786 unpacked_format=PixelFormat.BGR_8
787 ),
788
789 PixelFormat.BGR_10: _PixelFormatMetadata(
790 string_value="BGR10",
791 channels=(Channel.BLUE, Channel.GREEN, Channel.RED),
792 storage_bits_per_channel=10,
793 allocated_bits_per_pixel=48,
794 numpy_dtype="uint16",
795 is_packed=False,
796 is_interleaved=False,
797 unpacked_format=PixelFormat.BGR_10
798 ),
799
800 PixelFormat.BGR_12: _PixelFormatMetadata(
801 string_value="BGR12",
802 channels=(Channel.BLUE, Channel.GREEN, Channel.RED),
803 storage_bits_per_channel=12,
804 allocated_bits_per_pixel=48,
805 numpy_dtype="uint16",
806 is_packed=False,
807 is_interleaved=False,
808 unpacked_format=PixelFormat.BGR_12
809 ),
810
811 PixelFormat.RGBA_8: _PixelFormatMetadata(
812 string_value="RGBa8",
813 channels=(Channel.RED, Channel.GREEN, Channel.BLUE, Channel.ALPHA),
814 storage_bits_per_channel=8,
815 allocated_bits_per_pixel=32,
816 numpy_dtype="uint8",
817 is_packed=False,
818 is_interleaved=False,
819 unpacked_format=PixelFormat.RGBA_8
820 ),
821
822 PixelFormat.RGBA_10: _PixelFormatMetadata(
823 string_value="RGBa10",
824 channels=(Channel.RED, Channel.GREEN, Channel.BLUE, Channel.ALPHA),
825 storage_bits_per_channel=10,
826 allocated_bits_per_pixel=64,
827 numpy_dtype="uint16",
828 is_packed=False,
829 is_interleaved=False,
830 unpacked_format=PixelFormat.RGBA_10
831 ),
832
833 PixelFormat.RGBA_12: _PixelFormatMetadata(
834 string_value="RGBa12",
835 channels=(Channel.RED, Channel.GREEN, Channel.BLUE, Channel.ALPHA),
836 storage_bits_per_channel=12,
837 allocated_bits_per_pixel=64,
838 numpy_dtype="uint16",
839 is_packed=False,
840 is_interleaved=False,
841 unpacked_format=PixelFormat.RGBA_12
842 ),
843
844 PixelFormat.BGRA_8: _PixelFormatMetadata(
845 string_value="BGRa8",
846 channels=(Channel.BLUE, Channel.GREEN, Channel.RED, Channel.ALPHA),
847 storage_bits_per_channel=8,
848 allocated_bits_per_pixel=32,
849 numpy_dtype="uint8",
850 is_packed=False,
851 is_interleaved=False,
852 unpacked_format=PixelFormat.BGRA_8
853 ),
854
855 PixelFormat.BGRA_10: _PixelFormatMetadata(
856 string_value="BGRa10",
857 channels=(Channel.BLUE, Channel.GREEN, Channel.RED, Channel.ALPHA),
858 storage_bits_per_channel=10,
859 allocated_bits_per_pixel=64,
860 numpy_dtype="uint16",
861 is_packed=False,
862 is_interleaved=False,
863 unpacked_format=PixelFormat.BGRA_10
864 ),
865
866 PixelFormat.BGRA_12: _PixelFormatMetadata(
867 string_value="BGRa12",
868 channels=(Channel.BLUE, Channel.GREEN, Channel.RED, Channel.ALPHA),
869 storage_bits_per_channel=12,
870 allocated_bits_per_pixel=64,
871 numpy_dtype="uint16",
872 is_packed=False,
873 is_interleaved=False,
874 unpacked_format=PixelFormat.BGRA_12
875 ),
876
877 PixelFormat.BAYER_BG_10_PACKED: _PixelFormatMetadata(
878 string_value="BayerBG10p",
879 channels=(Channel.BAYER,),
880 storage_bits_per_channel=10,
881 allocated_bits_per_pixel=10,
882 numpy_dtype="uint16",
883 is_packed=True,
884 is_interleaved=False,
885 unpacked_format=PixelFormat.BAYER_BG_10
886 ),
887
888 PixelFormat.BAYER_BG_12_PACKED: _PixelFormatMetadata(
889 string_value="BayerBG12p",
890 channels=(Channel.BAYER,),
891 storage_bits_per_channel=12,
892 allocated_bits_per_pixel=12,
893 numpy_dtype="uint16",
894 is_packed=True,
895 is_interleaved=False,
896 unpacked_format=PixelFormat.BAYER_BG_12
897 ),
898
899 PixelFormat.BAYER_GB_10_PACKED: _PixelFormatMetadata(
900 string_value="BayerGB10p",
901 channels=(Channel.BAYER,),
902 storage_bits_per_channel=10,
903 allocated_bits_per_pixel=10,
904 numpy_dtype="uint16",
905 is_packed=True,
906 is_interleaved=False,
907 unpacked_format=PixelFormat.BAYER_GB_10
908 ),
909
910 PixelFormat.BAYER_GB_12_PACKED: _PixelFormatMetadata(
911 string_value="BayerGB12p",
912 channels=(Channel.BAYER,),
913 storage_bits_per_channel=12,
914 allocated_bits_per_pixel=12,
915 numpy_dtype="uint16",
916 is_packed=True,
917 is_interleaved=False,
918 unpacked_format=PixelFormat.BAYER_GB_12
919 ),
920
921 PixelFormat.BAYER_GR_10_PACKED: _PixelFormatMetadata(
922 string_value="BayerGR10p",
923 channels=(Channel.BAYER,),
924 storage_bits_per_channel=10,
925 allocated_bits_per_pixel=10,
926 numpy_dtype="uint16",
927 is_packed=True,
928 is_interleaved=False,
929 unpacked_format=PixelFormat.BAYER_GR_10
930 ),
931
932 PixelFormat.BAYER_GR_12_PACKED: _PixelFormatMetadata(
933 string_value="BayerGR12p",
934 channels=(Channel.BAYER,),
935 storage_bits_per_channel=12,
936 allocated_bits_per_pixel=12,
937 numpy_dtype="uint16",
938 is_packed=True,
939 is_interleaved=False,
940 unpacked_format=PixelFormat.BAYER_GR_12
941 ),
942
943 PixelFormat.BAYER_RG_10_PACKED: _PixelFormatMetadata(
944 string_value="BayerRG10p",
945 channels=(Channel.BAYER,),
946 storage_bits_per_channel=10,
947 allocated_bits_per_pixel=10,
948 numpy_dtype="uint16",
949 is_packed=True,
950 is_interleaved=False,
951 unpacked_format=PixelFormat.BAYER_RG_10
952 ),
953
954 PixelFormat.BAYER_RG_12_PACKED: _PixelFormatMetadata(
955 string_value="BayerRG12p",
956 channels=(Channel.BAYER,),
957 storage_bits_per_channel=12,
958 allocated_bits_per_pixel=12,
959 numpy_dtype="uint16",
960 is_packed=True,
961 is_interleaved=False,
962 unpacked_format=PixelFormat.BAYER_RG_12
963 ),
964
965 PixelFormat.MONO_10_PACKED: _PixelFormatMetadata(
966 string_value="Mono10p",
967 channels=(Channel.INTENSITY,),
968 storage_bits_per_channel=10,
969 allocated_bits_per_pixel=10,
970 numpy_dtype="uint16",
971 is_packed=True,
972 is_interleaved=False,
973 unpacked_format=PixelFormat.MONO_10
974 ),
975
976 PixelFormat.MONO_12_PACKED: _PixelFormatMetadata(
977 string_value="Mono12p",
978 channels=(Channel.INTENSITY,),
979 storage_bits_per_channel=12,
980 allocated_bits_per_pixel=12,
981 numpy_dtype="uint16",
982 is_packed=True,
983 is_interleaved=False,
984 unpacked_format=PixelFormat.MONO_12
985 ),
986
987 PixelFormat.RGB_10_PACKED_32: _PixelFormatMetadata(
988 string_value="RGB10p32",
989 channels=(Channel.RED, Channel.GREEN, Channel.BLUE),
990 storage_bits_per_channel=10,
991 allocated_bits_per_pixel=32,
992 numpy_dtype="uint32",
993 is_packed=True,
994 is_interleaved=False,
995 unpacked_format=PixelFormat.RGB_10
996 ),
997
998 PixelFormat.BGR_10_PACKED_32: _PixelFormatMetadata(
999 string_value="BGR10p32",
1000 channels=(Channel.BLUE, Channel.GREEN, Channel.RED),
1001 storage_bits_per_channel=10,
1002 allocated_bits_per_pixel=32,
1003 numpy_dtype="uint32",
1004 is_packed=True,
1005 is_interleaved=False,
1006 unpacked_format=PixelFormat.BGR_10
1007 ),
1008
1009 PixelFormat.BAYER_RG_10_GROUPED_40_IDS: _PixelFormatMetadata(
1010 string_value="BayerRG10g40IDS",
1011 channels=(Channel.BAYER,),
1012 storage_bits_per_channel=10,
1013 allocated_bits_per_pixel=10,
1014 numpy_dtype="uint16",
1015 is_packed=True,
1016 is_interleaved=False,
1017 unpacked_format=PixelFormat.BAYER_RG_10
1018 ),
1019
1020 PixelFormat.BAYER_GB_10_GROUPED_40_IDS: _PixelFormatMetadata(
1021 string_value="BayerGB10g40IDS",
1022 channels=(Channel.BAYER,),
1023 storage_bits_per_channel=10,
1024 allocated_bits_per_pixel=10,
1025 numpy_dtype="uint16",
1026 is_packed=True,
1027 is_interleaved=False,
1028 unpacked_format=PixelFormat.BAYER_GB_10
1029 ),
1030
1031 PixelFormat.BAYER_GR_10_GROUPED_40_IDS: _PixelFormatMetadata(
1032 string_value="BayerGR10g40IDS",
1033 channels=(Channel.BAYER,),
1034 storage_bits_per_channel=10,
1035 allocated_bits_per_pixel=10,
1036 numpy_dtype="uint16",
1037 is_packed=True,
1038 is_interleaved=False,
1039 unpacked_format=PixelFormat.BAYER_GR_10
1040 ),
1041
1042 PixelFormat.BAYER_BG_10_GROUPED_40_IDS: _PixelFormatMetadata(
1043 string_value="BayerBG10g40IDS",
1044 channels=(Channel.BAYER,),
1045 storage_bits_per_channel=10,
1046 allocated_bits_per_pixel=10,
1047 numpy_dtype="uint16",
1048 is_packed=True,
1049 is_interleaved=False,
1050 unpacked_format=PixelFormat.BAYER_BG_10
1051 ),
1052
1053 PixelFormat.BAYER_RG_12_GROUPED_24_IDS: _PixelFormatMetadata(
1054 string_value="BayerRG12g24IDS",
1055 channels=(Channel.BAYER,),
1056 storage_bits_per_channel=12,
1057 allocated_bits_per_pixel=12,
1058 numpy_dtype="uint16",
1059 is_packed=True,
1060 is_interleaved=False,
1061 unpacked_format=PixelFormat.BAYER_RG_12
1062 ),
1063
1064 PixelFormat.BAYER_GB_12_GROUPED_24_IDS: _PixelFormatMetadata(
1065 string_value="BayerGB12g24IDS",
1066 channels=(Channel.BAYER,),
1067 storage_bits_per_channel=12,
1068 allocated_bits_per_pixel=12,
1069 numpy_dtype="uint16",
1070 is_packed=True,
1071 is_interleaved=False,
1072 unpacked_format=PixelFormat.BAYER_GB_12
1073 ),
1074
1075 PixelFormat.BAYER_GR_12_GROUPED_24_IDS: _PixelFormatMetadata(
1076 string_value="BayerGR12g24IDS",
1077 channels=(Channel.BAYER,),
1078 storage_bits_per_channel=12,
1079 allocated_bits_per_pixel=12,
1080 numpy_dtype="uint16",
1081 is_packed=True,
1082 is_interleaved=False,
1083 unpacked_format=PixelFormat.BAYER_GR_12
1084 ),
1085
1086 PixelFormat.BAYER_BG_12_GROUPED_24_IDS: _PixelFormatMetadata(
1087 string_value="BayerBG12g24IDS",
1088 channels=(Channel.BAYER,),
1089 storage_bits_per_channel=12,
1090 allocated_bits_per_pixel=12,
1091 numpy_dtype="uint16",
1092 is_packed=True,
1093 is_interleaved=False,
1094 unpacked_format=PixelFormat.BAYER_BG_12
1095 ),
1096
1097 PixelFormat.MONO_10_GROUPED_40_IDS: _PixelFormatMetadata(
1098 string_value="Mono10g40IDS",
1099 channels=(Channel.INTENSITY,),
1100 storage_bits_per_channel=10,
1101 allocated_bits_per_pixel=10,
1102 numpy_dtype="uint16",
1103 is_packed=True,
1104 is_interleaved=False,
1105 unpacked_format=PixelFormat.MONO_10
1106 ),
1107
1108 PixelFormat.MONO_12_GROUPED_24_IDS: _PixelFormatMetadata(
1109 string_value="Mono12g24IDS",
1110 channels=(Channel.INTENSITY,),
1111 storage_bits_per_channel=12,
1112 allocated_bits_per_pixel=12,
1113 numpy_dtype="uint16",
1114 is_packed=True,
1115 is_interleaved=False,
1116 unpacked_format=PixelFormat.MONO_12
1117 ),
1118
1119 PixelFormat.MONO_32F_IDS: _PixelFormatMetadata(
1120 string_value="Mono32fIDS",
1121 channels=(Channel.INTENSITY,),
1122 storage_bits_per_channel=32,
1123 allocated_bits_per_pixel=32,
1124 numpy_dtype="float32",
1125 is_packed=False,
1126 is_interleaved=False,
1127 unpacked_format=PixelFormat.MONO_32F_IDS
1128 ),
1129
1130 PixelFormat.RGB_32F_IDS: _PixelFormatMetadata(
1131 string_value="RGB32fIDS",
1132 channels=(Channel.RED, Channel.GREEN, Channel.BLUE),
1133 storage_bits_per_channel=32,
1134 allocated_bits_per_pixel=96,
1135 numpy_dtype="float32",
1136 is_packed=False,
1137 is_interleaved=False,
1138 unpacked_format=PixelFormat.RGB_32F_IDS
1139 ),
1140
1141 PixelFormat.MONO_10_GROUPED_40_IDS_INTERLEAVED_A_B: _PixelFormatMetadata(
1142 string_value="Mono10g40IDS_I_A_B",
1143 channels=(Channel.INTENSITY,),
1144 storage_bits_per_channel=10,
1145 allocated_bits_per_pixel=10,
1146 numpy_dtype="uint16",
1147 is_packed=True,
1148 is_interleaved=True,
1149 unpacked_format=PixelFormat.MONO_10_AB
1150 ),
1151
1152 PixelFormat.BAYER_RG_10_GROUPED_40_IDS_INTERLEAVED_A_B: _PixelFormatMetadata(
1153 string_value="BayerRG10g40IDS_I_A_B",
1154 channels=(Channel.BAYER,),
1155 storage_bits_per_channel=10,
1156 allocated_bits_per_pixel=10,
1157 numpy_dtype="uint16",
1158 is_packed=True,
1159 is_interleaved=True,
1160 unpacked_format=PixelFormat.BAYER_RG_10_AB
1161 ),
1162
1163 PixelFormat.BAYER_BG_10_GROUPED_40_IDS_INTERLEAVED_A_B: _PixelFormatMetadata(
1164 string_value="BayerBG10g40IDS_I_A_B",
1165 channels=(Channel.BAYER,),
1166 storage_bits_per_channel=10,
1167 allocated_bits_per_pixel=10,
1168 numpy_dtype="uint16",
1169 is_packed=True,
1170 is_interleaved=True,
1171 unpacked_format=PixelFormat.BAYER_BG_10_AB
1172 ),
1173
1174 PixelFormat.BAYER_GR_10_GROUPED_40_IDS_INTERLEAVED_A_B: _PixelFormatMetadata(
1175 string_value="BayerGR10g40IDS_I_A_B",
1176 channels=(Channel.BAYER,),
1177 storage_bits_per_channel=10,
1178 allocated_bits_per_pixel=10,
1179 numpy_dtype="uint16",
1180 is_packed=True,
1181 is_interleaved=True,
1182 unpacked_format=PixelFormat.BAYER_GR_10_AB
1183 ),
1184
1185 PixelFormat.BAYER_GB_10_GROUPED_40_IDS_INTERLEAVED_A_B: _PixelFormatMetadata(
1186 string_value="BayerGB10g40IDS_I_A_B",
1187 channels=(Channel.BAYER,),
1188 storage_bits_per_channel=10,
1189 allocated_bits_per_pixel=10,
1190 numpy_dtype="uint16",
1191 is_packed=True,
1192 is_interleaved=True,
1193 unpacked_format=PixelFormat.BAYER_GB_10_AB
1194 ),
1195
1196 PixelFormat.MONO_12_GROUPED_24_IDS_INTERLEAVED_A_B: _PixelFormatMetadata(
1197 string_value="Mono12g24IDS_I_A_B",
1198 channels=(Channel.INTENSITY,),
1199 storage_bits_per_channel=12,
1200 allocated_bits_per_pixel=12,
1201 numpy_dtype="uint16",
1202 is_packed=True,
1203 is_interleaved=True,
1204 unpacked_format=PixelFormat.MONO_12_AB
1205 ),
1206
1207 PixelFormat.BAYER_RG_12_GROUPED_24_IDS_INTERLEAVED_A_B: _PixelFormatMetadata(
1208 string_value="BayerRG12g24IDS_I_A_B",
1209 channels=(Channel.BAYER,),
1210 storage_bits_per_channel=12,
1211 allocated_bits_per_pixel=12,
1212 numpy_dtype="uint16",
1213 is_packed=True,
1214 is_interleaved=True,
1215 unpacked_format=PixelFormat.BAYER_RG_12_AB
1216 ),
1217
1218 PixelFormat.BAYER_BG_12_GROUPED_24_IDS_INTERLEAVED_A_B: _PixelFormatMetadata(
1219 string_value="BayerBG12g24IDS_I_A_B",
1220 channels=(Channel.BAYER,),
1221 storage_bits_per_channel=12,
1222 allocated_bits_per_pixel=12,
1223 numpy_dtype="uint16",
1224 is_packed=True,
1225 is_interleaved=True,
1226 unpacked_format=PixelFormat.BAYER_BG_12_AB
1227 ),
1228
1229 PixelFormat.BAYER_GR_12_GROUPED_24_IDS_INTERLEAVED_A_B: _PixelFormatMetadata(
1230 string_value="BayerGR12g24IDS_I_A_B",
1231 channels=(Channel.BAYER,),
1232 storage_bits_per_channel=12,
1233 allocated_bits_per_pixel=12,
1234 numpy_dtype="uint16",
1235 is_packed=True,
1236 is_interleaved=True,
1237 unpacked_format=PixelFormat.BAYER_GR_12_AB
1238 ),
1239
1240 PixelFormat.BAYER_GB_12_GROUPED_24_IDS_INTERLEAVED_A_B: _PixelFormatMetadata(
1241 string_value="BayerGB12g24IDS_I_A_B",
1242 channels=(Channel.BAYER,),
1243 storage_bits_per_channel=12,
1244 allocated_bits_per_pixel=12,
1245 numpy_dtype="uint16",
1246 is_packed=True,
1247 is_interleaved=True,
1248 unpacked_format=PixelFormat.BAYER_GB_12_AB
1249 ),
1250
1251 PixelFormat.MONO_8_INTERLEAVED_A_B: _PixelFormatMetadata(
1252 string_value="Mono8_I_A_B",
1253 channels=(Channel.INTENSITY,),
1254 storage_bits_per_channel=8,
1255 allocated_bits_per_pixel=8,
1256 numpy_dtype="uint8",
1257 is_packed=False,
1258 is_interleaved=True,
1259 unpacked_format=PixelFormat.MONO_8_AB
1260 ),
1261
1262 PixelFormat.BAYER_RG_8_INTERLEAVED_A_B: _PixelFormatMetadata(
1263 string_value="BayerRG8_I_A_B",
1264 channels=(Channel.BAYER,),
1265 storage_bits_per_channel=8,
1266 allocated_bits_per_pixel=8,
1267 numpy_dtype="uint8",
1268 is_packed=False,
1269 is_interleaved=True,
1270 unpacked_format=PixelFormat.BAYER_RG_8_AB
1271 ),
1272
1273 PixelFormat.BAYER_BG_8_INTERLEAVED_A_B: _PixelFormatMetadata(
1274 string_value="BayerBG8_I_A_B",
1275 channels=(Channel.BAYER,),
1276 storage_bits_per_channel=8,
1277 allocated_bits_per_pixel=8,
1278 numpy_dtype="uint8",
1279 is_packed=False,
1280 is_interleaved=True,
1281 unpacked_format=PixelFormat.BAYER_BG_8_AB
1282 ),
1283
1284 PixelFormat.BAYER_GR_8_INTERLEAVED_A_B: _PixelFormatMetadata(
1285 string_value="BayerGR8_I_A_B",
1286 channels=(Channel.BAYER,),
1287 storage_bits_per_channel=8,
1288 allocated_bits_per_pixel=8,
1289 numpy_dtype="uint8",
1290 is_packed=False,
1291 is_interleaved=True,
1292 unpacked_format=PixelFormat.BAYER_GR_8_AB
1293 ),
1294
1295 PixelFormat.BAYER_GB_8_INTERLEAVED_A_B: _PixelFormatMetadata(
1296 string_value="BayerGB8_I_A_B",
1297 channels=(Channel.BAYER,),
1298 storage_bits_per_channel=8,
1299 allocated_bits_per_pixel=8,
1300 numpy_dtype="uint8",
1301 is_packed=False,
1302 is_interleaved=True,
1303 unpacked_format=PixelFormat.BAYER_GB_8_AB
1304 ),
1305
1306 PixelFormat.MONO_10_INTERLEAVED_A_B: _PixelFormatMetadata(
1307 string_value="Mono10_I_A_B",
1308 channels=(Channel.INTENSITY,),
1309 storage_bits_per_channel=10,
1310 allocated_bits_per_pixel=16,
1311 numpy_dtype="uint16",
1312 is_packed=False,
1313 is_interleaved=True,
1314 unpacked_format=PixelFormat.MONO_10_AB
1315 ),
1316
1317 PixelFormat.BAYER_RG_10_INTERLEAVED_A_B: _PixelFormatMetadata(
1318 string_value="BayerRG10_I_A_B",
1319 channels=(Channel.BAYER,),
1320 storage_bits_per_channel=10,
1321 allocated_bits_per_pixel=16,
1322 numpy_dtype="uint16",
1323 is_packed=False,
1324 is_interleaved=True,
1325 unpacked_format=PixelFormat.BAYER_RG_10_AB
1326 ),
1327
1328 PixelFormat.BAYER_BG_10_INTERLEAVED_A_B: _PixelFormatMetadata(
1329 string_value="BayerBG10_I_A_B",
1330 channels=(Channel.BAYER,),
1331 storage_bits_per_channel=10,
1332 allocated_bits_per_pixel=16,
1333 numpy_dtype="uint16",
1334 is_packed=False,
1335 is_interleaved=True,
1336 unpacked_format=PixelFormat.BAYER_BG_10_AB
1337 ),
1338
1339 PixelFormat.BAYER_GR_10_INTERLEAVED_A_B: _PixelFormatMetadata(
1340 string_value="BayerGR10_I_A_B",
1341 channels=(Channel.BAYER,),
1342 storage_bits_per_channel=10,
1343 allocated_bits_per_pixel=16,
1344 numpy_dtype="uint16",
1345 is_packed=False,
1346 is_interleaved=True,
1347 unpacked_format=PixelFormat.BAYER_GR_10_AB
1348 ),
1349
1350 PixelFormat.BAYER_GB_10_INTERLEAVED_A_B: _PixelFormatMetadata(
1351 string_value="BayerGB10_I_A_B",
1352 channels=(Channel.BAYER,),
1353 storage_bits_per_channel=10,
1354 allocated_bits_per_pixel=16,
1355 numpy_dtype="uint16",
1356 is_packed=False,
1357 is_interleaved=True,
1358 unpacked_format=PixelFormat.BAYER_GB_10_AB
1359 ),
1360
1361 PixelFormat.MONO_12_INTERLEAVED_A_B: _PixelFormatMetadata(
1362 string_value="Mono12_I_A_B",
1363 channels=(Channel.INTENSITY,),
1364 storage_bits_per_channel=12,
1365 allocated_bits_per_pixel=16,
1366 numpy_dtype="uint16",
1367 is_packed=False,
1368 is_interleaved=True,
1369 unpacked_format=PixelFormat.MONO_12_AB
1370 ),
1371
1372 PixelFormat.BAYER_RG_12_INTERLEAVED_A_B: _PixelFormatMetadata(
1373 string_value="BayerRG12_I_A_B",
1374 channels=(Channel.BAYER,),
1375 storage_bits_per_channel=12,
1376 allocated_bits_per_pixel=16,
1377 numpy_dtype="uint16",
1378 is_packed=False,
1379 is_interleaved=True,
1380 unpacked_format=PixelFormat.BAYER_RG_12_AB
1381 ),
1382
1383 PixelFormat.BAYER_BG_12_INTERLEAVED_A_B: _PixelFormatMetadata(
1384 string_value="BayerBG12_I_A_B",
1385 channels=(Channel.BAYER,),
1386 storage_bits_per_channel=12,
1387 allocated_bits_per_pixel=16,
1388 numpy_dtype="uint16",
1389 is_packed=False,
1390 is_interleaved=True,
1391 unpacked_format=PixelFormat.BAYER_BG_12_AB
1392 ),
1393
1394 PixelFormat.BAYER_GR_12_INTERLEAVED_A_B: _PixelFormatMetadata(
1395 string_value="BayerGR12_I_A_B",
1396 channels=(Channel.BAYER,),
1397 storage_bits_per_channel=12,
1398 allocated_bits_per_pixel=16,
1399 numpy_dtype="uint16",
1400 is_packed=False,
1401 is_interleaved=True,
1402 unpacked_format=PixelFormat.BAYER_GR_12_AB
1403 ),
1404
1405 PixelFormat.BAYER_GB_12_INTERLEAVED_A_B: _PixelFormatMetadata(
1406 string_value="BayerGB12_I_A_B",
1407 channels=(Channel.BAYER,),
1408 storage_bits_per_channel=12,
1409 allocated_bits_per_pixel=16,
1410 numpy_dtype="uint16",
1411 is_packed=False,
1412 is_interleaved=True,
1413 unpacked_format=PixelFormat.BAYER_GB_12_AB
1414 ),
1415
1416 PixelFormat.MONO_10_PACKED_INTERLEAVED_A_B: _PixelFormatMetadata(
1417 string_value="Mono10p_I_A_B",
1418 channels=(Channel.INTENSITY,),
1419 storage_bits_per_channel=10,
1420 allocated_bits_per_pixel=10,
1421 numpy_dtype="uint16",
1422 is_packed=True,
1423 is_interleaved=True,
1424 unpacked_format=PixelFormat.MONO_10_AB
1425 ),
1426
1427 PixelFormat.BAYER_RG_10_PACKED_INTERLEAVED_A_B: _PixelFormatMetadata(
1428 string_value="BayerRG10p_I_A_B",
1429 channels=(Channel.BAYER,),
1430 storage_bits_per_channel=10,
1431 allocated_bits_per_pixel=10,
1432 numpy_dtype="uint16",
1433 is_packed=True,
1434 is_interleaved=True,
1435 unpacked_format=PixelFormat.BAYER_RG_10_AB
1436 ),
1437
1438 PixelFormat.BAYER_BG_10_PACKED_INTERLEAVED_A_B: _PixelFormatMetadata(
1439 string_value="BayerBG10p_I_A_B",
1440 channels=(Channel.BAYER,),
1441 storage_bits_per_channel=10,
1442 allocated_bits_per_pixel=10,
1443 numpy_dtype="uint16",
1444 is_packed=True,
1445 is_interleaved=True,
1446 unpacked_format=PixelFormat.BAYER_BG_10_AB
1447 ),
1448
1449 PixelFormat.BAYER_GR_10_PACKED_INTERLEAVED_A_B: _PixelFormatMetadata(
1450 string_value="BayerGR10p_I_A_B",
1451 channels=(Channel.BAYER,),
1452 storage_bits_per_channel=10,
1453 allocated_bits_per_pixel=10,
1454 numpy_dtype="uint16",
1455 is_packed=True,
1456 is_interleaved=True,
1457 unpacked_format=PixelFormat.BAYER_GR_10_AB
1458 ),
1459
1460 PixelFormat.BAYER_GB_10_PACKED_INTERLEAVED_A_B: _PixelFormatMetadata(
1461 string_value="BayerGB10p_I_A_B",
1462 channels=(Channel.BAYER,),
1463 storage_bits_per_channel=10,
1464 allocated_bits_per_pixel=10,
1465 numpy_dtype="uint16",
1466 is_packed=True,
1467 is_interleaved=True,
1468 unpacked_format=PixelFormat.BAYER_GB_10_AB
1469 ),
1470
1471 PixelFormat.MONO_12_PACKED_INTERLEAVED_A_B: _PixelFormatMetadata(
1472 string_value="Mono12p_I_A_B",
1473 channels=(Channel.INTENSITY,),
1474 storage_bits_per_channel=12,
1475 allocated_bits_per_pixel=12,
1476 numpy_dtype="uint16",
1477 is_packed=True,
1478 is_interleaved=True,
1479 unpacked_format=PixelFormat.MONO_12_AB
1480 ),
1481
1482 PixelFormat.BAYER_RG_12_PACKED_INTERLEAVED_A_B: _PixelFormatMetadata(
1483 string_value="BayerRG12p_I_A_B",
1484 channels=(Channel.BAYER,),
1485 storage_bits_per_channel=12,
1486 allocated_bits_per_pixel=12,
1487 numpy_dtype="uint16",
1488 is_packed=True,
1489 is_interleaved=True,
1490 unpacked_format=PixelFormat.BAYER_RG_12_AB
1491 ),
1492
1493 PixelFormat.BAYER_BG_12_PACKED_INTERLEAVED_A_B: _PixelFormatMetadata(
1494 string_value="BayerBG12p_I_A_B",
1495 channels=(Channel.BAYER,),
1496 storage_bits_per_channel=12,
1497 allocated_bits_per_pixel=12,
1498 numpy_dtype="uint16",
1499 is_packed=True,
1500 is_interleaved=True,
1501 unpacked_format=PixelFormat.BAYER_BG_12_AB
1502 ),
1503
1504 PixelFormat.BAYER_GR_12_PACKED_INTERLEAVED_A_B: _PixelFormatMetadata(
1505 string_value="BayerGR12p_I_A_B",
1506 channels=(Channel.BAYER,),
1507 storage_bits_per_channel=12,
1508 allocated_bits_per_pixel=12,
1509 numpy_dtype="uint16",
1510 is_packed=True,
1511 is_interleaved=True,
1512 unpacked_format=PixelFormat.BAYER_GR_12_AB
1513 ),
1514
1515 PixelFormat.BAYER_GB_12_PACKED_INTERLEAVED_A_B: _PixelFormatMetadata(
1516 string_value="BayerGB12p_I_A_B",
1517 channels=(Channel.BAYER,),
1518 storage_bits_per_channel=12,
1519 allocated_bits_per_pixel=12,
1520 numpy_dtype="uint16",
1521 is_packed=True,
1522 is_interleaved=True,
1523 unpacked_format=PixelFormat.BAYER_GB_12_AB
1524 ),
1525
1526 PixelFormat.MONO_8_INTERLEAVED_AB_CD: _PixelFormatMetadata(
1527 string_value="Mono8_I_AB_CD",
1528 channels=(Channel.INTENSITY,),
1529 storage_bits_per_channel=8,
1530 allocated_bits_per_pixel=8,
1531 numpy_dtype="uint8",
1532 is_packed=False,
1533 is_interleaved=True,
1534 unpacked_format=PixelFormat.MONO_8_ABCD
1535 ),
1536
1537 PixelFormat.MONO_10_INTERLEAVED_AB_CD: _PixelFormatMetadata(
1538 string_value="Mono10_I_AB_CD",
1539 channels=(Channel.INTENSITY,),
1540 storage_bits_per_channel=10,
1541 allocated_bits_per_pixel=16,
1542 numpy_dtype="uint16",
1543 is_packed=False,
1544 is_interleaved=True,
1545 unpacked_format=PixelFormat.MONO_10_ABCD
1546 ),
1547
1548 PixelFormat.MONO_12_INTERLEAVED_AB_CD: _PixelFormatMetadata(
1549 string_value="Mono12_I_AB_CD",
1550 channels=(Channel.INTENSITY,),
1551 storage_bits_per_channel=12,
1552 allocated_bits_per_pixel=16,
1553 numpy_dtype="uint16",
1554 is_packed=False,
1555 is_interleaved=True,
1556 unpacked_format=PixelFormat.MONO_12_ABCD
1557 ),
1558
1559 PixelFormat.MONO_10_PACKED_INTERLEAVED_AB_CD: _PixelFormatMetadata(
1560 string_value="Mono10p_I_AB_CD",
1561 channels=(Channel.INTENSITY,),
1562 storage_bits_per_channel=10,
1563 allocated_bits_per_pixel=10,
1564 numpy_dtype="uint16",
1565 is_packed=True,
1566 is_interleaved=True,
1567 unpacked_format=PixelFormat.MONO_10_ABCD
1568 ),
1569
1570 PixelFormat.MONO_12_PACKED_INTERLEAVED_AB_CD: _PixelFormatMetadata(
1571 string_value="Mono12p_I_AB_CD",
1572 channels=(Channel.INTENSITY,),
1573 storage_bits_per_channel=12,
1574 allocated_bits_per_pixel=12,
1575 numpy_dtype="uint16",
1576 is_packed=True,
1577 is_interleaved=True,
1578 unpacked_format=PixelFormat.MONO_12_ABCD
1579 ),
1580
1581 PixelFormat.MONO_10_GROUPED_40_IDS_INTERLEAVED_AB_CD: _PixelFormatMetadata(
1582 string_value="Mono10g40IDS_I_AB_CD",
1583 channels=(Channel.INTENSITY,),
1584 storage_bits_per_channel=10,
1585 allocated_bits_per_pixel=10,
1586 numpy_dtype="uint16",
1587 is_packed=True,
1588 is_interleaved=True,
1589 unpacked_format=PixelFormat.MONO_10_ABCD
1590 ),
1591
1592 PixelFormat.MONO_12_GROUPED_24_IDS_INTERLEAVED_AB_CD: _PixelFormatMetadata(
1593 string_value="Mono12g24IDS_I_AB_CD",
1594 channels=(Channel.INTENSITY,),
1595 storage_bits_per_channel=12,
1596 allocated_bits_per_pixel=12,
1597 numpy_dtype="uint16",
1598 is_packed=True,
1599 is_interleaved=True,
1600 unpacked_format=PixelFormat.MONO_12_ABCD
1601 ),
1602
1603 PixelFormat.MONO_10_AB: _PixelFormatMetadata(
1604 string_value="Mono10_AB",
1605 channels=(Channel.INTENSITY, Channel.INTENSITY),
1606 storage_bits_per_channel=10,
1607 allocated_bits_per_pixel=32,
1608 numpy_dtype="uint16",
1609 is_packed=False,
1610 is_interleaved=False,
1611 unpacked_format=PixelFormat.MONO_10_AB
1612 ),
1613
1614 PixelFormat.BAYER_RG_10_AB: _PixelFormatMetadata(
1615 string_value="BayerRG10_AB",
1616 channels=(Channel.BAYER, Channel.BAYER),
1617 storage_bits_per_channel=10,
1618 allocated_bits_per_pixel=32,
1619 numpy_dtype="uint16",
1620 is_packed=False,
1621 is_interleaved=False,
1622 unpacked_format=PixelFormat.BAYER_RG_10_AB
1623 ),
1624
1625 PixelFormat.BAYER_BG_10_AB: _PixelFormatMetadata(
1626 string_value="BayerBG10_AB",
1627 channels=(Channel.BAYER, Channel.BAYER),
1628 storage_bits_per_channel=10,
1629 allocated_bits_per_pixel=32,
1630 numpy_dtype="uint16",
1631 is_packed=False,
1632 is_interleaved=False,
1633 unpacked_format=PixelFormat.BAYER_BG_10_AB
1634 ),
1635
1636 PixelFormat.BAYER_GR_10_AB: _PixelFormatMetadata(
1637 string_value="BayerGR10_AB",
1638 channels=(Channel.BAYER, Channel.BAYER),
1639 storage_bits_per_channel=10,
1640 allocated_bits_per_pixel=32,
1641 numpy_dtype="uint16",
1642 is_packed=False,
1643 is_interleaved=False,
1644 unpacked_format=PixelFormat.BAYER_GR_10_AB
1645 ),
1646
1647 PixelFormat.BAYER_GB_10_AB: _PixelFormatMetadata(
1648 string_value="BayerGB10_AB",
1649 channels=(Channel.BAYER, Channel.BAYER),
1650 storage_bits_per_channel=10,
1651 allocated_bits_per_pixel=32,
1652 numpy_dtype="uint16",
1653 is_packed=False,
1654 is_interleaved=False,
1655 unpacked_format=PixelFormat.BAYER_GB_10_AB
1656 ),
1657
1658 PixelFormat.MONO_12_AB: _PixelFormatMetadata(
1659 string_value="Mono12_AB",
1660 channels=(Channel.INTENSITY, Channel.INTENSITY),
1661 storage_bits_per_channel=12,
1662 allocated_bits_per_pixel=32,
1663 numpy_dtype="uint16",
1664 is_packed=False,
1665 is_interleaved=False,
1666 unpacked_format=PixelFormat.MONO_12_AB
1667 ),
1668
1669 PixelFormat.BAYER_RG_12_AB: _PixelFormatMetadata(
1670 string_value="BayerRG12_AB",
1671 channels=(Channel.BAYER, Channel.BAYER),
1672 storage_bits_per_channel=12,
1673 allocated_bits_per_pixel=32,
1674 numpy_dtype="uint16",
1675 is_packed=False,
1676 is_interleaved=False,
1677 unpacked_format=PixelFormat.BAYER_RG_12_AB
1678 ),
1679
1680 PixelFormat.BAYER_BG_12_AB: _PixelFormatMetadata(
1681 string_value="BayerBG12_AB",
1682 channels=(Channel.BAYER, Channel.BAYER),
1683 storage_bits_per_channel=12,
1684 allocated_bits_per_pixel=32,
1685 numpy_dtype="uint16",
1686 is_packed=False,
1687 is_interleaved=False,
1688 unpacked_format=PixelFormat.BAYER_BG_12_AB
1689 ),
1690
1691 PixelFormat.BAYER_GR_12_AB: _PixelFormatMetadata(
1692 string_value="BayerGR12_AB",
1693 channels=(Channel.BAYER, Channel.BAYER),
1694 storage_bits_per_channel=12,
1695 allocated_bits_per_pixel=32,
1696 numpy_dtype="uint16",
1697 is_packed=False,
1698 is_interleaved=False,
1699 unpacked_format=PixelFormat.BAYER_GR_12_AB
1700 ),
1701
1702 PixelFormat.BAYER_GB_12_AB: _PixelFormatMetadata(
1703 string_value="BayerGB12_AB",
1704 channels=(Channel.BAYER, Channel.BAYER),
1705 storage_bits_per_channel=12,
1706 allocated_bits_per_pixel=32,
1707 numpy_dtype="uint16",
1708 is_packed=False,
1709 is_interleaved=False,
1710 unpacked_format=PixelFormat.BAYER_GB_12_AB
1711 ),
1712
1713 PixelFormat.MONO_8_AB: _PixelFormatMetadata(
1714 string_value="Mono8_AB",
1715 channels=(Channel.INTENSITY, Channel.INTENSITY),
1716 storage_bits_per_channel=8,
1717 allocated_bits_per_pixel=16,
1718 numpy_dtype="uint8",
1719 is_packed=False,
1720 is_interleaved=False,
1721 unpacked_format=PixelFormat.MONO_8_AB
1722 ),
1723
1724 PixelFormat.BAYER_RG_8_AB: _PixelFormatMetadata(
1725 string_value="BayerRG8_AB",
1726 channels=(Channel.BAYER, Channel.BAYER),
1727 storage_bits_per_channel=8,
1728 allocated_bits_per_pixel=16,
1729 numpy_dtype="uint8",
1730 is_packed=False,
1731 is_interleaved=False,
1732 unpacked_format=PixelFormat.BAYER_RG_8_AB
1733 ),
1734
1735 PixelFormat.BAYER_BG_8_AB: _PixelFormatMetadata(
1736 string_value="BayerBG8_AB",
1737 channels=(Channel.BAYER, Channel.BAYER),
1738 storage_bits_per_channel=8,
1739 allocated_bits_per_pixel=16,
1740 numpy_dtype="uint8",
1741 is_packed=False,
1742 is_interleaved=False,
1743 unpacked_format=PixelFormat.BAYER_BG_8_AB
1744 ),
1745
1746 PixelFormat.BAYER_GR_8_AB: _PixelFormatMetadata(
1747 string_value="BayerGR8_AB",
1748 channels=(Channel.BAYER, Channel.BAYER),
1749 storage_bits_per_channel=8,
1750 allocated_bits_per_pixel=16,
1751 numpy_dtype="uint8",
1752 is_packed=False,
1753 is_interleaved=False,
1754 unpacked_format=PixelFormat.BAYER_GR_8_AB
1755 ),
1756
1757 PixelFormat.BAYER_GB_8_AB: _PixelFormatMetadata(
1758 string_value="BayerGB8_AB",
1759 channels=(Channel.BAYER, Channel.BAYER),
1760 storage_bits_per_channel=8,
1761 allocated_bits_per_pixel=16,
1762 numpy_dtype="uint8",
1763 is_packed=False,
1764 is_interleaved=False,
1765 unpacked_format=PixelFormat.BAYER_GB_8_AB
1766 ),
1767
1768 PixelFormat.MONO_8_ABCD: _PixelFormatMetadata(
1769 string_value="Mono8_ABCD",
1770 channels=(Channel.INTENSITY, Channel.INTENSITY, Channel.INTENSITY, Channel.INTENSITY),
1771 storage_bits_per_channel=8,
1772 allocated_bits_per_pixel=32,
1773 numpy_dtype="uint8",
1774 is_packed=False,
1775 is_interleaved=False,
1776 unpacked_format=PixelFormat.MONO_8_ABCD
1777 ),
1778
1779 PixelFormat.MONO_10_ABCD: _PixelFormatMetadata(
1780 string_value="Mono10_ABCD",
1781 channels=(Channel.INTENSITY, Channel.INTENSITY, Channel.INTENSITY, Channel.INTENSITY),
1782 storage_bits_per_channel=10,
1783 allocated_bits_per_pixel=64,
1784 numpy_dtype="uint16",
1785 is_packed=False,
1786 is_interleaved=False,
1787 unpacked_format=PixelFormat.MONO_10_ABCD
1788 ),
1789
1790 PixelFormat.MONO_12_ABCD: _PixelFormatMetadata(
1791 string_value="Mono12_ABCD",
1792 channels=(Channel.INTENSITY, Channel.INTENSITY, Channel.INTENSITY, Channel.INTENSITY),
1793 storage_bits_per_channel=12,
1794 allocated_bits_per_pixel=64,
1795 numpy_dtype="uint16",
1796 is_packed=False,
1797 is_interleaved=False,
1798 unpacked_format=PixelFormat.MONO_12_ABCD
1799 ),
1800}
Enum listing all supported pixel formats and their internal IDs.
int allocated_bits_per_pixel(self)
Returns the number of allocated bits per pixel.
bool has_intensity_channel(self)
Returns True if the pixel format has an intensity channel.
str numpy_dtype(self)
Returns the numpy dtype string for this pixel format.
int get_size_in_bytes(self, Size size)
Calculates the memory size in bytes for a given image size.
Union[int, float] maximum_value_per_channel(self)
Returns the maximum possible value per channel for the pixel format.
bool is_interleaved(self)
Indicates whether the pixel format is interleaved.
PixelFormat create_from_string_value(str string_value)
Union[int, float] minimum_value_per_channel(self)
Returns the minimum possible value per channel for the pixel format.
int storage_bits_per_pixel(self)
Returns the total number of bits used per pixel for storage.
PixelFormat unpacked_format(self)
Returns the unpacked pixel format for a packed pixel format.
bool is_packed(self)
Returns True if the pixel format is packed.
str string_value(self)
Returns the human-readable name of the pixel format.
int storage_bits_per_channel(self)
Returns the number of bits used per channel for storage.
bool has_channel(self, Channel channel)
Returns True if the pixel format has a specific channel.
Tuple[Channel,...] channels(self)
Returns the list of channels in the pixel format.
str __str__(self)
Return a human-readable string of the PixelFormat object.
int number_of_channels(self)
Returns the total number of channels in the pixel format.
str __repr__(self)
Return an unambiguous string of the PixelFormat object.
bool is_single_channel(self)
Returns True if the pixel format has only a single channel.
int get_channel_index(self, Channel channel)
Returns the index of a specific channel within the pixel format.
Thrown when an unsupported operation or feature is used.