IDS peak ICV v1.1.0
Loading...
Searching...
No Matches
peak_common_pixel_format.hpp
Go to the documentation of this file.
1
13#pragma once
14
18#include <peak_common_c/detail/peak_common_defines.h>
19#include <peak_common_c/types/peak_common_pixel_format.h>
20#include <unordered_map>
21#include <algorithm>
22#include <array>
23#include <cstdint>
24#include <ostream>
25#include <string>
26#include <vector>
27
28namespace peak
29{
30namespace common
31{
32// clang-format off
43enum class PixelFormat : uint64_t
44{
45 BayerGR8 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_8,
46 BayerGR10 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_10,
47 BayerGR12 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_12,
48
49 BayerRG8 = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_8,
50 BayerRG10 = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_10,
51 BayerRG12 = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_12,
52
53 BayerGB8 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_8,
54 BayerGB10 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_10,
55 BayerGB12 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_12,
56
57 BayerBG8 = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_8,
58 BayerBG10 = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_10,
59 BayerBG12 = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_12,
60
61 Mono8 = PEAK_COMMON_PIXEL_FORMAT_MONO_8,
62 Mono10 = PEAK_COMMON_PIXEL_FORMAT_MONO_10,
63 Mono12 = PEAK_COMMON_PIXEL_FORMAT_MONO_12,
64 Mono16 = PEAK_COMMON_PIXEL_FORMAT_MONO_16,
65
66 Confidence8 = PEAK_COMMON_PIXEL_FORMAT_CONFIDENCE_8,
67 Confidence16 = PEAK_COMMON_PIXEL_FORMAT_CONFIDENCE_16,
68
69 Coord3D_C8 = PEAK_COMMON_PIXEL_FORMAT_COORD3D_C8,
70 Coord3D_C16 = PEAK_COMMON_PIXEL_FORMAT_COORD3D_C16,
71 Coord3D_C32f = PEAK_COMMON_PIXEL_FORMAT_COORD3D_C32F,
72
73 Coord3D_ABC32f = PEAK_COMMON_PIXEL_FORMAT_COORD3D_ABC32F,
74
75 YUV420_8_YY_UV_SemiplanarIDS = PEAK_COMMON_PIXEL_FORMAT_YUV420_8_YY_UV_SemiplanarIDS,
76 YUV420_8_YY_VU_SemiplanarIDS = PEAK_COMMON_PIXEL_FORMAT_YUV420_8_YY_VU_SemiplanarIDS,
77
78 YUV422_8_UYVY = PEAK_COMMON_PIXEL_FORMAT_YUV422_8_UYVY,
79
80 RGB8 = PEAK_COMMON_PIXEL_FORMAT_RGB_8,
81 RGB10 = PEAK_COMMON_PIXEL_FORMAT_RGB_10,
82 RGB12 = PEAK_COMMON_PIXEL_FORMAT_RGB_12,
83
84 BGR8 = PEAK_COMMON_PIXEL_FORMAT_BGR_8,
85 BGR10 = PEAK_COMMON_PIXEL_FORMAT_BGR_10,
86 BGR12 = PEAK_COMMON_PIXEL_FORMAT_BGR_12,
87
88 RGBa8 = PEAK_COMMON_PIXEL_FORMAT_RGBA_8,
89 RGBa10 = PEAK_COMMON_PIXEL_FORMAT_RGBA_10,
90 RGBa12 = PEAK_COMMON_PIXEL_FORMAT_RGBA_12,
91
92 BGRa8 = PEAK_COMMON_PIXEL_FORMAT_BGRA_8,
93 BGRa10 = PEAK_COMMON_PIXEL_FORMAT_BGRA_10,
94 BGRa12 = PEAK_COMMON_PIXEL_FORMAT_BGRA_12,
95
96 BayerBG10p = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_10_PACKED,
97 BayerBG12p = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_12_PACKED,
98
99 BayerGB10p = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_10_PACKED,
100 BayerGB12p = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_12_PACKED,
101
102 BayerGR10p = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_10_PACKED,
103 BayerGR12p = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_12_PACKED,
104
105 BayerRG10p = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_10_PACKED,
106 BayerRG12p = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_12_PACKED,
107
108 Mono10p = PEAK_COMMON_PIXEL_FORMAT_MONO_10_PACKED,
109 Mono12p = PEAK_COMMON_PIXEL_FORMAT_MONO_12_PACKED,
110
111 RGB10p32 = PEAK_COMMON_PIXEL_FORMAT_RGB_10_PACKED_32,
112 BGR10p32 = PEAK_COMMON_PIXEL_FORMAT_BGR_10_PACKED_32,
113
114 BayerRG10g40IDS = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_10_GROUPED_40_IDS,
115 BayerGB10g40IDS = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_10_GROUPED_40_IDS,
116 BayerGR10g40IDS = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_10_GROUPED_40_IDS,
117 BayerBG10g40IDS = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_10_GROUPED_40_IDS,
118
119 BayerRG12g24IDS = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_12_GROUPED_24_IDS,
120 BayerGB12g24IDS = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_12_GROUPED_24_IDS,
121 BayerGR12g24IDS = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_12_GROUPED_24_IDS,
122 BayerBG12g24IDS = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_12_GROUPED_24_IDS,
123
124 Mono10g40IDS = PEAK_COMMON_PIXEL_FORMAT_MONO_10_GROUPED_40_IDS,
125 Mono12g24IDS = PEAK_COMMON_PIXEL_FORMAT_MONO_12_GROUPED_24_IDS
126};
127
128// clang-format on
129
140{
141public:
148 explicit PixelFormatInfo(peak::common::PixelFormat pixelFormat);
149
156 explicit PixelFormatInfo(const std::string& name);
157
165 template <typename T = size_t>
166 PEAK_COMMON_NO_DISCARD T GetMinimumValuePerChannel() const;
167
175 template <typename T = size_t>
176 PEAK_COMMON_NO_DISCARD T GetMaximumValuePerChannel() const;
177
184 PEAK_COMMON_NO_DISCARD size_t GetStorageBitsPerPixel() const;
185
192 PEAK_COMMON_NO_DISCARD size_t GetStorageBitsPerChannel() const;
193
200 PEAK_COMMON_NO_DISCARD std::string GetName() const;
201
208 PEAK_COMMON_NO_DISCARD std::vector<Channel> GetChannels() const;
209
216 PEAK_COMMON_NO_DISCARD size_t GetAllocatedBitsPerPixel() const;
217
224 PEAK_COMMON_NO_DISCARD bool HasIntensityChannel() const;
225
233 PEAK_COMMON_NO_DISCARD size_t GetChannelIndex(Channel channel) const;
234
241 PEAK_COMMON_NO_DISCARD size_t GetNumberOfChannels() const;
242
249 PEAK_COMMON_NO_DISCARD bool IsSingleChannel() const;
250
258 PEAK_COMMON_NO_DISCARD bool HasChannel(Channel channel) const;
259
266 PEAK_COMMON_NO_DISCARD peak::common::PixelFormat GetPixelFormat() const;
267
275 PEAK_COMMON_NO_DISCARD size_t GetSizeInBytes(const Size& size) const;
276
283 PEAK_COMMON_NO_DISCARD bool IsPacked() const;
284
291 PEAK_COMMON_NO_DISCARD bool IsFloat() const;
292
301 PEAK_COMMON_NO_DISCARD PixelFormat GetUnpackedPixelFormat() const;
302
303private:
304 peak::common::PixelFormat m_pixelFormat;
305};
306
307inline std::ostream& operator<<(std::ostream& os, PixelFormat pixelFormat)
308{
309 PixelFormatInfo info(pixelFormat);
310 os << info.GetName();
311 return os;
312}
313
314namespace detail
315{
316
318template <peak::common::PixelFormat pixelFormat>
319struct PixelFormatTraits;
320
322
323template <>
324struct PixelFormatTraits<peak::common::PixelFormat::Mono8>
325{
326 using underlying_type = uint8_t;
327
328 static constexpr std::array<Channel, 1> Channels()
329 {
330 return { Channel::Intensity };
331 }
332
333 static constexpr auto Name()
334 {
335 return "Mono8";
336 }
337
338 static constexpr size_t storageBitsPerPixel = 8;
339 static constexpr size_t allocatedBitsPerPixel = 8;
340 static constexpr bool isPacked = false;
341 static constexpr auto unpackedFormat = peak::common::PixelFormat::Mono8;
342};
343
344template <>
345struct PixelFormatTraits<peak::common::PixelFormat::Mono10>
346{
347 using underlying_type = uint16_t;
348
349 static constexpr std::array<Channel, 1> Channels()
350 {
351 return { Channel::Intensity };
352 }
353
354 static constexpr auto Name()
355 {
356 return "Mono10";
357 }
358
359 static constexpr size_t storageBitsPerPixel = 10;
360 static constexpr size_t allocatedBitsPerPixel = 16;
361 static constexpr bool isPacked = false;
362 static constexpr auto unpackedFormat = peak::common::PixelFormat::Mono10;
363};
364
365template <>
366struct PixelFormatTraits<peak::common::PixelFormat::Mono12>
367{
368 using underlying_type = uint16_t;
369
370 static constexpr std::array<Channel, 1> Channels()
371 {
372 return { Channel::Intensity };
373 }
374
375 static constexpr auto Name()
376 {
377 return "Mono12";
378 }
379
380 static constexpr size_t storageBitsPerPixel = 12;
381 static constexpr size_t allocatedBitsPerPixel = 16;
382 static constexpr bool isPacked = false;
383 static constexpr auto unpackedFormat = peak::common::PixelFormat::Mono12;
384};
385
386template <>
387struct PixelFormatTraits<peak::common::PixelFormat::Mono16>
388{
389 using underlying_type = uint16_t;
390
391 static constexpr std::array<Channel, 1> Channels()
392 {
393 return { Channel::Intensity };
394 }
395
396 static constexpr auto Name()
397 {
398 return "Mono16";
399 }
400
401 static constexpr size_t storageBitsPerPixel = 16;
402 static constexpr size_t allocatedBitsPerPixel = 16;
403 static constexpr bool isPacked = false;
404 static constexpr auto unpackedFormat = peak::common::PixelFormat::Mono16;
405};
406
407template <>
408struct PixelFormatTraits<peak::common::PixelFormat::RGB8>
409{
410 using underlying_type = uint8_t;
411
412 static constexpr std::array<Channel, 3> Channels()
413 {
414 return { Channel::Red, Channel::Green, Channel::Blue };
415 }
416
417 static constexpr auto Name()
418 {
419 return "RGB8";
420 }
421
422 static constexpr size_t storageBitsPerPixel = 24;
423 static constexpr size_t allocatedBitsPerPixel = 24;
424 static constexpr bool isPacked = false;
425 static constexpr auto unpackedFormat = peak::common::PixelFormat::RGB8;
426};
427
428template <>
429struct PixelFormatTraits<peak::common::PixelFormat::RGBa8>
430{
431 using underlying_type = uint8_t;
432
433 static constexpr std::array<Channel, 4> Channels()
434 {
435 return { Channel::Red, Channel::Green, Channel::Blue, Channel::Alpha };
436 }
437
438 static constexpr auto Name()
439 {
440 return "RGBa8";
441 }
442
443 static constexpr size_t storageBitsPerPixel = 32;
444 static constexpr size_t allocatedBitsPerPixel = 32;
445 static constexpr bool isPacked = false;
446 static constexpr auto unpackedFormat = peak::common::PixelFormat::RGBa8;
447};
448
449template <>
450struct PixelFormatTraits<peak::common::PixelFormat::BGR8>
451{
452 using underlying_type = uint8_t;
453
454 static constexpr std::array<Channel, 3> Channels()
455 {
456 return { Channel::Blue, Channel::Green, Channel::Red };
457 }
458
459 static constexpr auto Name()
460 {
461 return "BGR8";
462 }
463
464 static constexpr size_t storageBitsPerPixel = 24;
465 static constexpr size_t allocatedBitsPerPixel = 24;
466 static constexpr bool isPacked = false;
467 static constexpr auto unpackedFormat = peak::common::PixelFormat::BGR8;
468};
469
470template <>
471struct PixelFormatTraits<peak::common::PixelFormat::BGRa8>
472{
473 using underlying_type = uint8_t;
474
475 static constexpr std::array<Channel, 4> Channels()
476 {
477 return { Channel::Blue, Channel::Green, Channel::Red, Channel::Alpha };
478 }
479
480 static constexpr auto Name()
481 {
482 return "BGRa8";
483 }
484
485 static constexpr size_t storageBitsPerPixel = 32;
486 static constexpr size_t allocatedBitsPerPixel = 32;
487 static constexpr bool isPacked = false;
488 static constexpr auto unpackedFormat = peak::common::PixelFormat::BGRa8;
489};
490
491template <>
493{
494 using underlying_type = float;
495
496 static constexpr std::array<Channel, 3> Channels()
497 {
498 return { Channel::X, Channel::Y, Channel::Z };
499 }
500
501 static constexpr auto Name()
502 {
503 return "Coord3D_ABC32f";
504 }
505
506 static constexpr size_t storageBitsPerPixel = 96;
507 static constexpr size_t allocatedBitsPerPixel = 96;
508 static constexpr bool isPacked = false;
509 static constexpr auto unpackedFormat = peak::common::PixelFormat::Coord3D_ABC32f;
510};
511
512template <>
513struct PixelFormatTraits<peak::common::PixelFormat::Coord3D_C32f>
514{
515 using underlying_type = float;
516
517 static constexpr std::array<Channel, 1> Channels()
518 {
519 return { Channel::Intensity };
520 }
521
522 static constexpr auto Name()
523 {
524 return "Coord3D_C32f";
525 }
526
527 static constexpr size_t storageBitsPerPixel = 32;
528 static constexpr size_t allocatedBitsPerPixel = 32;
529 static constexpr bool isPacked = false;
530 static constexpr auto unpackedFormat = peak::common::PixelFormat::Coord3D_C32f;
531};
532
533template <>
534struct PixelFormatTraits<PixelFormat::Mono10p>
535{
536 using underlying_type = uint16_t;
537
538 static constexpr std::array<Channel, 1> Channels()
539 {
540 return { Channel::Intensity };
541 }
542
543 static constexpr auto Name()
544 {
545 return "Mono10p";
546 }
547
548 static constexpr size_t storageBitsPerPixel = 10;
549 static constexpr size_t allocatedBitsPerPixel = 10;
550 static constexpr bool isPacked = true;
551 static constexpr auto unpackedFormat = peak::common::PixelFormat::Mono10;
552};
553
554template <>
555struct PixelFormatTraits<PixelFormat::Mono12p>
556{
557 using underlying_type = uint16_t;
558
559 static constexpr std::array<Channel, 1> Channels()
560 {
561 return { Channel::Intensity };
562 }
563
564 static constexpr auto Name()
565 {
566 return "Mono12p";
567 }
568
569 static constexpr size_t storageBitsPerPixel = 12;
570 static constexpr size_t allocatedBitsPerPixel = 12;
571 static constexpr bool isPacked = true;
572 static constexpr auto unpackedFormat = peak::common::PixelFormat::Mono12;
573};
574
575template <>
576struct PixelFormatTraits<PixelFormat::RGB10>
577{
578 using underlying_type = uint16_t;
579
580 static constexpr std::array<Channel, 3> Channels()
581 {
582 return { Channel::Red, Channel::Green, Channel::Blue };
583 }
584
585 static constexpr auto Name()
586 {
587 return "RGB10";
588 }
589
590 static constexpr size_t storageBitsPerPixel = 30;
591 static constexpr size_t allocatedBitsPerPixel = 48;
592 static constexpr bool isPacked = false;
593 static constexpr auto unpackedFormat = peak::common::PixelFormat::RGB10;
594};
595
596template <>
597struct PixelFormatTraits<PixelFormat::RGB12>
598{
599 using underlying_type = uint16_t;
600
601 static constexpr std::array<Channel, 3> Channels()
602 {
603 return { Channel::Red, Channel::Green, Channel::Blue };
604 }
605
606 static constexpr auto Name()
607 {
608 return "RGB12";
609 }
610
611 static constexpr size_t storageBitsPerPixel = 36;
612 static constexpr size_t allocatedBitsPerPixel = 48;
613 static constexpr bool isPacked = false;
614 static constexpr auto unpackedFormat = peak::common::PixelFormat::RGB12;
615};
616
617template <>
618struct PixelFormatTraits<PixelFormat::RGBa10>
619{
620 using underlying_type = uint16_t;
621
622 static constexpr std::array<Channel, 4> Channels()
623 {
624 return { Channel::Red, Channel::Green, Channel::Blue, Channel::Alpha };
625 }
626
627 static constexpr auto Name()
628 {
629 return "RGBa10";
630 }
631
632 static constexpr size_t storageBitsPerPixel = 40;
633 static constexpr size_t allocatedBitsPerPixel = 64;
634 static constexpr bool isPacked = false;
635 static constexpr auto unpackedFormat = peak::common::PixelFormat::RGBa10;
636};
637
638template <>
639struct PixelFormatTraits<PixelFormat::RGBa12>
640{
641 using underlying_type = uint16_t;
642
643 static constexpr std::array<Channel, 4> Channels()
644 {
645 return { Channel::Red, Channel::Green, Channel::Blue, Channel::Alpha };
646 }
647
648 static constexpr auto Name()
649 {
650 return "RGBa12";
651 }
652
653 static constexpr size_t storageBitsPerPixel = 48;
654 static constexpr size_t allocatedBitsPerPixel = 64;
655 static constexpr bool isPacked = false;
656 static constexpr auto unpackedFormat = peak::common::PixelFormat::RGBa12;
657};
658
659template <>
660struct PixelFormatTraits<PixelFormat::BGR10>
661{
662 using underlying_type = uint16_t;
663
664 static constexpr std::array<Channel, 3> Channels()
665 {
666 return { Channel::Blue, Channel::Green, Channel::Red };
667 }
668
669 static constexpr auto Name()
670 {
671 return "BGR10";
672 }
673
674 static constexpr size_t storageBitsPerPixel = 30;
675 static constexpr size_t allocatedBitsPerPixel = 48;
676 static constexpr bool isPacked = false;
677 static constexpr auto unpackedFormat = peak::common::PixelFormat::BGR10;
678};
679
680template <>
681struct PixelFormatTraits<PixelFormat::BGR12>
682{
683 using underlying_type = uint16_t;
684
685 static constexpr std::array<Channel, 3> Channels()
686 {
687 return { Channel::Blue, Channel::Green, Channel::Red };
688 }
689
690 static constexpr auto Name()
691 {
692 return "BGR12";
693 }
694
695 static constexpr size_t storageBitsPerPixel = 36;
696 static constexpr size_t allocatedBitsPerPixel = 48;
697 static constexpr bool isPacked = false;
698 static constexpr auto unpackedFormat = peak::common::PixelFormat::BGR12;
699};
700
701template <>
702struct PixelFormatTraits<PixelFormat::BGRa10>
703{
704 using underlying_type = uint16_t;
705
706 static constexpr std::array<Channel, 4> Channels()
707 {
708 return { Channel::Blue, Channel::Green, Channel::Red, Channel::Alpha };
709 }
710
711 static constexpr auto Name()
712 {
713 return "BGRa10";
714 }
715
716 static constexpr size_t storageBitsPerPixel = 40;
717 static constexpr size_t allocatedBitsPerPixel = 64;
718 static constexpr bool isPacked = false;
719 static constexpr auto unpackedFormat = peak::common::PixelFormat::BGRa10;
720};
721
722template <>
723struct PixelFormatTraits<PixelFormat::BGRa12>
724{
725 using underlying_type = uint16_t;
726
727 static constexpr std::array<Channel, 4> Channels()
728 {
729 return { Channel::Blue, Channel::Green, Channel::Red, Channel::Alpha };
730 }
731
732 static constexpr auto Name()
733 {
734 return "BGRa12";
735 }
736
737 static constexpr size_t storageBitsPerPixel = 48;
738 static constexpr size_t allocatedBitsPerPixel = 64;
739 static constexpr bool isPacked = false;
740 static constexpr auto unpackedFormat = peak::common::PixelFormat::BGRa12;
741};
742
743template <>
744struct PixelFormatTraits<PixelFormat::RGB10p32>
745{
746 using underlying_type = uint32_t;
747
748 static constexpr std::array<Channel, 3> Channels()
749 {
750 return { Channel::Red, Channel::Green, Channel::Blue };
751 }
752
753 static constexpr auto Name()
754 {
755 return "RGB10p32";
756 }
757
758 static constexpr size_t storageBitsPerPixel = 30;
759 static constexpr size_t allocatedBitsPerPixel = 32;
760 static constexpr bool isPacked = true;
761 static constexpr auto unpackedFormat = peak::common::PixelFormat::RGB10;
762};
763
764template <>
765struct PixelFormatTraits<PixelFormat::BGR10p32>
766{
767 using underlying_type = uint32_t;
768
769 static constexpr std::array<Channel, 3> Channels()
770 {
771 return { Channel::Blue, Channel::Green, Channel::Red };
772 }
773
774 static constexpr auto Name()
775 {
776 return "BGR10p32";
777 }
778
779 static constexpr size_t storageBitsPerPixel = 30;
780 static constexpr size_t allocatedBitsPerPixel = 32;
781 static constexpr bool isPacked = true;
782 static constexpr auto unpackedFormat = peak::common::PixelFormat::BGR10;
783};
784
785template <>
786struct PixelFormatTraits<PixelFormat::BayerGR8>
787{
788 using underlying_type = uint8_t;
789
790 static constexpr std::array<Channel, 1> Channels()
791 {
792 return { Channel::Bayer };
793 }
794
795 static constexpr auto Name()
796 {
797 return "BayerGR8";
798 }
799
800 static constexpr size_t storageBitsPerPixel = 8;
801 static constexpr size_t allocatedBitsPerPixel = 8;
802 static constexpr bool isPacked = false;
803 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerGR8;
804};
805
806template <>
807struct PixelFormatTraits<PixelFormat::BayerGR10>
808{
809 using underlying_type = uint16_t;
810
811 static constexpr std::array<Channel, 1> Channels()
812 {
813 return { Channel::Bayer };
814 }
815
816 static constexpr auto Name()
817 {
818 return "BayerGR10";
819 }
820
821 static constexpr size_t storageBitsPerPixel = 10;
822 static constexpr size_t allocatedBitsPerPixel = 16;
823 static constexpr bool isPacked = false;
824 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerGR10;
825};
826
827template <>
828struct PixelFormatTraits<PixelFormat::BayerGR12>
829{
830 using underlying_type = uint16_t;
831
832 static constexpr std::array<Channel, 1> Channels()
833 {
834 return { Channel::Bayer };
835 }
836
837 static constexpr auto Name()
838 {
839 return "BayerGR12";
840 }
841
842 static constexpr size_t storageBitsPerPixel = 12;
843 static constexpr size_t allocatedBitsPerPixel = 16;
844 static constexpr bool isPacked = false;
845 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerGR12;
846};
847
848template <>
849struct PixelFormatTraits<PixelFormat::BayerRG8>
850{
851 using underlying_type = uint8_t;
852
853 static constexpr std::array<Channel, 1> Channels()
854 {
855 return { Channel::Bayer };
856 }
857
858 static constexpr auto Name()
859 {
860 return "BayerRG8";
861 }
862
863 static constexpr size_t storageBitsPerPixel = 8;
864 static constexpr size_t allocatedBitsPerPixel = 8;
865 static constexpr bool isPacked = false;
866 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerRG8;
867};
868
869template <>
870struct PixelFormatTraits<PixelFormat::BayerRG10>
871{
872 using underlying_type = uint16_t;
873
874 static constexpr std::array<Channel, 1> Channels()
875 {
876 return { Channel::Bayer };
877 }
878
879 static constexpr auto Name()
880 {
881 return "BayerRG10";
882 }
883
884 static constexpr size_t storageBitsPerPixel = 10;
885 static constexpr size_t allocatedBitsPerPixel = 16;
886 static constexpr bool isPacked = false;
887 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerRG10;
888};
889
890template <>
891struct PixelFormatTraits<PixelFormat::BayerRG12>
892{
893 using underlying_type = uint16_t;
894
895 static constexpr std::array<Channel, 1> Channels()
896 {
897 return { Channel::Bayer };
898 }
899
900 static constexpr auto Name()
901 {
902 return "BayerRG12";
903 }
904
905 static constexpr size_t storageBitsPerPixel = 12;
906 static constexpr size_t allocatedBitsPerPixel = 16;
907 static constexpr bool isPacked = false;
908 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerRG12;
909};
910
911template <>
912struct PixelFormatTraits<PixelFormat::BayerGB8>
913{
914 using underlying_type = uint8_t;
915
916 static constexpr std::array<Channel, 1> Channels()
917 {
918 return { Channel::Bayer };
919 }
920
921 static constexpr auto Name()
922 {
923 return "BayerGB8";
924 }
925
926 static constexpr size_t storageBitsPerPixel = 8;
927 static constexpr size_t allocatedBitsPerPixel = 8;
928 static constexpr bool isPacked = false;
929 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerGB8;
930};
931
932template <>
933struct PixelFormatTraits<PixelFormat::BayerGB10>
934{
935 using underlying_type = uint16_t;
936
937 static constexpr std::array<Channel, 1> Channels()
938 {
939 return { Channel::Bayer };
940 }
941
942 static constexpr auto Name()
943 {
944 return "BayerGB10";
945 }
946
947 static constexpr size_t storageBitsPerPixel = 10;
948 static constexpr size_t allocatedBitsPerPixel = 16;
949 static constexpr bool isPacked = false;
950 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerGB10;
951};
952
953template <>
954struct PixelFormatTraits<PixelFormat::BayerGB12>
955{
956 using underlying_type = uint16_t;
957
958 static constexpr std::array<Channel, 1> Channels()
959 {
960 return { Channel::Bayer };
961 }
962
963 static constexpr auto Name()
964 {
965 return "BayerGB12";
966 }
967
968 static constexpr size_t storageBitsPerPixel = 12;
969 static constexpr size_t allocatedBitsPerPixel = 16;
970 static constexpr bool isPacked = false;
971 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerGB12;
972};
973
974template <>
975struct PixelFormatTraits<PixelFormat::BayerBG8>
976{
977 using underlying_type = uint8_t;
978
979 static constexpr std::array<Channel, 1> Channels()
980 {
981 return { Channel::Bayer };
982 }
983
984 static constexpr auto Name()
985 {
986 return "BayerBG8";
987 }
988
989 static constexpr size_t storageBitsPerPixel = 8;
990 static constexpr size_t allocatedBitsPerPixel = 8;
991 static constexpr bool isPacked = false;
992 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerBG8;
993};
994
995template <>
996struct PixelFormatTraits<PixelFormat::BayerBG10>
997{
998 using underlying_type = uint16_t;
999
1000 static constexpr std::array<Channel, 1> Channels()
1001 {
1002 return { Channel::Bayer };
1003 }
1004
1005 static constexpr auto Name()
1006 {
1007 return "BayerBG10";
1008 }
1009
1010 static constexpr size_t storageBitsPerPixel = 10;
1011 static constexpr size_t allocatedBitsPerPixel = 16;
1012 static constexpr bool isPacked = false;
1013 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerBG10;
1014};
1015
1016template <>
1017struct PixelFormatTraits<PixelFormat::BayerBG12>
1018{
1019 using underlying_type = uint16_t;
1020
1021 static constexpr std::array<Channel, 1> Channels()
1022 {
1023 return { Channel::Bayer };
1024 }
1025
1026 static constexpr auto Name()
1027 {
1028 return "BayerBG12";
1029 }
1030
1031 static constexpr size_t storageBitsPerPixel = 12;
1032 static constexpr size_t allocatedBitsPerPixel = 16;
1033 static constexpr bool isPacked = false;
1034 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerBG12;
1035};
1036
1037template <>
1038struct PixelFormatTraits<PixelFormat::BayerGR10p>
1039{
1040 using underlying_type = uint16_t;
1041
1042 static constexpr std::array<Channel, 1> Channels()
1043 {
1044 return { Channel::Bayer };
1045 }
1046
1047 static constexpr auto Name()
1048 {
1049 return "BayerGR10p";
1050 }
1051
1052 static constexpr size_t storageBitsPerPixel = 10;
1053 static constexpr size_t allocatedBitsPerPixel = 10;
1054 static constexpr bool isPacked = true;
1055 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerGR10;
1056};
1057
1058template <>
1059struct PixelFormatTraits<PixelFormat::BayerGR12p>
1060{
1061 using underlying_type = uint16_t;
1062
1063 static constexpr std::array<Channel, 1> Channels()
1064 {
1065 return { Channel::Bayer };
1066 }
1067
1068 static constexpr auto Name()
1069 {
1070 return "BayerGR12p";
1071 }
1072
1073 static constexpr size_t storageBitsPerPixel = 12;
1074 static constexpr size_t allocatedBitsPerPixel = 12;
1075 static constexpr bool isPacked = true;
1076 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerGR12;
1077};
1078
1079template <>
1080struct PixelFormatTraits<PixelFormat::BayerRG10p>
1081{
1082 using underlying_type = uint16_t;
1083
1084 static constexpr std::array<Channel, 1> Channels()
1085 {
1086 return { Channel::Bayer };
1087 }
1088
1089 static constexpr auto Name()
1090 {
1091 return "BayerRG10p";
1092 }
1093
1094 static constexpr size_t storageBitsPerPixel = 10;
1095 static constexpr size_t allocatedBitsPerPixel = 10;
1096 static constexpr bool isPacked = true;
1097 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerRG10;
1098};
1099
1100template <>
1101struct PixelFormatTraits<PixelFormat::BayerRG12p>
1102{
1103 using underlying_type = uint16_t;
1104
1105 static constexpr std::array<Channel, 1> Channels()
1106 {
1107 return { Channel::Bayer };
1108 }
1109
1110 static constexpr auto Name()
1111 {
1112 return "BayerRG12p";
1113 }
1114
1115 static constexpr size_t storageBitsPerPixel = 12;
1116 static constexpr size_t allocatedBitsPerPixel = 12;
1117 static constexpr bool isPacked = true;
1118 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerRG12;
1119};
1120
1121template <>
1122struct PixelFormatTraits<PixelFormat::BayerGB10p>
1123{
1124 using underlying_type = uint16_t;
1125
1126 static constexpr std::array<Channel, 1> Channels()
1127 {
1128 return { Channel::Bayer };
1129 }
1130
1131 static constexpr auto Name()
1132 {
1133 return "BayerGB10p";
1134 }
1135
1136 static constexpr size_t storageBitsPerPixel = 10;
1137 static constexpr size_t allocatedBitsPerPixel = 10;
1138 static constexpr bool isPacked = true;
1139 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerGB10;
1140};
1141
1142template <>
1143struct PixelFormatTraits<PixelFormat::BayerGB12p>
1144{
1145 using underlying_type = uint16_t;
1146
1147 static constexpr std::array<Channel, 1> Channels()
1148 {
1149 return { Channel::Bayer };
1150 }
1151
1152 static constexpr auto Name()
1153 {
1154 return "BayerGB12p";
1155 }
1156
1157 static constexpr size_t storageBitsPerPixel = 12;
1158 static constexpr size_t allocatedBitsPerPixel = 12;
1159 static constexpr bool isPacked = true;
1160 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerGB12;
1161};
1162
1163template <>
1164struct PixelFormatTraits<PixelFormat::BayerBG10p>
1165{
1166 using underlying_type = uint16_t;
1167
1168 static constexpr std::array<Channel, 1> Channels()
1169 {
1170 return { Channel::Bayer };
1171 }
1172
1173 static constexpr auto Name()
1174 {
1175 return "BayerBG10p";
1176 }
1177
1178 static constexpr size_t storageBitsPerPixel = 10;
1179 static constexpr size_t allocatedBitsPerPixel = 10;
1180 static constexpr bool isPacked = true;
1181 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerBG10;
1182};
1183
1184template <>
1185struct PixelFormatTraits<PixelFormat::BayerBG12p>
1186{
1187 using underlying_type = uint16_t;
1188
1189 static constexpr std::array<Channel, 1> Channels()
1190 {
1191 return { Channel::Bayer };
1192 }
1193
1194 static constexpr auto Name()
1195 {
1196 return "BayerBG12p";
1197 }
1198
1199 static constexpr size_t storageBitsPerPixel = 12;
1200 static constexpr size_t allocatedBitsPerPixel = 12;
1201 static constexpr bool isPacked = true;
1202 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerBG12;
1203};
1204
1205template <>
1206struct PixelFormatTraits<PixelFormat::Confidence8>
1207{
1208 using underlying_type = uint8_t;
1209
1210 static constexpr std::array<Channel, 1> Channels()
1211 {
1212 return { Channel::Intensity };
1213 }
1214
1215 static constexpr auto Name()
1216 {
1217 return "Confidence8";
1218 }
1219
1220 static constexpr size_t storageBitsPerPixel = 8;
1221 static constexpr size_t allocatedBitsPerPixel = 8;
1222 static constexpr bool isPacked = false;
1223 static constexpr auto unpackedFormat = peak::common::PixelFormat::Confidence8;
1224};
1225
1226template <>
1227struct PixelFormatTraits<PixelFormat::Confidence16>
1228{
1229 using underlying_type = uint16_t;
1230
1231 static constexpr std::array<Channel, 1> Channels()
1232 {
1233 return { Channel::Intensity };
1234 }
1235
1236 static constexpr auto Name()
1237 {
1238 return "Confidence16";
1239 }
1240
1241 static constexpr size_t storageBitsPerPixel = 16;
1242 static constexpr size_t allocatedBitsPerPixel = 16;
1243 static constexpr bool isPacked = false;
1244 static constexpr auto unpackedFormat = peak::common::PixelFormat::Confidence16;
1245};
1246
1247template <>
1248struct PixelFormatTraits<PixelFormat::Coord3D_C8>
1249{
1250 using underlying_type = uint8_t;
1251
1252 static constexpr std::array<Channel, 1> Channels()
1253 {
1254 return { Channel::Intensity };
1255 }
1256
1257 static constexpr auto Name()
1258 {
1259 return "Coord3D_C8";
1260 }
1261
1262 static constexpr size_t storageBitsPerPixel = 8;
1263 static constexpr size_t allocatedBitsPerPixel = 8;
1264 static constexpr bool isPacked = false;
1265 static constexpr auto unpackedFormat = peak::common::PixelFormat::Coord3D_C8;
1266};
1267
1268template <>
1269struct PixelFormatTraits<PixelFormat::Coord3D_C16>
1270{
1271 using underlying_type = uint16_t;
1272
1273 static constexpr std::array<Channel, 1> Channels()
1274 {
1275 return { Channel::Intensity };
1276 }
1277
1278 static constexpr auto Name()
1279 {
1280 return "Coord3D_C16";
1281 }
1282
1283 static constexpr size_t storageBitsPerPixel = 16;
1284 static constexpr size_t allocatedBitsPerPixel = 16;
1285 static constexpr bool isPacked = false;
1286 static constexpr auto unpackedFormat = peak::common::PixelFormat::Coord3D_C16;
1287};
1288
1289template <>
1290struct PixelFormatTraits<PixelFormat::BayerBG10g40IDS>
1291{
1292 using underlying_type = uint16_t;
1293
1294 static constexpr std::array<Channel, 1> Channels()
1295 {
1296 return { Channel::Bayer };
1297 }
1298
1299 static constexpr auto Name()
1300 {
1301 return "BayerBG10g40IDS";
1302 }
1303
1304 static constexpr size_t storageBitsPerPixel = 10;
1305 static constexpr size_t allocatedBitsPerPixel = 10;
1306 static constexpr bool isPacked = true;
1307 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerBG10;
1308};
1309
1310template <>
1311struct PixelFormatTraits<PixelFormat::BayerBG12g24IDS>
1312{
1313 using underlying_type = uint16_t;
1314
1315 static constexpr std::array<Channel, 1> Channels()
1316 {
1317 return { Channel::Bayer };
1318 }
1319
1320 static constexpr auto Name()
1321 {
1322 return "BayerBG12g24IDS";
1323 }
1324
1325 static constexpr size_t storageBitsPerPixel = 12;
1326 static constexpr size_t allocatedBitsPerPixel = 12;
1327 static constexpr bool isPacked = true;
1328 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerBG12;
1329};
1330
1331template <>
1332struct PixelFormatTraits<PixelFormat::BayerGB10g40IDS>
1333{
1334 using underlying_type = uint16_t;
1335
1336 static constexpr std::array<Channel, 1> Channels()
1337 {
1338 return { Channel::Bayer };
1339 }
1340
1341 static constexpr auto Name()
1342 {
1343 return "BayerGB10g40IDS";
1344 }
1345
1346 static constexpr size_t storageBitsPerPixel = 10;
1347 static constexpr size_t allocatedBitsPerPixel = 10;
1348 static constexpr bool isPacked = true;
1349 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerGB10;
1350};
1351
1352template <>
1353struct PixelFormatTraits<PixelFormat::BayerGB12g24IDS>
1354{
1355 using underlying_type = uint16_t;
1356
1357 static constexpr std::array<Channel, 1> Channels()
1358 {
1359 return { Channel::Bayer };
1360 }
1361
1362 static constexpr auto Name()
1363 {
1364 return "BayerGB12g24IDS";
1365 }
1366
1367 static constexpr size_t storageBitsPerPixel = 12;
1368 static constexpr size_t allocatedBitsPerPixel = 12;
1369 static constexpr bool isPacked = true;
1370 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerGB12;
1371};
1372
1373template <>
1374struct PixelFormatTraits<PixelFormat::BayerGR10g40IDS>
1375{
1376 using underlying_type = uint16_t;
1377
1378 static constexpr std::array<Channel, 1> Channels()
1379 {
1380 return { Channel::Bayer };
1381 }
1382
1383 static constexpr auto Name()
1384 {
1385 return "BayerGR10g40IDS";
1386 }
1387
1388 static constexpr size_t storageBitsPerPixel = 10;
1389 static constexpr size_t allocatedBitsPerPixel = 10;
1390 static constexpr bool isPacked = true;
1391 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerGR10;
1392};
1393
1394template <>
1395struct PixelFormatTraits<PixelFormat::BayerGR12g24IDS>
1396{
1397 using underlying_type = uint16_t;
1398
1399 static constexpr std::array<Channel, 1> Channels()
1400 {
1401 return { Channel::Bayer };
1402 }
1403
1404 static constexpr auto Name()
1405 {
1406 return "BayerGR12g24IDS";
1407 }
1408
1409 static constexpr size_t storageBitsPerPixel = 12;
1410 static constexpr size_t allocatedBitsPerPixel = 12;
1411 static constexpr bool isPacked = true;
1412 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerGR12;
1413};
1414
1415template <>
1416struct PixelFormatTraits<PixelFormat::BayerRG10g40IDS>
1417{
1418 using underlying_type = uint16_t;
1419
1420 static constexpr std::array<Channel, 1> Channels()
1421 {
1422 return { Channel::Bayer };
1423 }
1424
1425 static constexpr auto Name()
1426 {
1427 return "BayerRG10g40IDS";
1428 }
1429
1430 static constexpr size_t storageBitsPerPixel = 10;
1431 static constexpr size_t allocatedBitsPerPixel = 10;
1432 static constexpr bool isPacked = true;
1433 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerRG10;
1434};
1435
1436template <>
1437struct PixelFormatTraits<PixelFormat::BayerRG12g24IDS>
1438{
1439 using underlying_type = uint16_t;
1440
1441 static constexpr std::array<Channel, 1> Channels()
1442 {
1443 return { Channel::Bayer };
1444 }
1445
1446 static constexpr auto Name()
1447 {
1448 return "BayerRG12g24IDS";
1449 }
1450
1451 static constexpr size_t storageBitsPerPixel = 12;
1452 static constexpr size_t allocatedBitsPerPixel = 12;
1453 static constexpr bool isPacked = true;
1454 static constexpr auto unpackedFormat = peak::common::PixelFormat::BayerRG12;
1455};
1456
1457template <>
1459{
1460 using underlying_type = uint8_t;
1461
1462 static constexpr std::array<Channel, 3> Channels()
1463 {
1464 return { Channel::Intensity, Channel::ChromaU, Channel::ChromaV };
1465 }
1466
1467 static constexpr auto Name()
1468 {
1469 return "YUV420_8_YY_UV_SemiplanarIDS";
1470 }
1471
1472 static constexpr size_t storageBitsPerPixel = 8;
1473 static constexpr size_t allocatedBitsPerPixel = 12;
1474 static constexpr bool isPacked = false;
1475 static constexpr auto unpackedFormat = peak::common::PixelFormat::YUV420_8_YY_UV_SemiplanarIDS;
1476};
1477
1478template <>
1480{
1481 using underlying_type = uint8_t;
1482
1483 static constexpr std::array<Channel, 3> Channels()
1484 {
1485 return { Channel::Intensity, Channel::ChromaV, Channel::ChromaU };
1486 }
1487
1488 static constexpr auto Name()
1489 {
1490 return "YUV420_8_YY_VU_SemiplanarIDS";
1491 }
1492
1493 static constexpr size_t storageBitsPerPixel = 8;
1494 static constexpr size_t allocatedBitsPerPixel = 12;
1495 static constexpr bool isPacked = false;
1496 static constexpr auto unpackedFormat = peak::common::PixelFormat::YUV420_8_YY_VU_SemiplanarIDS;
1497};
1498
1499template <>
1500struct PixelFormatTraits<PixelFormat::YUV422_8_UYVY>
1501{
1502 using underlying_type = uint8_t;
1503
1504 static constexpr std::array<Channel, 3> Channels()
1505 {
1506 return { Channel::Intensity, Channel::ChromaU, Channel::ChromaV };
1507 }
1508
1509 static constexpr auto Name()
1510 {
1511 return "YUV422_8_UYVY";
1512 }
1513
1514 static constexpr size_t storageBitsPerPixel = 8;
1515 static constexpr size_t allocatedBitsPerPixel = 16;
1516 static constexpr bool isPacked = false;
1517 static constexpr auto unpackedFormat = peak::common::PixelFormat::YUV422_8_UYVY;
1518};
1519
1520template <>
1521struct PixelFormatTraits<PixelFormat::Mono10g40IDS>
1522{
1523 using underlying_type = uint16_t;
1524
1525 static constexpr std::array<Channel, 1> Channels()
1526 {
1527 return { Channel::Intensity };
1528 }
1529
1530 static constexpr auto Name()
1531 {
1532 return "Mono10g40IDS";
1533 }
1534
1535 static constexpr size_t storageBitsPerPixel = 10;
1536 static constexpr size_t allocatedBitsPerPixel = 10;
1537 static constexpr bool isPacked = true;
1538 static constexpr auto unpackedFormat = peak::common::PixelFormat::Mono10;
1539};
1540
1541template <>
1542struct PixelFormatTraits<PixelFormat::Mono12g24IDS>
1543{
1544 using underlying_type = uint16_t;
1545
1546 static constexpr std::array<Channel, 1> Channels()
1547 {
1548 return { Channel::Intensity };
1549 }
1550
1551 static constexpr auto Name()
1552 {
1553 return "Mono12g24IDS";
1554 }
1555
1556 static constexpr size_t storageBitsPerPixel = 12;
1557 static constexpr size_t allocatedBitsPerPixel = 12;
1558 static constexpr bool isPacked = true;
1559 static constexpr auto unpackedFormat = peak::common::PixelFormat::Mono12;
1560};
1561
1563template <typename T, bool isFloat>
1564struct ValueRangeHelper;
1565
1566template <typename T>
1567struct ValueRangeHelper<T, false> // Integer
1568{
1569 static constexpr T Minimum(size_t)
1570 {
1571 return 0;
1572 }
1573
1574 static constexpr T Maximum(size_t bitsPerChannel)
1575 {
1576 return static_cast<T>((1ULL << bitsPerChannel) - 1);
1577 }
1578};
1579
1580template <typename T>
1581struct ValueRangeHelper<T, true> // Float
1582{
1583 static constexpr T Minimum(size_t)
1584 {
1585 return std::numeric_limits<T>::lowest();
1586 }
1587
1588 static constexpr T Maximum(size_t)
1589 {
1590 return (std::numeric_limits<T>::max)();
1591 }
1592};
1593
1594template <PixelFormat pixelFormat>
1595struct PixelFormatInfo
1596{
1597 using traits = PixelFormatTraits<pixelFormat>;
1598 using underlying_type = typename traits::underlying_type;
1599 static constexpr bool is_floating_point = std::is_floating_point<underlying_type>::value;
1600
1601 static constexpr size_t storageBitsPerPixel = traits::storageBitsPerPixel;
1602 static constexpr size_t allocatedBitsPerPixel = traits::allocatedBitsPerPixel;
1603
1604 static constexpr size_t storageBitsPerChannel = storageBitsPerPixel / traits::Channels().size();
1605
1606 static constexpr underlying_type minimumValuePerChannel = ValueRangeHelper<underlying_type, is_floating_point>::Minimum(
1607 storageBitsPerChannel);
1608
1609 static constexpr underlying_type maximumValuePerChannel = ValueRangeHelper<underlying_type, is_floating_point>::Maximum(
1610 storageBitsPerChannel);
1611
1612 static constexpr auto Channels()
1613 {
1614 return traits::Channels();
1615 }
1616
1617 static constexpr const char* Name()
1618 {
1619 return traits::Name();
1620 }
1621
1622 static constexpr size_t GetSizeInBytes(const Size& size)
1623 {
1624 const auto area = static_cast<uint64_t>(size.GetWidth()) * size.GetHeight();
1625 return static_cast<size_t>(((area * PixelFormatInfo<pixelFormat>::allocatedBitsPerPixel) + 7) / 8);
1626 }
1627
1628 static constexpr bool IsPacked()
1629 {
1630 return traits::isPacked;
1631 }
1632
1633 static constexpr PixelFormat GetUnpackedFormat()
1634 {
1635 return traits::unpackedFormat;
1636 }
1637};
1638
1639template <typename PixelFormatInfo>
1640inline auto ChannelsVector()
1641{
1642 constexpr auto arr = PixelFormatInfo::Channels();
1643 using T = typename std::decay_t<typename decltype(arr)::value_type>;
1644 return std::vector<T>(arr.begin(), arr.end());
1645}
1646
1648} // namespace detail
1649
1651 : m_pixelFormat{ pixelFormat }
1652{}
1653
1654inline PixelFormatInfo::PixelFormatInfo(const std::string& name)
1655{
1656 static const std::unordered_map<std::string, PixelFormat> map = {
1657 { detail::PixelFormatInfo<PixelFormat::BayerGR8>::Name(), PixelFormat::BayerGR8 },
1658 { detail::PixelFormatInfo<PixelFormat::BayerGR10>::Name(), PixelFormat::BayerGR10 },
1659 { detail::PixelFormatInfo<PixelFormat::BayerGR12>::Name(), PixelFormat::BayerGR12 },
1660 { detail::PixelFormatInfo<PixelFormat::BayerRG8>::Name(), PixelFormat::BayerRG8 },
1661 { detail::PixelFormatInfo<PixelFormat::BayerRG10>::Name(), PixelFormat::BayerRG10 },
1662 { detail::PixelFormatInfo<PixelFormat::BayerRG12>::Name(), PixelFormat::BayerRG12 },
1663 { detail::PixelFormatInfo<PixelFormat::BayerGB8>::Name(), PixelFormat::BayerGB8 },
1664 { detail::PixelFormatInfo<PixelFormat::BayerGB10>::Name(), PixelFormat::BayerGB10 },
1665 { detail::PixelFormatInfo<PixelFormat::BayerGB12>::Name(), PixelFormat::BayerGB12 },
1666 { detail::PixelFormatInfo<PixelFormat::BayerBG8>::Name(), PixelFormat::BayerBG8 },
1667 { detail::PixelFormatInfo<PixelFormat::BayerBG10>::Name(), PixelFormat::BayerBG10 },
1668 { detail::PixelFormatInfo<PixelFormat::BayerBG12>::Name(), PixelFormat::BayerBG12 },
1669 { detail::PixelFormatInfo<PixelFormat::Mono8>::Name(), PixelFormat::Mono8 },
1670 { detail::PixelFormatInfo<PixelFormat::Mono10>::Name(), PixelFormat::Mono10 },
1671 { detail::PixelFormatInfo<PixelFormat::Mono12>::Name(), PixelFormat::Mono12 },
1672 { detail::PixelFormatInfo<PixelFormat::Mono16>::Name(), PixelFormat::Mono16 },
1673 { detail::PixelFormatInfo<PixelFormat::Confidence8>::Name(), PixelFormat::Confidence8 },
1674 { detail::PixelFormatInfo<PixelFormat::Confidence16>::Name(), PixelFormat::Confidence16 },
1675 { detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::Name(), PixelFormat::Coord3D_C8 },
1676 { detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::Name(), PixelFormat::Coord3D_C16 },
1677 { detail::PixelFormatInfo<PixelFormat::Coord3D_C32f>::Name(), PixelFormat::Coord3D_C32f },
1678 { detail::PixelFormatInfo<PixelFormat::Coord3D_ABC32f>::Name(), PixelFormat::Coord3D_ABC32f },
1679 { detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::Name(), PixelFormat::YUV420_8_YY_UV_SemiplanarIDS },
1680 { detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::Name(), PixelFormat::YUV420_8_YY_VU_SemiplanarIDS },
1681 { detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::Name(), PixelFormat::YUV422_8_UYVY },
1682 { detail::PixelFormatInfo<PixelFormat::RGB8>::Name(), PixelFormat::RGB8 },
1683 { detail::PixelFormatInfo<PixelFormat::RGB10>::Name(), PixelFormat::RGB10 },
1684 { detail::PixelFormatInfo<PixelFormat::RGB12>::Name(), PixelFormat::RGB12 },
1685 { detail::PixelFormatInfo<PixelFormat::BGR8>::Name(), PixelFormat::BGR8 },
1686 { detail::PixelFormatInfo<PixelFormat::BGR10>::Name(), PixelFormat::BGR10 },
1687 { detail::PixelFormatInfo<PixelFormat::BGR12>::Name(), PixelFormat::BGR12 },
1688 { detail::PixelFormatInfo<PixelFormat::RGBa8>::Name(), PixelFormat::RGBa8 },
1689 { detail::PixelFormatInfo<PixelFormat::RGBa10>::Name(), PixelFormat::RGBa10 },
1690 { detail::PixelFormatInfo<PixelFormat::RGBa12>::Name(), PixelFormat::RGBa12 },
1691 { detail::PixelFormatInfo<PixelFormat::BGRa8>::Name(), PixelFormat::BGRa8 },
1692 { detail::PixelFormatInfo<PixelFormat::BGRa10>::Name(), PixelFormat::BGRa10 },
1693 { detail::PixelFormatInfo<PixelFormat::BGRa12>::Name(), PixelFormat::BGRa12 },
1694 { detail::PixelFormatInfo<PixelFormat::BayerBG10p>::Name(), PixelFormat::BayerBG10p },
1695 { detail::PixelFormatInfo<PixelFormat::BayerBG12p>::Name(), PixelFormat::BayerBG12p },
1696 { detail::PixelFormatInfo<PixelFormat::BayerGB10p>::Name(), PixelFormat::BayerGB10p },
1697 { detail::PixelFormatInfo<PixelFormat::BayerGB12p>::Name(), PixelFormat::BayerGB12p },
1698 { detail::PixelFormatInfo<PixelFormat::BayerGR10p>::Name(), PixelFormat::BayerGR10p },
1699 { detail::PixelFormatInfo<PixelFormat::BayerGR12p>::Name(), PixelFormat::BayerGR12p },
1700 { detail::PixelFormatInfo<PixelFormat::BayerRG10p>::Name(), PixelFormat::BayerRG10p },
1701 { detail::PixelFormatInfo<PixelFormat::BayerRG12p>::Name(), PixelFormat::BayerRG12p },
1702 { detail::PixelFormatInfo<PixelFormat::Mono10p>::Name(), PixelFormat::Mono10p },
1703 { detail::PixelFormatInfo<PixelFormat::Mono12p>::Name(), PixelFormat::Mono12p },
1704 { detail::PixelFormatInfo<PixelFormat::RGB10p32>::Name(), PixelFormat::RGB10p32 },
1705 { detail::PixelFormatInfo<PixelFormat::BGR10p32>::Name(), PixelFormat::BGR10p32 },
1706 { detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::Name(), PixelFormat::BayerRG10g40IDS },
1707 { detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::Name(), PixelFormat::BayerGB10g40IDS },
1708 { detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::Name(), PixelFormat::BayerGR10g40IDS },
1709 { detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::Name(), PixelFormat::BayerBG10g40IDS },
1710 { detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::Name(), PixelFormat::BayerRG12g24IDS },
1711 { detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::Name(), PixelFormat::BayerGB12g24IDS },
1712 { detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::Name(), PixelFormat::BayerGR12g24IDS },
1713 { detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::Name(), PixelFormat::BayerBG12g24IDS },
1714 { detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::Name(), PixelFormat::Mono10g40IDS },
1715 { detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::Name(), PixelFormat::Mono12g24IDS }
1716 };
1717
1718 const auto iter = map.find(name);
1719 if (iter == map.end())
1720 {
1721 throw InvalidParameterException("The given pixel format " + name + " is unkown!");
1722 }
1723 m_pixelFormat = iter->second;
1724}
1725
1739template <>
1741{
1742 switch (m_pixelFormat)
1743 {
1745 return detail::PixelFormatInfo<peak::common::PixelFormat::Coord3D_ABC32f>::maximumValuePerChannel;
1747 return detail::PixelFormatInfo<peak::common::PixelFormat::Coord3D_C32f>::maximumValuePerChannel;
1748 default:
1750 "The template does not match the data type of pixel format " + GetName() + "! Use size_t as template argument.");
1751 }
1752}
1753
1766template <>
1768{
1769 switch (m_pixelFormat)
1770 {
1771 case PixelFormat::Mono8:
1772 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono8>::maximumValuePerChannel;
1774 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>::maximumValuePerChannel;
1776 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>::maximumValuePerChannel;
1778 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>::maximumValuePerChannel;
1780 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>::maximumValuePerChannel;
1782 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>::maximumValuePerChannel;
1783 case PixelFormat::RGB8:
1784 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>::maximumValuePerChannel;
1785 case PixelFormat::RGB10:
1786 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>::maximumValuePerChannel;
1787 case PixelFormat::RGB12:
1788 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>::maximumValuePerChannel;
1789 case PixelFormat::RGBa8:
1790 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>::maximumValuePerChannel;
1792 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>::maximumValuePerChannel;
1794 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>::maximumValuePerChannel;
1795 case PixelFormat::BGR8:
1796 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>::maximumValuePerChannel;
1797 case PixelFormat::BGR10:
1798 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>::maximumValuePerChannel;
1799 case PixelFormat::BGR12:
1800 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>::maximumValuePerChannel;
1801 case PixelFormat::BGRa8:
1802 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>::maximumValuePerChannel;
1804 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>::maximumValuePerChannel;
1806 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>::maximumValuePerChannel;
1808 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>::maximumValuePerChannel;
1810 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>::maximumValuePerChannel;
1812 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>::maximumValuePerChannel;
1814 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>::maximumValuePerChannel;
1816 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>::maximumValuePerChannel;
1818 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>::maximumValuePerChannel;
1820 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>::maximumValuePerChannel;
1822 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>::maximumValuePerChannel;
1824 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>::maximumValuePerChannel;
1826 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>::maximumValuePerChannel;
1828 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>::maximumValuePerChannel;
1830 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>::maximumValuePerChannel;
1832 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>::maximumValuePerChannel;
1834 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>::maximumValuePerChannel;
1836 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>::maximumValuePerChannel;
1838 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>::maximumValuePerChannel;
1840 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>::maximumValuePerChannel;
1842 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>::maximumValuePerChannel;
1844 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>::maximumValuePerChannel;
1846 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>::maximumValuePerChannel;
1848 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>::maximumValuePerChannel;
1850 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>::maximumValuePerChannel;
1852 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>::maximumValuePerChannel;
1854 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>::maximumValuePerChannel;
1856 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::maximumValuePerChannel;
1858 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::maximumValuePerChannel;
1860 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::maximumValuePerChannel;
1862 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::maximumValuePerChannel;
1864 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::maximumValuePerChannel;
1866 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::maximumValuePerChannel;
1868 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::maximumValuePerChannel;
1870 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::maximumValuePerChannel;
1872 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::maximumValuePerChannel;
1874 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::maximumValuePerChannel;
1876 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::maximumValuePerChannel;
1878 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::maximumValuePerChannel;
1880 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::maximumValuePerChannel;
1882 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::maximumValuePerChannel;
1884 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::maximumValuePerChannel;
1885 default:
1887 "The template does not match the data type of pixel format " + GetName() + "! Use float as template argument.");
1888 }
1889}
1890
1891/* @cond HIDE_FROM_DOXYGEN */
1897template <typename T>
1899{
1900 static_assert(true, "The given template type is not supported! Only size_t and float can be used.");
1901}
1902
1903/* @endcond */
1904
1918template <>
1920{
1921 switch (m_pixelFormat)
1922 {
1924 return detail::PixelFormatInfo<peak::common::PixelFormat::Coord3D_ABC32f>::minimumValuePerChannel;
1926 return detail::PixelFormatInfo<peak::common::PixelFormat::Coord3D_C32f>::minimumValuePerChannel;
1927 default:
1929 "The template does not match the data type of pixel format " + GetName() + "! Use size_t as template argument.");
1930 }
1931}
1932
1945template <>
1947{
1948 switch (m_pixelFormat)
1949 {
1950 case PixelFormat::Mono8:
1951 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono8>::minimumValuePerChannel;
1953 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>::minimumValuePerChannel;
1955 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>::minimumValuePerChannel;
1957 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>::minimumValuePerChannel;
1959 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>::minimumValuePerChannel;
1961 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>::minimumValuePerChannel;
1962 case PixelFormat::RGB8:
1963 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>::minimumValuePerChannel;
1964 case PixelFormat::RGB10:
1965 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>::minimumValuePerChannel;
1966 case PixelFormat::RGB12:
1967 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>::minimumValuePerChannel;
1968 case PixelFormat::RGBa8:
1969 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>::minimumValuePerChannel;
1971 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>::minimumValuePerChannel;
1973 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>::minimumValuePerChannel;
1974 case PixelFormat::BGR8:
1975 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>::minimumValuePerChannel;
1976 case PixelFormat::BGR10:
1977 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>::minimumValuePerChannel;
1978 case PixelFormat::BGR12:
1979 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>::minimumValuePerChannel;
1980 case PixelFormat::BGRa8:
1981 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>::minimumValuePerChannel;
1983 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>::minimumValuePerChannel;
1985 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>::minimumValuePerChannel;
1987 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>::minimumValuePerChannel;
1989 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>::minimumValuePerChannel;
1991 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>::minimumValuePerChannel;
1993 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>::minimumValuePerChannel;
1995 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>::minimumValuePerChannel;
1997 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>::minimumValuePerChannel;
1999 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>::minimumValuePerChannel;
2001 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>::minimumValuePerChannel;
2003 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>::minimumValuePerChannel;
2005 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>::minimumValuePerChannel;
2007 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>::minimumValuePerChannel;
2009 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>::minimumValuePerChannel;
2011 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>::minimumValuePerChannel;
2013 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>::minimumValuePerChannel;
2015 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>::minimumValuePerChannel;
2017 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>::minimumValuePerChannel;
2019 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>::minimumValuePerChannel;
2021 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>::minimumValuePerChannel;
2023 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>::minimumValuePerChannel;
2025 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>::minimumValuePerChannel;
2027 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>::minimumValuePerChannel;
2029 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>::minimumValuePerChannel;
2031 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>::minimumValuePerChannel;
2033 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>::minimumValuePerChannel;
2035 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::minimumValuePerChannel;
2037 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::minimumValuePerChannel;
2039 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::minimumValuePerChannel;
2041 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::minimumValuePerChannel;
2043 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::minimumValuePerChannel;
2045 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::minimumValuePerChannel;
2047 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::minimumValuePerChannel;
2049 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::minimumValuePerChannel;
2051 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::minimumValuePerChannel;
2053 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::minimumValuePerChannel;
2055 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::minimumValuePerChannel;
2057 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::minimumValuePerChannel;
2059 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::minimumValuePerChannel;
2061 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::minimumValuePerChannel;
2063 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::minimumValuePerChannel;
2064 default:
2066 "The template does not match the data type of pixel format " + GetName() + "! Use float as template argument.");
2067 }
2068}
2069
2070/* @cond HIDE_FROM_DOXYGEN */
2076template <typename T>
2078{
2079 static_assert(true, "The given template type is not supported! Only size_t and float can be used.");
2080}
2081
2082/* @endcond */
2083
2085{
2086 switch (m_pixelFormat)
2087 {
2088 case PixelFormat::Mono8:
2089 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono8>::storageBitsPerPixel;
2091 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>::storageBitsPerPixel;
2093 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>::storageBitsPerPixel;
2095 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>::storageBitsPerPixel;
2097 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>::storageBitsPerPixel;
2099 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>::storageBitsPerPixel;
2100 case PixelFormat::RGB8:
2101 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>::storageBitsPerPixel;
2102 case PixelFormat::RGB10:
2103 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>::storageBitsPerPixel;
2104 case PixelFormat::RGB12:
2105 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>::storageBitsPerPixel;
2106 case PixelFormat::RGBa8:
2107 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>::storageBitsPerPixel;
2109 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>::storageBitsPerPixel;
2111 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>::storageBitsPerPixel;
2112 case PixelFormat::BGR8:
2113 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>::storageBitsPerPixel;
2114 case PixelFormat::BGR10:
2115 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>::storageBitsPerPixel;
2116 case PixelFormat::BGR12:
2117 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>::storageBitsPerPixel;
2118 case PixelFormat::BGRa8:
2119 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>::storageBitsPerPixel;
2121 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>::storageBitsPerPixel;
2123 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>::storageBitsPerPixel;
2125 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>::storageBitsPerPixel;
2127 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>::storageBitsPerPixel;
2129 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>::storageBitsPerPixel;
2131 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>::storageBitsPerPixel;
2133 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>::storageBitsPerPixel;
2135 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>::storageBitsPerPixel;
2137 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>::storageBitsPerPixel;
2139 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>::storageBitsPerPixel;
2141 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>::storageBitsPerPixel;
2143 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>::storageBitsPerPixel;
2145 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>::storageBitsPerPixel;
2147 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>::storageBitsPerPixel;
2149 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>::storageBitsPerPixel;
2151 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>::storageBitsPerPixel;
2153 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>::storageBitsPerPixel;
2155 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>::storageBitsPerPixel;
2157 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>::storageBitsPerPixel;
2159 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>::storageBitsPerPixel;
2161 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>::storageBitsPerPixel;
2163 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>::storageBitsPerPixel;
2165 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>::storageBitsPerPixel;
2167 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>::storageBitsPerPixel;
2169 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>::storageBitsPerPixel;
2171 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>::storageBitsPerPixel;
2173 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::storageBitsPerPixel;
2175 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::storageBitsPerPixel;
2177 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C32f>::storageBitsPerPixel;
2179 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_ABC32f>::storageBitsPerPixel;
2181 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::storageBitsPerPixel;
2183 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::storageBitsPerPixel;
2185 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::storageBitsPerPixel;
2187 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::storageBitsPerPixel;
2189 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::storageBitsPerPixel;
2191 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::storageBitsPerPixel;
2193 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::storageBitsPerPixel;
2195 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::storageBitsPerPixel;
2197 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::storageBitsPerPixel;
2199 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::storageBitsPerPixel;
2201 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::storageBitsPerPixel;
2203 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::storageBitsPerPixel;
2205 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::storageBitsPerPixel;
2206 }
2207 const auto pixelFormatValue = static_cast<typename std::underlying_type<decltype(m_pixelFormat)>::type>(m_pixelFormat);
2209 "The given pixel format with the integer value of " + std::to_string(pixelFormatValue) + " is unknown!");
2210}
2211
2213{
2214 switch (m_pixelFormat)
2215 {
2216 case PixelFormat::Mono8:
2217 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono8>::storageBitsPerChannel;
2219 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>::storageBitsPerChannel;
2221 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>::storageBitsPerChannel;
2223 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>::storageBitsPerChannel;
2225 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>::storageBitsPerChannel;
2227 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>::storageBitsPerChannel;
2228 case PixelFormat::RGB8:
2229 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>::storageBitsPerChannel;
2230 case PixelFormat::RGB10:
2231 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>::storageBitsPerChannel;
2232 case PixelFormat::RGB12:
2233 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>::storageBitsPerChannel;
2234 case PixelFormat::RGBa8:
2235 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>::storageBitsPerChannel;
2237 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>::storageBitsPerChannel;
2239 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>::storageBitsPerChannel;
2240 case PixelFormat::BGR8:
2241 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>::storageBitsPerChannel;
2242 case PixelFormat::BGR10:
2243 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>::storageBitsPerChannel;
2244 case PixelFormat::BGR12:
2245 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>::storageBitsPerChannel;
2246 case PixelFormat::BGRa8:
2247 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>::storageBitsPerChannel;
2249 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>::storageBitsPerChannel;
2251 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>::storageBitsPerChannel;
2253 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>::storageBitsPerChannel;
2255 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>::storageBitsPerChannel;
2257 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>::storageBitsPerChannel;
2259 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>::storageBitsPerChannel;
2261 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>::storageBitsPerChannel;
2263 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>::storageBitsPerChannel;
2265 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>::storageBitsPerChannel;
2267 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>::storageBitsPerChannel;
2269 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>::storageBitsPerChannel;
2271 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>::storageBitsPerChannel;
2273 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>::storageBitsPerChannel;
2275 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>::storageBitsPerChannel;
2277 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>::storageBitsPerChannel;
2279 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>::storageBitsPerChannel;
2281 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>::storageBitsPerChannel;
2283 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>::storageBitsPerChannel;
2285 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>::storageBitsPerChannel;
2287 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>::storageBitsPerChannel;
2289 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>::storageBitsPerChannel;
2291 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>::storageBitsPerChannel;
2293 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>::storageBitsPerChannel;
2295 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>::storageBitsPerChannel;
2297 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>::storageBitsPerChannel;
2299 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>::storageBitsPerChannel;
2301 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::storageBitsPerChannel;
2303 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::storageBitsPerChannel;
2305 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C32f>::storageBitsPerChannel;
2307 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_ABC32f>::storageBitsPerChannel;
2309 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::storageBitsPerChannel;
2311 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::storageBitsPerChannel;
2313 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::storageBitsPerChannel;
2315 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::storageBitsPerChannel;
2317 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::storageBitsPerChannel;
2319 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::storageBitsPerChannel;
2321 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::storageBitsPerChannel;
2323 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::storageBitsPerChannel;
2325 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::storageBitsPerChannel;
2327 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::storageBitsPerChannel;
2329 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::storageBitsPerChannel;
2331 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::storageBitsPerChannel;
2333 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::storageBitsPerChannel;
2334 }
2335 const auto pixelFormatValue = static_cast<typename std::underlying_type<decltype(m_pixelFormat)>::type>(m_pixelFormat);
2337 "The given pixel format with the integer value of " + std::to_string(pixelFormatValue) + " is unknown!");
2338}
2339
2340inline std::string PixelFormatInfo::GetName() const
2341{
2342 switch (m_pixelFormat)
2343 {
2344 case PixelFormat::Mono8:
2345 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono8>::Name();
2347 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>::Name();
2349 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>::Name();
2351 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>::Name();
2353 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>::Name();
2355 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>::Name();
2356 case PixelFormat::RGB8:
2357 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>::Name();
2358 case PixelFormat::RGB10:
2359 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>::Name();
2360 case PixelFormat::RGB12:
2361 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>::Name();
2362 case PixelFormat::RGBa8:
2363 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>::Name();
2365 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>::Name();
2367 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>::Name();
2368 case PixelFormat::BGR8:
2369 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>::Name();
2370 case PixelFormat::BGR10:
2371 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>::Name();
2372 case PixelFormat::BGR12:
2373 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>::Name();
2374 case PixelFormat::BGRa8:
2375 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>::Name();
2377 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>::Name();
2379 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>::Name();
2381 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>::Name();
2383 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>::Name();
2385 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>::Name();
2387 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>::Name();
2389 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>::Name();
2391 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>::Name();
2393 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>::Name();
2395 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>::Name();
2397 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>::Name();
2399 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>::Name();
2401 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>::Name();
2403 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>::Name();
2405 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>::Name();
2407 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>::Name();
2409 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>::Name();
2411 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>::Name();
2413 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>::Name();
2415 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>::Name();
2417 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>::Name();
2419 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>::Name();
2421 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>::Name();
2423 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>::Name();
2425 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>::Name();
2427 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>::Name();
2429 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::Name();
2431 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::Name();
2433 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C32f>::Name();
2435 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_ABC32f>::Name();
2437 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::Name();
2439 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::Name();
2441 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::Name();
2443 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::Name();
2445 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::Name();
2447 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::Name();
2449 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::Name();
2451 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::Name();
2453 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::Name();
2455 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::Name();
2457 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::Name();
2459 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::Name();
2461 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::Name();
2462 }
2463 const auto pixelFormatValue = static_cast<typename std::underlying_type<decltype(m_pixelFormat)>::type>(m_pixelFormat);
2465 "The given pixel format with the integer value of " + std::to_string(pixelFormatValue) + " is unknown!");
2466}
2467
2468inline std::vector<Channel> PixelFormatInfo::GetChannels() const
2469{
2470 switch (m_pixelFormat)
2471 {
2472 case PixelFormat::Mono8:
2473 return { detail::ChannelsVector<detail::PixelFormatInfo<peak::common::PixelFormat::Mono8>>() };
2475 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>>() };
2477 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>>() };
2479 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>>() };
2481 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>>() };
2483 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>>() };
2484 case PixelFormat::RGB8:
2485 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>>() };
2486 case PixelFormat::RGB10:
2487 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>>() };
2488 case PixelFormat::RGB12:
2489 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>>() };
2490 case PixelFormat::RGBa8:
2491 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>>() };
2493 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>>() };
2495 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>>() };
2496 case PixelFormat::BGR8:
2497 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>>() };
2498 case PixelFormat::BGR10:
2499 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>>() };
2500 case PixelFormat::BGR12:
2501 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>>() };
2502 case PixelFormat::BGRa8:
2503 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>>() };
2505 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>>() };
2507 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>>() };
2509 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>>() };
2511 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>>() };
2513 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>>() };
2515 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>>() };
2517 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>>() };
2519 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>>() };
2521 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>>() };
2523 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>>() };
2525 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>>() };
2527 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>>() };
2529 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>>() };
2531 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>>() };
2533 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>>() };
2535 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>>() };
2537 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>>() };
2539 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>>() };
2541 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>>() };
2543 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>>() };
2545 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>>() };
2547 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>>() };
2549 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>>() };
2551 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>>() };
2553 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>>() };
2555 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>>() };
2557 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>>() };
2559 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>>() };
2561 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C32f>>() };
2563 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_ABC32f>>() };
2565 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>>() };
2567 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>>() };
2569 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>>() };
2571 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>>() };
2573 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>>() };
2575 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>>() };
2577 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>>() };
2579 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>>() };
2581 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>>() };
2583 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>>() };
2585 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>>() };
2587 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>>() };
2589 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>>() };
2590 }
2591 const auto pixelFormatValue = static_cast<typename std::underlying_type<decltype(m_pixelFormat)>::type>(m_pixelFormat);
2593 "The given pixel format with the integer value of " + std::to_string(pixelFormatValue) + " is unknown!");
2594}
2595
2597{
2598 switch (m_pixelFormat)
2599 {
2600 case PixelFormat::Mono8:
2601 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono8>::allocatedBitsPerPixel;
2603 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>::allocatedBitsPerPixel;
2605 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>::allocatedBitsPerPixel;
2607 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>::allocatedBitsPerPixel;
2609 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>::allocatedBitsPerPixel;
2611 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>::allocatedBitsPerPixel;
2612 case PixelFormat::RGB8:
2613 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>::allocatedBitsPerPixel;
2614 case PixelFormat::RGB10:
2615 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>::allocatedBitsPerPixel;
2616 case PixelFormat::RGB12:
2617 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>::allocatedBitsPerPixel;
2618 case PixelFormat::RGBa8:
2619 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>::allocatedBitsPerPixel;
2621 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>::allocatedBitsPerPixel;
2623 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>::allocatedBitsPerPixel;
2624 case PixelFormat::BGR8:
2625 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>::allocatedBitsPerPixel;
2626 case PixelFormat::BGR10:
2627 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>::allocatedBitsPerPixel;
2628 case PixelFormat::BGR12:
2629 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>::allocatedBitsPerPixel;
2630 case PixelFormat::BGRa8:
2631 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>::allocatedBitsPerPixel;
2633 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>::allocatedBitsPerPixel;
2635 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>::allocatedBitsPerPixel;
2637 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>::allocatedBitsPerPixel;
2639 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>::allocatedBitsPerPixel;
2641 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>::allocatedBitsPerPixel;
2643 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>::allocatedBitsPerPixel;
2645 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>::allocatedBitsPerPixel;
2647 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>::allocatedBitsPerPixel;
2649 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>::allocatedBitsPerPixel;
2651 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>::allocatedBitsPerPixel;
2653 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>::allocatedBitsPerPixel;
2655 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>::allocatedBitsPerPixel;
2657 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>::allocatedBitsPerPixel;
2659 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>::allocatedBitsPerPixel;
2661 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>::allocatedBitsPerPixel;
2663 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>::allocatedBitsPerPixel;
2665 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>::allocatedBitsPerPixel;
2667 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>::allocatedBitsPerPixel;
2669 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>::allocatedBitsPerPixel;
2671 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>::allocatedBitsPerPixel;
2673 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>::allocatedBitsPerPixel;
2675 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>::allocatedBitsPerPixel;
2677 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>::allocatedBitsPerPixel;
2679 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>::allocatedBitsPerPixel;
2681 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>::allocatedBitsPerPixel;
2683 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>::allocatedBitsPerPixel;
2685 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::allocatedBitsPerPixel;
2687 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::allocatedBitsPerPixel;
2689 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C32f>::allocatedBitsPerPixel;
2691 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_ABC32f>::allocatedBitsPerPixel;
2693 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::allocatedBitsPerPixel;
2695 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::allocatedBitsPerPixel;
2697 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::allocatedBitsPerPixel;
2699 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::allocatedBitsPerPixel;
2701 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::allocatedBitsPerPixel;
2703 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::allocatedBitsPerPixel;
2705 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::allocatedBitsPerPixel;
2707 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::allocatedBitsPerPixel;
2709 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::allocatedBitsPerPixel;
2711 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::allocatedBitsPerPixel;
2713 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::allocatedBitsPerPixel;
2715 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::allocatedBitsPerPixel;
2717 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::allocatedBitsPerPixel;
2718 }
2719 const auto pixelFormatValue = static_cast<typename std::underlying_type<decltype(m_pixelFormat)>::type>(m_pixelFormat);
2721 "The given pixel format with the integer value of " + std::to_string(pixelFormatValue) + " is unknown!");
2722}
2723
2725{
2727}
2728
2729inline size_t PixelFormatInfo::GetChannelIndex(Channel channel) const
2730{
2731 const auto channels = this->GetChannels();
2732 const auto it = std::find(channels.cbegin(), channels.cend(), channel);
2733 if (it == channels.end())
2734 {
2735 throw InvalidParameterException("The given channel is not part of the pixel format " + GetName() + '!');
2736 }
2737
2738 return static_cast<size_t>(std::distance(channels.begin(), it));
2739}
2740
2742{
2743 return this->GetChannels().size();
2744}
2745
2747{
2748 return GetNumberOfChannels() == 1;
2749}
2750
2751inline bool PixelFormatInfo::HasChannel(Channel channel) const
2752{
2753 const auto channels = this->GetChannels();
2754 return std::find(channels.cbegin(), channels.cend(), channel) != channels.cend();
2755}
2756
2758{
2759 return m_pixelFormat;
2760}
2761
2762inline size_t PixelFormatInfo::GetSizeInBytes(const Size& size) const
2763{
2764 switch (m_pixelFormat)
2765 {
2766 case PixelFormat::Mono8:
2767 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono8>::GetSizeInBytes(size);
2769 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>::GetSizeInBytes(size);
2771 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>::GetSizeInBytes(size);
2773 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>::GetSizeInBytes(size);
2775 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>::GetSizeInBytes(size);
2777 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>::GetSizeInBytes(size);
2778 case PixelFormat::RGB8:
2779 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>::GetSizeInBytes(size);
2780 case PixelFormat::RGB10:
2781 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>::GetSizeInBytes(size);
2782 case PixelFormat::RGB12:
2783 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>::GetSizeInBytes(size);
2784 case PixelFormat::RGBa8:
2785 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>::GetSizeInBytes(size);
2787 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>::GetSizeInBytes(size);
2789 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>::GetSizeInBytes(size);
2790 case PixelFormat::BGR8:
2791 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>::GetSizeInBytes(size);
2792 case PixelFormat::BGR10:
2793 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>::GetSizeInBytes(size);
2794 case PixelFormat::BGR12:
2795 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>::GetSizeInBytes(size);
2796 case PixelFormat::BGRa8:
2797 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>::GetSizeInBytes(size);
2799 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>::GetSizeInBytes(size);
2801 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>::GetSizeInBytes(size);
2803 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>::GetSizeInBytes(size);
2805 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>::GetSizeInBytes(size);
2807 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>::GetSizeInBytes(size);
2809 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>::GetSizeInBytes(size);
2811 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>::GetSizeInBytes(size);
2813 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>::GetSizeInBytes(size);
2815 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>::GetSizeInBytes(size);
2817 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>::GetSizeInBytes(size);
2819 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>::GetSizeInBytes(size);
2821 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>::GetSizeInBytes(size);
2823 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>::GetSizeInBytes(size);
2825 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>::GetSizeInBytes(size);
2827 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>::GetSizeInBytes(size);
2829 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>::GetSizeInBytes(size);
2831 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>::GetSizeInBytes(size);
2833 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>::GetSizeInBytes(size);
2835 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>::GetSizeInBytes(size);
2837 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>::GetSizeInBytes(size);
2839 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>::GetSizeInBytes(size);
2841 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>::GetSizeInBytes(size);
2843 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>::GetSizeInBytes(size);
2845 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>::GetSizeInBytes(size);
2847 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>::GetSizeInBytes(size);
2849 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>::GetSizeInBytes(size);
2851 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::GetSizeInBytes(size);
2853 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::GetSizeInBytes(size);
2855 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C32f>::GetSizeInBytes(size);
2857 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_ABC32f>::GetSizeInBytes(size);
2859 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::GetSizeInBytes(size);
2861 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::GetSizeInBytes(size);
2863 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::GetSizeInBytes(size);
2865 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::GetSizeInBytes(size);
2867 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::GetSizeInBytes(size);
2869 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::GetSizeInBytes(size);
2871 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::GetSizeInBytes(size);
2873 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::GetSizeInBytes(size);
2875 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::GetSizeInBytes(size);
2877 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::GetSizeInBytes(size);
2879 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::GetSizeInBytes(size);
2881 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::GetSizeInBytes(size);
2883 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::GetSizeInBytes(size);
2884 }
2885 const auto pixelFormatValue = static_cast<typename std::underlying_type<decltype(m_pixelFormat)>::type>(m_pixelFormat);
2887 "The given pixel format with the integer value of " + std::to_string(pixelFormatValue) + " is unknown!");
2888}
2889
2890inline bool PixelFormatInfo::IsPacked() const
2891{
2892 switch (m_pixelFormat)
2893 {
2894 case PixelFormat::Mono8:
2895 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono8>::IsPacked();
2897 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>::IsPacked();
2899 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>::IsPacked();
2901 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>::IsPacked();
2903 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>::IsPacked();
2905 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>::IsPacked();
2906 case PixelFormat::RGB8:
2907 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>::IsPacked();
2908 case PixelFormat::RGB10:
2909 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>::IsPacked();
2910 case PixelFormat::RGB12:
2911 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>::IsPacked();
2912 case PixelFormat::RGBa8:
2913 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>::IsPacked();
2915 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>::IsPacked();
2917 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>::IsPacked();
2918 case PixelFormat::BGR8:
2919 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>::IsPacked();
2920 case PixelFormat::BGR10:
2921 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>::IsPacked();
2922 case PixelFormat::BGR12:
2923 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>::IsPacked();
2924 case PixelFormat::BGRa8:
2925 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>::IsPacked();
2927 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>::IsPacked();
2929 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>::IsPacked();
2931 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>::IsPacked();
2933 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>::IsPacked();
2935 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>::IsPacked();
2937 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>::IsPacked();
2939 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>::IsPacked();
2941 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>::IsPacked();
2943 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>::IsPacked();
2945 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>::IsPacked();
2947 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>::IsPacked();
2949 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>::IsPacked();
2951 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>::IsPacked();
2953 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>::IsPacked();
2955 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>::IsPacked();
2957 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>::IsPacked();
2959 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>::IsPacked();
2961 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>::IsPacked();
2963 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>::IsPacked();
2965 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>::IsPacked();
2967 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>::IsPacked();
2969 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>::IsPacked();
2971 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>::IsPacked();
2973 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>::IsPacked();
2975 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>::IsPacked();
2977 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>::IsPacked();
2979 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::IsPacked();
2981 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::IsPacked();
2983 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C32f>::IsPacked();
2985 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_ABC32f>::IsPacked();
2987 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::IsPacked();
2989 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::IsPacked();
2991 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::IsPacked();
2993 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::IsPacked();
2995 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::IsPacked();
2997 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::IsPacked();
2999 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::IsPacked();
3001 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::IsPacked();
3003 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::IsPacked();
3005 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::IsPacked();
3007 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::IsPacked();
3009 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::IsPacked();
3011 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::IsPacked();
3012 }
3013 const auto pixelFormatValue = static_cast<typename std::underlying_type<decltype(m_pixelFormat)>::type>(m_pixelFormat);
3015 "The given pixel format with the integer value of " + std::to_string(pixelFormatValue) + " is unknown!");
3016}
3017
3018inline bool PixelFormatInfo::IsFloat() const
3019{
3020 switch (m_pixelFormat)
3021 {
3022 case PixelFormat::Mono8:
3023 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono8>::is_floating_point;
3025 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>::is_floating_point;
3027 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>::is_floating_point;
3029 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>::is_floating_point;
3031 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>::is_floating_point;
3033 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>::is_floating_point;
3034 case PixelFormat::RGB8:
3035 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>::is_floating_point;
3036 case PixelFormat::RGB10:
3037 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>::is_floating_point;
3038 case PixelFormat::RGB12:
3039 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>::is_floating_point;
3040 case PixelFormat::RGBa8:
3041 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>::is_floating_point;
3043 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>::is_floating_point;
3045 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>::is_floating_point;
3046 case PixelFormat::BGR8:
3047 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>::is_floating_point;
3048 case PixelFormat::BGR10:
3049 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>::is_floating_point;
3050 case PixelFormat::BGR12:
3051 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>::is_floating_point;
3052 case PixelFormat::BGRa8:
3053 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>::is_floating_point;
3055 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>::is_floating_point;
3057 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>::is_floating_point;
3059 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>::is_floating_point;
3061 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>::is_floating_point;
3063 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>::is_floating_point;
3065 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>::is_floating_point;
3067 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>::is_floating_point;
3069 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>::is_floating_point;
3071 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>::is_floating_point;
3073 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>::is_floating_point;
3075 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>::is_floating_point;
3077 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>::is_floating_point;
3079 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>::is_floating_point;
3081 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>::is_floating_point;
3083 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>::is_floating_point;
3085 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>::is_floating_point;
3087 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>::is_floating_point;
3089 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>::is_floating_point;
3091 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>::is_floating_point;
3093 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>::is_floating_point;
3095 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>::is_floating_point;
3097 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>::is_floating_point;
3099 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>::is_floating_point;
3101 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>::is_floating_point;
3103 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>::is_floating_point;
3105 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>::is_floating_point;
3107 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::is_floating_point;
3109 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::is_floating_point;
3111 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C32f>::is_floating_point;
3113 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_ABC32f>::is_floating_point;
3115 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::is_floating_point;
3117 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::is_floating_point;
3119 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::is_floating_point;
3121 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::is_floating_point;
3123 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::is_floating_point;
3125 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::is_floating_point;
3127 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::is_floating_point;
3129 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::is_floating_point;
3131 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::is_floating_point;
3133 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::is_floating_point;
3135 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::is_floating_point;
3137 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::is_floating_point;
3139 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::is_floating_point;
3140 }
3141 const auto pixelFormatValue = static_cast<typename std::underlying_type<decltype(m_pixelFormat)>::type>(m_pixelFormat);
3143 "The given pixel format with the integer value of " + std::to_string(pixelFormatValue) + " is unknown!");
3144}
3145
3147{
3148 switch (m_pixelFormat)
3149 {
3150 case PixelFormat::Mono8:
3151 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono8>::GetUnpackedFormat();
3153 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>::GetUnpackedFormat();
3155 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>::GetUnpackedFormat();
3157 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>::GetUnpackedFormat();
3159 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>::GetUnpackedFormat();
3161 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>::GetUnpackedFormat();
3162 case PixelFormat::RGB8:
3163 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>::GetUnpackedFormat();
3164 case PixelFormat::RGB10:
3165 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>::GetUnpackedFormat();
3166 case PixelFormat::RGB12:
3167 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>::GetUnpackedFormat();
3168 case PixelFormat::RGBa8:
3169 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>::GetUnpackedFormat();
3171 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>::GetUnpackedFormat();
3173 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>::GetUnpackedFormat();
3174 case PixelFormat::BGR8:
3175 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>::GetUnpackedFormat();
3176 case PixelFormat::BGR10:
3177 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>::GetUnpackedFormat();
3178 case PixelFormat::BGR12:
3179 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>::GetUnpackedFormat();
3180 case PixelFormat::BGRa8:
3181 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>::GetUnpackedFormat();
3183 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>::GetUnpackedFormat();
3185 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>::GetUnpackedFormat();
3187 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>::GetUnpackedFormat();
3189 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>::GetUnpackedFormat();
3191 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>::GetUnpackedFormat();
3193 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>::GetUnpackedFormat();
3195 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>::GetUnpackedFormat();
3197 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>::GetUnpackedFormat();
3199 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>::GetUnpackedFormat();
3201 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>::GetUnpackedFormat();
3203 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>::GetUnpackedFormat();
3205 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>::GetUnpackedFormat();
3207 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>::GetUnpackedFormat();
3209 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>::GetUnpackedFormat();
3211 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>::GetUnpackedFormat();
3213 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>::GetUnpackedFormat();
3215 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>::GetUnpackedFormat();
3217 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>::GetUnpackedFormat();
3219 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>::GetUnpackedFormat();
3221 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>::GetUnpackedFormat();
3223 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>::GetUnpackedFormat();
3225 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>::GetUnpackedFormat();
3227 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>::GetUnpackedFormat();
3229 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>::GetUnpackedFormat();
3231 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>::GetUnpackedFormat();
3233 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>::GetUnpackedFormat();
3235 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::GetUnpackedFormat();
3237 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::GetUnpackedFormat();
3239 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C32f>::GetUnpackedFormat();
3241 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_ABC32f>::GetUnpackedFormat();
3243 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::GetUnpackedFormat();
3245 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::GetUnpackedFormat();
3247 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::GetUnpackedFormat();
3249 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::GetUnpackedFormat();
3251 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::GetUnpackedFormat();
3253 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::GetUnpackedFormat();
3255 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::GetUnpackedFormat();
3257 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::GetUnpackedFormat();
3259 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::GetUnpackedFormat();
3261 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::GetUnpackedFormat();
3263 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::GetUnpackedFormat();
3265 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::GetUnpackedFormat();
3267 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::GetUnpackedFormat();
3268 }
3269 const auto pixelFormatValue = static_cast<typename std::underlying_type<decltype(m_pixelFormat)>::type>(m_pixelFormat);
3271 "The given pixel format with the integer value of " + std::to_string(pixelFormatValue) + " is unknown!");
3272}
3273} // namespace common
3274} // namespace peak
Thrown when a function receives an invalid parameter.
Provides information and utility functions for pixel formats.
std::vector< Channel > GetChannels() const
Returns the list of channels in the pixel format.
PixelFormatInfo(peak::common::PixelFormat pixelFormat)
Constructs a PixelFormatInfo object for the specified pixel format.
T GetMinimumValuePerChannel() const
Returns the minimum possible value per channel for the pixel format.
bool HasIntensityChannel() const
Checks whether the pixel format includes an intensity channel.
PixelFormat GetUnpackedPixelFormat() const
Returns the unpacked pixel format for a packed pixel format.
size_t GetChannelIndex(Channel channel) const
Returns the index of a specific channel within the pixel format.
size_t GetStorageBitsPerPixel() const
Returns the total number of bits used per pixel for storage.
bool HasChannel(Channel channel) const
Checks whether a specific channel is present in the pixel format.
size_t GetNumberOfChannels() const
Returns the total number of channels in the pixel format.
size_t GetSizeInBytes(const Size &size) const
Calculates the memory size in bytes for a given image size.
size_t GetAllocatedBitsPerPixel() const
Returns the number of allocated bits per pixel.
T GetMaximumValuePerChannel() const
Returns the maximum possible value per channel for the pixel format.
size_t GetStorageBitsPerChannel() const
Returns the number of bits used per channel for storage.
bool IsSingleChannel() const
Checks whether the pixel format contains only a single channel.
peak::common::PixelFormat GetPixelFormat() const
Returns the underlying pixel format enumeration value.
std::string GetName() const
Returns the human-readable name of the pixel format.
bool IsFloat() const
Returns whether the pixel format uses floating points.
bool IsPacked() const
Returns whether the pixel format is packed.
Represents a two-dimensional size with non-negative width and height.
Channel
Represents the various data channels in image or spatial data formats.
PixelFormat
Enum listing all supported pixel formats and their internal IDs.
@ BayerRG12g24IDS
BayerRG 12-Bit grouped 24-bit (IDS)
@ Coord3D_C8
3D coordinate C 8-Bit format
@ RGBa10
RGBA 10-Bit pixel format.
@ RGB8
RGB 8-Bit pixel format.
@ Mono12p
Mono 12-Bit packed format.
@ Mono12
Mono 12-Bit pixel format.
@ BGR10p32
BGR 10-Bit packed 32-bit format.
@ BayerGB10
BayerGB 10-Bit pixel format.
@ BayerRG12p
BayerRG 12-Bit packed format.
@ BayerBG10
BayerBG 10-Bit pixel format.
@ RGBa8
RGBA 8-Bit pixel format.
@ Mono10g40IDS
Mono 10-Bit grouped 40-bit (IDS)
@ BayerGR10g40IDS
BayerGR 10-Bit grouped 40-bit (IDS)
@ BayerBG10p
BayerBG 10-Bit packed format.
@ RGBa12
RGBA 12-Bit pixel format.
@ BayerGB12p
BayerGB 12-Bit packed format.
@ BGRa12
BGRA 12-Bit pixel format.
@ BayerGR12
BayerGR 12-Bit pixel format.
@ BayerRG10p
BayerRG 10-Bit packed format.
@ BayerRG12
BayerRG 12-Bit pixel format.
@ BayerGR12p
BayerGR 12-Bit packed format.
@ BayerGR8
BayerGR 8-Bit pixel format.
@ BayerBG12p
BayerBG 12-Bit packed format.
@ BayerBG8
BayerBG 8-Bit pixel format.
@ Confidence16
Confidence 16-Bit format.
@ Mono12g24IDS
Mono 12-Bit grouped 24-bit (IDS)
@ BayerRG10
BayerRG 10-Bit pixel format.
@ BayerGB12
BayerGB 12-Bit pixel format.
@ BayerRG8
BayerRG 8-Bit pixel format.
@ BayerGR10p
BayerGR 10-Bit packed format.
@ YUV422_8_UYVY
UYVY 4:2:2 8-Bit format.
@ YUV420_8_YY_VU_SemiplanarIDS
YUV4:2:0 8-Bit YY/VU semiplanar (IDS)
@ BayerGB8
BayerGB 8-Bit pixel format.
@ BGR12
BGR 12-Bit pixel format.
@ Confidence8
Confidence 8-Bit format.
@ RGB10
RGB 10-Bit pixel format.
@ BayerGR12g24IDS
BayerGR 12-Bit grouped 24-bit (IDS)
@ YUV420_8_YY_UV_SemiplanarIDS
YUV4:2:0 8-Bit YY/UV semiplanar (IDS)
@ BayerGR10
BayerGR 10-Bit pixel format.
@ Coord3D_C32f
3D coordinate C 32-Bit float format
@ Mono16
Mono 16-Bit pixel format.
@ Mono10
Mono 10-Bit pixel format.
@ Mono8
Mono 8-Bit pixel format.
@ BGR10
BGR 10-Bit pixel format.
@ Coord3D_ABC32f
3D coordinates A, B, C 32-Bit float format
@ RGB12
RGB 12-Bit pixel format.
@ BayerBG12
BayerBG 12-Bit pixel format.
@ BayerBG10g40IDS
BayerBG 10-Bit grouped 40-bit (IDS)
@ BayerGB10p
BayerGB 10-Bit packed format.
@ BGRa8
BGRA 8-Bit pixel format.
@ BGRa10
BGRA 10-Bit pixel format.
@ Coord3D_C16
3D coordinate C 16-Bit format
@ BGR8
BGR 8-Bit pixel format.
@ BayerBG12g24IDS
BayerBG 12-Bit grouped 24-bit (IDS)
@ Mono10p
Mono 10-Bit packed format.
@ BayerRG10g40IDS
BayerRG 10-Bit grouped 40-bit (IDS)
@ RGB10p32
RGB 10-Bit packed 32-bit format.
@ BayerGB10g40IDS
BayerGB 10-Bit grouped 40-bit (IDS)
@ BayerGB12g24IDS
BayerGB 12-Bit grouped 24-bit (IDS)
std::ostream & operator<<(std::ostream &os, PixelFormat pixelFormat)