IDS peak ICV v1.0.0
Loading...
Searching...
No Matches
peak_common_pixel_format.hpp
Go to the documentation of this file.
1
13#pragma once
14
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
33// clang-format off
44enum class PixelFormat : uint64_t
45{
46 BayerGR8 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_8,
47 BayerGR10 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_10,
48 BayerGR12 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_12,
49
50 BayerRG8 = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_8,
51 BayerRG10 = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_10,
52 BayerRG12 = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_12,
53
54 BayerGB8 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_8,
55 BayerGB10 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_10,
56 BayerGB12 = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_12,
57
58 BayerBG8 = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_8,
59 BayerBG10 = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_10,
60 BayerBG12 = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_12,
61
62 Mono8 = PEAK_COMMON_PIXEL_FORMAT_MONO_8,
63 Mono10 = PEAK_COMMON_PIXEL_FORMAT_MONO_10,
64 Mono12 = PEAK_COMMON_PIXEL_FORMAT_MONO_12,
65 Mono16 = PEAK_COMMON_PIXEL_FORMAT_MONO_16,
66
67 Confidence8 = PEAK_COMMON_PIXEL_FORMAT_CONFIDENCE_8,
68 Confidence16 = PEAK_COMMON_PIXEL_FORMAT_CONFIDENCE_16,
69
70 Coord3D_C8 = PEAK_COMMON_PIXEL_FORMAT_COORD3D_C8,
71 Coord3D_C16 = PEAK_COMMON_PIXEL_FORMAT_COORD3D_C16,
72 Coord3D_C32f = PEAK_COMMON_PIXEL_FORMAT_COORD3D_C32F,
73
74 Coord3D_ABC32f = PEAK_COMMON_PIXEL_FORMAT_COORD3D_ABC32F,
75
76 YUV420_8_YY_UV_SemiplanarIDS = PEAK_COMMON_PIXEL_FORMAT_YUV420_8_YY_UV_SemiplanarIDS,
77 YUV420_8_YY_VU_SemiplanarIDS = PEAK_COMMON_PIXEL_FORMAT_YUV420_8_YY_VU_SemiplanarIDS,
78
79 YUV422_8_UYVY = PEAK_COMMON_PIXEL_FORMAT_YUV422_8_UYVY,
80
81 RGB8 = PEAK_COMMON_PIXEL_FORMAT_RGB_8,
82 RGB10 = PEAK_COMMON_PIXEL_FORMAT_RGB_10,
83 RGB12 = PEAK_COMMON_PIXEL_FORMAT_RGB_12,
84
85 BGR8 = PEAK_COMMON_PIXEL_FORMAT_BGR_8,
86 BGR10 = PEAK_COMMON_PIXEL_FORMAT_BGR_10,
87 BGR12 = PEAK_COMMON_PIXEL_FORMAT_BGR_12,
88
89 RGBa8 = PEAK_COMMON_PIXEL_FORMAT_RGBA_8,
90 RGBa10 = PEAK_COMMON_PIXEL_FORMAT_RGBA_10,
91 RGBa12 = PEAK_COMMON_PIXEL_FORMAT_RGBA_12,
92
93 BGRa8 = PEAK_COMMON_PIXEL_FORMAT_BGRA_8,
94 BGRa10 = PEAK_COMMON_PIXEL_FORMAT_BGRA_10,
95 BGRa12 = PEAK_COMMON_PIXEL_FORMAT_BGRA_12,
96
97 BayerBG10p = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_10_PACKED,
98 BayerBG12p = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_12_PACKED,
99
100 BayerGB10p = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_10_PACKED,
101 BayerGB12p = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_12_PACKED,
102
103 BayerGR10p = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_10_PACKED,
104 BayerGR12p = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_12_PACKED,
105
106 BayerRG10p = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_10_PACKED,
107 BayerRG12p = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_12_PACKED,
108
109 Mono10p = PEAK_COMMON_PIXEL_FORMAT_MONO_10_PACKED,
110 Mono12p = PEAK_COMMON_PIXEL_FORMAT_MONO_12_PACKED,
111
112 RGB10p32 = PEAK_COMMON_PIXEL_FORMAT_RGB_10_PACKED_32,
113 BGR10p32 = PEAK_COMMON_PIXEL_FORMAT_BGR_10_PACKED_32,
114
115 BayerRG10g40IDS = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_10_GROUPED_40_IDS,
116 BayerGB10g40IDS = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_10_GROUPED_40_IDS,
117 BayerGR10g40IDS = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_10_GROUPED_40_IDS,
118 BayerBG10g40IDS = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_10_GROUPED_40_IDS,
119
120 BayerRG12g24IDS = PEAK_COMMON_PIXEL_FORMAT_BAYER_RG_12_GROUPED_24_IDS,
121 BayerGB12g24IDS = PEAK_COMMON_PIXEL_FORMAT_BAYER_GB_12_GROUPED_24_IDS,
122 BayerGR12g24IDS = PEAK_COMMON_PIXEL_FORMAT_BAYER_GR_12_GROUPED_24_IDS,
123 BayerBG12g24IDS = PEAK_COMMON_PIXEL_FORMAT_BAYER_BG_12_GROUPED_24_IDS,
124
125 Mono10g40IDS = PEAK_COMMON_PIXEL_FORMAT_MONO_10_GROUPED_40_IDS,
126 Mono12g24IDS = PEAK_COMMON_PIXEL_FORMAT_MONO_12_GROUPED_24_IDS
127};
128
129// clang-format on
130
141{
142public:
149 explicit PixelFormatInfo(peak::common::PixelFormat pixelFormat);
150
157 explicit PixelFormatInfo(const std::string& name);
158
166 template <typename T = size_t>
168
176 template <typename T = size_t>
178
186
194
201 PEAK_COMMON_NO_DISCARD std::string GetName() const;
202
209 PEAK_COMMON_NO_DISCARD std::vector<Channel> GetChannels() const;
210
218
226
234 PEAK_COMMON_NO_DISCARD size_t GetChannelIndex(Channel channel) const;
235
243
251
259 PEAK_COMMON_NO_DISCARD bool HasChannel(Channel channel) const;
260
268
276 PEAK_COMMON_NO_DISCARD size_t GetSizeInBytes(const Size& size) const;
277
278private:
279 peak::common::PixelFormat m_pixelFormat;
280};
281
282inline std::ostream& operator<<(std::ostream& os, PixelFormat pixelFormat)
283{
284 PixelFormatInfo info(pixelFormat);
285 os << info.GetName();
286 return os;
287}
288
289namespace detail
290{
291
293template <peak::common::PixelFormat pixelFormat>
294struct PixelFormatTraits;
295
297
298template <>
299struct PixelFormatTraits<peak::common::PixelFormat::Mono8>
300{
301 using underlying_type = uint8_t;
302
303 static constexpr std::array<Channel, 1> Channels()
304 {
305 return { Channel::Intensity };
306 }
307
308 static constexpr auto Name()
309 {
310 return "Mono8";
311 }
312
313 static constexpr size_t storageBitsPerPixel = 8;
314 static constexpr size_t allocatedBitsPerPixel = 8;
315 static constexpr bool isPacked = false;
316 static constexpr bool isYUV = false;
317};
318
319template <>
320struct PixelFormatTraits<peak::common::PixelFormat::Mono10>
321{
322 using underlying_type = uint16_t;
323
324 static constexpr std::array<Channel, 1> Channels()
325 {
326 return { Channel::Intensity };
327 }
328
329 static constexpr auto Name()
330 {
331 return "Mono10";
332 }
333
334 static constexpr size_t storageBitsPerPixel = 10;
335 static constexpr size_t allocatedBitsPerPixel = 16;
336 static constexpr bool isPacked = false;
337 static constexpr bool isYUV = false;
338};
339
340template <>
341struct PixelFormatTraits<peak::common::PixelFormat::Mono12>
342{
343 using underlying_type = uint16_t;
344
345 static constexpr std::array<Channel, 1> Channels()
346 {
347 return { Channel::Intensity };
348 }
349
350 static constexpr auto Name()
351 {
352 return "Mono12";
353 }
354
355 static constexpr size_t storageBitsPerPixel = 12;
356 static constexpr size_t allocatedBitsPerPixel = 16;
357 static constexpr bool isPacked = false;
358 static constexpr bool isYUV = false;
359};
360
361template <>
362struct PixelFormatTraits<peak::common::PixelFormat::Mono16>
363{
364 using underlying_type = uint16_t;
365
366 static constexpr std::array<Channel, 1> Channels()
367 {
368 return { Channel::Intensity };
369 }
370
371 static constexpr auto Name()
372 {
373 return "Mono16";
374 }
375
376 static constexpr size_t storageBitsPerPixel = 16;
377 static constexpr size_t allocatedBitsPerPixel = 16;
378 static constexpr bool isPacked = false;
379 static constexpr bool isYUV = false;
380};
381
382template <>
383struct PixelFormatTraits<peak::common::PixelFormat::RGB8>
384{
385 using underlying_type = uint8_t;
386
387 static constexpr std::array<Channel, 3> Channels()
388 {
389 return { Channel::Red, Channel::Green, Channel::Blue };
390 }
391
392 static constexpr auto Name()
393 {
394 return "RGB8";
395 }
396
397 static constexpr size_t storageBitsPerPixel = 24;
398 static constexpr size_t allocatedBitsPerPixel = 24;
399 static constexpr bool isPacked = false;
400 static constexpr bool isYUV = false;
401};
402
403template <>
404struct PixelFormatTraits<peak::common::PixelFormat::RGBa8>
405{
406 using underlying_type = uint8_t;
407
408 static constexpr std::array<Channel, 4> Channels()
409 {
410 return { Channel::Red, Channel::Green, Channel::Blue, Channel::Alpha };
411 }
412
413 static constexpr auto Name()
414 {
415 return "RGBa8";
416 }
417
418 static constexpr size_t storageBitsPerPixel = 32;
419 static constexpr size_t allocatedBitsPerPixel = 32;
420 static constexpr bool isPacked = false;
421 static constexpr bool isYUV = false;
422};
423
424template <>
425struct PixelFormatTraits<peak::common::PixelFormat::BGR8>
426{
427 using underlying_type = uint8_t;
428
429 static constexpr std::array<Channel, 3> Channels()
430 {
431 return { Channel::Blue, Channel::Green, Channel::Red };
432 }
433
434 static constexpr auto Name()
435 {
436 return "BGR8";
437 }
438
439 static constexpr size_t storageBitsPerPixel = 24;
440 static constexpr size_t allocatedBitsPerPixel = 24;
441 static constexpr bool isPacked = false;
442 static constexpr bool isYUV = false;
443};
444
445template <>
446struct PixelFormatTraits<peak::common::PixelFormat::BGRa8>
447{
448 using underlying_type = uint8_t;
449
450 static constexpr std::array<Channel, 4> Channels()
451 {
452 return { Channel::Blue, Channel::Green, Channel::Red, Channel::Alpha };
453 }
454
455 static constexpr auto Name()
456 {
457 return "BGRa8";
458 }
459
460 static constexpr size_t storageBitsPerPixel = 32;
461 static constexpr size_t allocatedBitsPerPixel = 32;
462 static constexpr bool isPacked = false;
463 static constexpr bool isYUV = false;
464};
465
466template <>
468{
469 using underlying_type = float;
470
471 static constexpr std::array<Channel, 3> Channels()
472 {
473 return { Channel::X, Channel::Y, Channel::Z };
474 }
475
476 static constexpr auto Name()
477 {
478 return "Coord3D_ABC32f";
479 }
480
481 static constexpr size_t storageBitsPerPixel = 96;
482 static constexpr size_t allocatedBitsPerPixel = 96;
483 static constexpr bool isPacked = false;
484 static constexpr bool isYUV = false;
485};
486
487template <>
488struct PixelFormatTraits<peak::common::PixelFormat::Coord3D_C32f>
489{
490 using underlying_type = float;
491
492 static constexpr std::array<Channel, 1> Channels()
493 {
494 return { Channel::Intensity };
495 }
496
497 static constexpr auto Name()
498 {
499 return "Coord3D_C32f";
500 }
501
502 static constexpr size_t storageBitsPerPixel = 32;
503 static constexpr size_t allocatedBitsPerPixel = 32;
504 static constexpr bool isPacked = false;
505 static constexpr bool isYUV = false;
506};
507
508template <>
509struct PixelFormatTraits<PixelFormat::Mono10p>
510{
511 using underlying_type = uint16_t;
512
513 static constexpr std::array<Channel, 1> Channels()
514 {
515 return { Channel::Intensity };
516 }
517
518 static constexpr auto Name()
519 {
520 return "Mono10p";
521 }
522
523 static constexpr size_t storageBitsPerPixel = 10;
524 static constexpr size_t allocatedBitsPerPixel = 10;
525 static constexpr bool isPacked = true;
526 static constexpr bool isYUV = false;
527};
528
529template <>
530struct PixelFormatTraits<PixelFormat::Mono12p>
531{
532 using underlying_type = uint16_t;
533
534 static constexpr std::array<Channel, 1> Channels()
535 {
536 return { Channel::Intensity };
537 }
538
539 static constexpr auto Name()
540 {
541 return "Mono12p";
542 }
543
544 static constexpr size_t storageBitsPerPixel = 12;
545 static constexpr size_t allocatedBitsPerPixel = 12;
546 static constexpr bool isPacked = true;
547 static constexpr bool isYUV = false;
548};
549
550template <>
551struct PixelFormatTraits<PixelFormat::RGB10>
552{
553 using underlying_type = uint16_t;
554
555 static constexpr std::array<Channel, 3> Channels()
556 {
557 return { Channel::Red, Channel::Green, Channel::Blue };
558 }
559
560 static constexpr auto Name()
561 {
562 return "RGB10";
563 }
564
565 static constexpr size_t storageBitsPerPixel = 30;
566 static constexpr size_t allocatedBitsPerPixel = 48;
567 static constexpr bool isPacked = false;
568 static constexpr bool isYUV = false;
569};
570
571template <>
572struct PixelFormatTraits<PixelFormat::RGB12>
573{
574 using underlying_type = uint16_t;
575
576 static constexpr std::array<Channel, 3> Channels()
577 {
578 return { Channel::Red, Channel::Green, Channel::Blue };
579 }
580
581 static constexpr auto Name()
582 {
583 return "RGB12";
584 }
585
586 static constexpr size_t storageBitsPerPixel = 36;
587 static constexpr size_t allocatedBitsPerPixel = 48;
588 static constexpr bool isPacked = false;
589 static constexpr bool isYUV = false;
590};
591
592template <>
593struct PixelFormatTraits<PixelFormat::RGBa10>
594{
595 using underlying_type = uint16_t;
596
597 static constexpr std::array<Channel, 4> Channels()
598 {
599 return { Channel::Red, Channel::Green, Channel::Blue, Channel::Alpha };
600 }
601
602 static constexpr auto Name()
603 {
604 return "RGBa10";
605 }
606
607 static constexpr size_t storageBitsPerPixel = 40;
608 static constexpr size_t allocatedBitsPerPixel = 64;
609 static constexpr bool isPacked = false;
610 static constexpr bool isYUV = false;
611};
612
613template <>
614struct PixelFormatTraits<PixelFormat::RGBa12>
615{
616 using underlying_type = uint16_t;
617
618 static constexpr std::array<Channel, 4> Channels()
619 {
620 return { Channel::Red, Channel::Green, Channel::Blue, Channel::Alpha };
621 }
622
623 static constexpr auto Name()
624 {
625 return "RGBa12";
626 }
627
628 static constexpr size_t storageBitsPerPixel = 48;
629 static constexpr size_t allocatedBitsPerPixel = 64;
630 static constexpr bool isPacked = false;
631 static constexpr bool isYUV = false;
632};
633
634template <>
635struct PixelFormatTraits<PixelFormat::BGR10>
636{
637 using underlying_type = uint16_t;
638
639 static constexpr std::array<Channel, 3> Channels()
640 {
641 return { Channel::Blue, Channel::Green, Channel::Red };
642 }
643
644 static constexpr auto Name()
645 {
646 return "BGR10";
647 }
648
649 static constexpr size_t storageBitsPerPixel = 30;
650 static constexpr size_t allocatedBitsPerPixel = 48;
651 static constexpr bool isPacked = false;
652 static constexpr bool isYUV = false;
653};
654
655template <>
656struct PixelFormatTraits<PixelFormat::BGR12>
657{
658 using underlying_type = uint16_t;
659
660 static constexpr std::array<Channel, 3> Channels()
661 {
662 return { Channel::Blue, Channel::Green, Channel::Red };
663 }
664
665 static constexpr auto Name()
666 {
667 return "BGR12";
668 }
669
670 static constexpr size_t storageBitsPerPixel = 36;
671 static constexpr size_t allocatedBitsPerPixel = 48;
672 static constexpr bool isPacked = false;
673 static constexpr bool isYUV = false;
674};
675
676template <>
677struct PixelFormatTraits<PixelFormat::BGRa10>
678{
679 using underlying_type = uint16_t;
680
681 static constexpr std::array<Channel, 4> Channels()
682 {
683 return { Channel::Blue, Channel::Green, Channel::Red, Channel::Alpha };
684 }
685
686 static constexpr auto Name()
687 {
688 return "BGRa10";
689 }
690
691 static constexpr size_t storageBitsPerPixel = 40;
692 static constexpr size_t allocatedBitsPerPixel = 64;
693 static constexpr bool isPacked = false;
694 static constexpr bool isYUV = false;
695};
696
697template <>
698struct PixelFormatTraits<PixelFormat::BGRa12>
699{
700 using underlying_type = uint16_t;
701
702 static constexpr std::array<Channel, 4> Channels()
703 {
704 return { Channel::Blue, Channel::Green, Channel::Red, Channel::Alpha };
705 }
706
707 static constexpr auto Name()
708 {
709 return "BGRa12";
710 }
711
712 static constexpr size_t storageBitsPerPixel = 48;
713 static constexpr size_t allocatedBitsPerPixel = 64;
714 static constexpr bool isPacked = false;
715 static constexpr bool isYUV = false;
716};
717
718template <>
719struct PixelFormatTraits<PixelFormat::RGB10p32>
720{
721 using underlying_type = uint32_t;
722
723 static constexpr std::array<Channel, 3> Channels()
724 {
725 return { Channel::Red, Channel::Green, Channel::Blue };
726 }
727
728 static constexpr auto Name()
729 {
730 return "RGB10p32";
731 }
732
733 static constexpr size_t storageBitsPerPixel = 30;
734 static constexpr size_t allocatedBitsPerPixel = 32;
735 static constexpr bool isPacked = true;
736 static constexpr bool isYUV = false;
737};
738
739template <>
740struct PixelFormatTraits<PixelFormat::BGR10p32>
741{
742 using underlying_type = uint32_t;
743
744 static constexpr std::array<Channel, 3> Channels()
745 {
746 return { Channel::Blue, Channel::Green, Channel::Red };
747 }
748
749 static constexpr auto Name()
750 {
751 return "BGR10p32";
752 }
753
754 static constexpr size_t storageBitsPerPixel = 30;
755 static constexpr size_t allocatedBitsPerPixel = 32;
756 static constexpr bool isPacked = true;
757 static constexpr bool isYUV = false;
758};
759
760template <>
761struct PixelFormatTraits<PixelFormat::BayerGR8>
762{
763 using underlying_type = uint8_t;
764
765 static constexpr std::array<Channel, 1> Channels()
766 {
767 return { Channel::Bayer };
768 }
769
770 static constexpr auto Name()
771 {
772 return "BayerGR8";
773 }
774
775 static constexpr size_t storageBitsPerPixel = 8;
776 static constexpr size_t allocatedBitsPerPixel = 8;
777 static constexpr bool isPacked = false;
778 static constexpr bool isYUV = false;
779};
780
781template <>
782struct PixelFormatTraits<PixelFormat::BayerGR10>
783{
784 using underlying_type = uint16_t;
785
786 static constexpr std::array<Channel, 1> Channels()
787 {
788 return { Channel::Bayer };
789 }
790
791 static constexpr auto Name()
792 {
793 return "BayerGR10";
794 }
795
796 static constexpr size_t storageBitsPerPixel = 10;
797 static constexpr size_t allocatedBitsPerPixel = 16;
798 static constexpr bool isPacked = false;
799 static constexpr bool isYUV = false;
800};
801
802template <>
803struct PixelFormatTraits<PixelFormat::BayerGR12>
804{
805 using underlying_type = uint16_t;
806
807 static constexpr std::array<Channel, 1> Channels()
808 {
809 return { Channel::Bayer };
810 }
811
812 static constexpr auto Name()
813 {
814 return "BayerGR12";
815 }
816
817 static constexpr size_t storageBitsPerPixel = 12;
818 static constexpr size_t allocatedBitsPerPixel = 16;
819 static constexpr bool isPacked = false;
820 static constexpr bool isYUV = false;
821};
822
823template <>
824struct PixelFormatTraits<PixelFormat::BayerRG8>
825{
826 using underlying_type = uint8_t;
827
828 static constexpr std::array<Channel, 1> Channels()
829 {
830 return { Channel::Bayer };
831 }
832
833 static constexpr auto Name()
834 {
835 return "BayerRG8";
836 }
837
838 static constexpr size_t storageBitsPerPixel = 8;
839 static constexpr size_t allocatedBitsPerPixel = 8;
840 static constexpr bool isPacked = false;
841 static constexpr bool isYUV = false;
842};
843
844template <>
845struct PixelFormatTraits<PixelFormat::BayerRG10>
846{
847 using underlying_type = uint16_t;
848
849 static constexpr std::array<Channel, 1> Channels()
850 {
851 return { Channel::Bayer };
852 }
853
854 static constexpr auto Name()
855 {
856 return "BayerRG10";
857 }
858
859 static constexpr size_t storageBitsPerPixel = 10;
860 static constexpr size_t allocatedBitsPerPixel = 16;
861 static constexpr bool isPacked = false;
862 static constexpr bool isYUV = false;
863};
864
865template <>
866struct PixelFormatTraits<PixelFormat::BayerRG12>
867{
868 using underlying_type = uint16_t;
869
870 static constexpr std::array<Channel, 1> Channels()
871 {
872 return { Channel::Bayer };
873 }
874
875 static constexpr auto Name()
876 {
877 return "BayerRG12";
878 }
879
880 static constexpr size_t storageBitsPerPixel = 12;
881 static constexpr size_t allocatedBitsPerPixel = 16;
882 static constexpr bool isPacked = false;
883 static constexpr bool isYUV = false;
884};
885
886template <>
887struct PixelFormatTraits<PixelFormat::BayerGB8>
888{
889 using underlying_type = uint8_t;
890
891 static constexpr std::array<Channel, 1> Channels()
892 {
893 return { Channel::Bayer };
894 }
895
896 static constexpr auto Name()
897 {
898 return "BayerGB8";
899 }
900
901 static constexpr size_t storageBitsPerPixel = 8;
902 static constexpr size_t allocatedBitsPerPixel = 8;
903 static constexpr bool isPacked = false;
904 static constexpr bool isYUV = false;
905};
906
907template <>
908struct PixelFormatTraits<PixelFormat::BayerGB10>
909{
910 using underlying_type = uint16_t;
911
912 static constexpr std::array<Channel, 1> Channels()
913 {
914 return { Channel::Bayer };
915 }
916
917 static constexpr auto Name()
918 {
919 return "BayerGB10";
920 }
921
922 static constexpr size_t storageBitsPerPixel = 10;
923 static constexpr size_t allocatedBitsPerPixel = 16;
924 static constexpr bool isPacked = false;
925 static constexpr bool isYUV = false;
926};
927
928template <>
929struct PixelFormatTraits<PixelFormat::BayerGB12>
930{
931 using underlying_type = uint16_t;
932
933 static constexpr std::array<Channel, 1> Channels()
934 {
935 return { Channel::Bayer };
936 }
937
938 static constexpr auto Name()
939 {
940 return "BayerGB12";
941 }
942
943 static constexpr size_t storageBitsPerPixel = 12;
944 static constexpr size_t allocatedBitsPerPixel = 16;
945 static constexpr bool isPacked = false;
946 static constexpr bool isYUV = false;
947};
948
949template <>
950struct PixelFormatTraits<PixelFormat::BayerBG8>
951{
952 using underlying_type = uint8_t;
953
954 static constexpr std::array<Channel, 1> Channels()
955 {
956 return { Channel::Bayer };
957 }
958
959 static constexpr auto Name()
960 {
961 return "BayerBG8";
962 }
963
964 static constexpr size_t storageBitsPerPixel = 8;
965 static constexpr size_t allocatedBitsPerPixel = 8;
966 static constexpr bool isPacked = false;
967 static constexpr bool isYUV = false;
968};
969
970template <>
971struct PixelFormatTraits<PixelFormat::BayerBG10>
972{
973 using underlying_type = uint16_t;
974
975 static constexpr std::array<Channel, 1> Channels()
976 {
977 return { Channel::Bayer };
978 }
979
980 static constexpr auto Name()
981 {
982 return "BayerBG10";
983 }
984
985 static constexpr size_t storageBitsPerPixel = 10;
986 static constexpr size_t allocatedBitsPerPixel = 16;
987 static constexpr bool isPacked = false;
988 static constexpr bool isYUV = false;
989};
990
991template <>
992struct PixelFormatTraits<PixelFormat::BayerBG12>
993{
994 using underlying_type = uint16_t;
995
996 static constexpr std::array<Channel, 1> Channels()
997 {
998 return { Channel::Bayer };
999 }
1000
1001 static constexpr auto Name()
1002 {
1003 return "BayerBG12";
1004 }
1005
1006 static constexpr size_t storageBitsPerPixel = 12;
1007 static constexpr size_t allocatedBitsPerPixel = 16;
1008 static constexpr bool isPacked = false;
1009 static constexpr bool isYUV = false;
1010};
1011
1012template <>
1013struct PixelFormatTraits<PixelFormat::BayerGR10p>
1014{
1015 using underlying_type = uint16_t;
1016
1017 static constexpr std::array<Channel, 1> Channels()
1018 {
1019 return { Channel::Bayer };
1020 }
1021
1022 static constexpr auto Name()
1023 {
1024 return "BayerGR10p";
1025 }
1026
1027 static constexpr size_t storageBitsPerPixel = 10;
1028 static constexpr size_t allocatedBitsPerPixel = 10;
1029 static constexpr bool isPacked = true;
1030 static constexpr bool isYUV = false;
1031};
1032
1033template <>
1034struct PixelFormatTraits<PixelFormat::BayerGR12p>
1035{
1036 using underlying_type = uint16_t;
1037
1038 static constexpr std::array<Channel, 1> Channels()
1039 {
1040 return { Channel::Bayer };
1041 }
1042
1043 static constexpr auto Name()
1044 {
1045 return "BayerGR12p";
1046 }
1047
1048 static constexpr size_t storageBitsPerPixel = 12;
1049 static constexpr size_t allocatedBitsPerPixel = 12;
1050 static constexpr bool isPacked = true;
1051 static constexpr bool isYUV = false;
1052};
1053
1054template <>
1055struct PixelFormatTraits<PixelFormat::BayerRG10p>
1056{
1057 using underlying_type = uint16_t;
1058
1059 static constexpr std::array<Channel, 1> Channels()
1060 {
1061 return { Channel::Bayer };
1062 }
1063
1064 static constexpr auto Name()
1065 {
1066 return "BayerRG10p";
1067 }
1068
1069 static constexpr size_t storageBitsPerPixel = 10;
1070 static constexpr size_t allocatedBitsPerPixel = 10;
1071 static constexpr bool isPacked = true;
1072 static constexpr bool isYUV = false;
1073};
1074
1075template <>
1076struct PixelFormatTraits<PixelFormat::BayerRG12p>
1077{
1078 using underlying_type = uint16_t;
1079
1080 static constexpr std::array<Channel, 1> Channels()
1081 {
1082 return { Channel::Bayer };
1083 }
1084
1085 static constexpr auto Name()
1086 {
1087 return "BayerRG12p";
1088 }
1089
1090 static constexpr size_t storageBitsPerPixel = 12;
1091 static constexpr size_t allocatedBitsPerPixel = 12;
1092 static constexpr bool isPacked = true;
1093 static constexpr bool isYUV = false;
1094};
1095
1096template <>
1097struct PixelFormatTraits<PixelFormat::BayerGB10p>
1098{
1099 using underlying_type = uint16_t;
1100
1101 static constexpr std::array<Channel, 1> Channels()
1102 {
1103 return { Channel::Bayer };
1104 }
1105
1106 static constexpr auto Name()
1107 {
1108 return "BayerGB10p";
1109 }
1110
1111 static constexpr size_t storageBitsPerPixel = 10;
1112 static constexpr size_t allocatedBitsPerPixel = 10;
1113 static constexpr bool isPacked = true;
1114 static constexpr bool isYUV = false;
1115};
1116
1117template <>
1118struct PixelFormatTraits<PixelFormat::BayerGB12p>
1119{
1120 using underlying_type = uint16_t;
1121
1122 static constexpr std::array<Channel, 1> Channels()
1123 {
1124 return { Channel::Bayer };
1125 }
1126
1127 static constexpr auto Name()
1128 {
1129 return "BayerGB12p";
1130 }
1131
1132 static constexpr size_t storageBitsPerPixel = 12;
1133 static constexpr size_t allocatedBitsPerPixel = 12;
1134 static constexpr bool isPacked = true;
1135 static constexpr bool isYUV = false;
1136};
1137
1138template <>
1139struct PixelFormatTraits<PixelFormat::BayerBG10p>
1140{
1141 using underlying_type = uint16_t;
1142
1143 static constexpr std::array<Channel, 1> Channels()
1144 {
1145 return { Channel::Bayer };
1146 }
1147
1148 static constexpr auto Name()
1149 {
1150 return "BayerBG10p";
1151 }
1152
1153 static constexpr size_t storageBitsPerPixel = 10;
1154 static constexpr size_t allocatedBitsPerPixel = 10;
1155 static constexpr bool isPacked = true;
1156 static constexpr bool isYUV = false;
1157};
1158
1159template <>
1160struct PixelFormatTraits<PixelFormat::BayerBG12p>
1161{
1162 using underlying_type = uint16_t;
1163
1164 static constexpr std::array<Channel, 1> Channels()
1165 {
1166 return { Channel::Bayer };
1167 }
1168
1169 static constexpr auto Name()
1170 {
1171 return "BayerBG12p";
1172 }
1173
1174 static constexpr size_t storageBitsPerPixel = 12;
1175 static constexpr size_t allocatedBitsPerPixel = 12;
1176 static constexpr bool isPacked = true;
1177 static constexpr bool isYUV = false;
1178};
1179
1180template <>
1181struct PixelFormatTraits<PixelFormat::Confidence8>
1182{
1183 using underlying_type = uint8_t;
1184
1185 static constexpr std::array<Channel, 1> Channels()
1186 {
1187 return { Channel::Intensity };
1188 }
1189
1190 static constexpr auto Name()
1191 {
1192 return "Confidence8";
1193 }
1194
1195 static constexpr size_t storageBitsPerPixel = 8;
1196 static constexpr size_t allocatedBitsPerPixel = 8;
1197 static constexpr bool isPacked = false;
1198 static constexpr bool isYUV = false;
1199};
1200
1201template <>
1202struct PixelFormatTraits<PixelFormat::Confidence16>
1203{
1204 using underlying_type = uint16_t;
1205
1206 static constexpr std::array<Channel, 1> Channels()
1207 {
1208 return { Channel::Intensity };
1209 }
1210
1211 static constexpr auto Name()
1212 {
1213 return "Confidence16";
1214 }
1215
1216 static constexpr size_t storageBitsPerPixel = 16;
1217 static constexpr size_t allocatedBitsPerPixel = 16;
1218 static constexpr bool isPacked = false;
1219 static constexpr bool isYUV = false;
1220};
1221
1222template <>
1223struct PixelFormatTraits<PixelFormat::Coord3D_C8>
1224{
1225 using underlying_type = uint8_t;
1226
1227 static constexpr std::array<Channel, 1> Channels()
1228 {
1229 return { Channel::Intensity };
1230 }
1231
1232 static constexpr auto Name()
1233 {
1234 return "Coord3D_C8";
1235 }
1236
1237 static constexpr size_t storageBitsPerPixel = 8;
1238 static constexpr size_t allocatedBitsPerPixel = 8;
1239 static constexpr bool isPacked = false;
1240 static constexpr bool isYUV = false;
1241};
1242
1243template <>
1244struct PixelFormatTraits<PixelFormat::Coord3D_C16>
1245{
1246 using underlying_type = uint16_t;
1247
1248 static constexpr std::array<Channel, 1> Channels()
1249 {
1250 return { Channel::Intensity };
1251 }
1252
1253 static constexpr auto Name()
1254 {
1255 return "Coord3D_C16";
1256 }
1257
1258 static constexpr size_t storageBitsPerPixel = 16;
1259 static constexpr size_t allocatedBitsPerPixel = 16;
1260 static constexpr bool isPacked = false;
1261 static constexpr bool isYUV = false;
1262};
1263
1264template <>
1265struct PixelFormatTraits<PixelFormat::BayerBG10g40IDS>
1266{
1267 using underlying_type = uint16_t;
1268
1269 static constexpr std::array<Channel, 1> Channels()
1270 {
1271 return { Channel::Bayer };
1272 }
1273
1274 static constexpr auto Name()
1275 {
1276 return "BayerBG10g40IDS";
1277 }
1278
1279 static constexpr size_t storageBitsPerPixel = 10;
1280 static constexpr size_t allocatedBitsPerPixel = 10;
1281 static constexpr bool isPacked = true;
1282 static constexpr bool isYUV = false;
1283};
1284
1285template <>
1286struct PixelFormatTraits<PixelFormat::BayerBG12g24IDS>
1287{
1288 using underlying_type = uint16_t;
1289
1290 static constexpr std::array<Channel, 1> Channels()
1291 {
1292 return { Channel::Bayer };
1293 }
1294
1295 static constexpr auto Name()
1296 {
1297 return "BayerBG12g24IDS";
1298 }
1299
1300 static constexpr size_t storageBitsPerPixel = 12;
1301 static constexpr size_t allocatedBitsPerPixel = 12;
1302 static constexpr bool isPacked = true;
1303 static constexpr bool isYUV = false;
1304};
1305
1306template <>
1307struct PixelFormatTraits<PixelFormat::BayerGB10g40IDS>
1308{
1309 using underlying_type = uint16_t;
1310
1311 static constexpr std::array<Channel, 1> Channels()
1312 {
1313 return { Channel::Bayer };
1314 }
1315
1316 static constexpr auto Name()
1317 {
1318 return "BayerGB10g40IDS";
1319 }
1320
1321 static constexpr size_t storageBitsPerPixel = 10;
1322 static constexpr size_t allocatedBitsPerPixel = 10;
1323 static constexpr bool isPacked = true;
1324 static constexpr bool isYUV = false;
1325};
1326
1327template <>
1328struct PixelFormatTraits<PixelFormat::BayerGB12g24IDS>
1329{
1330 using underlying_type = uint16_t;
1331
1332 static constexpr std::array<Channel, 1> Channels()
1333 {
1334 return { Channel::Bayer };
1335 }
1336
1337 static constexpr auto Name()
1338 {
1339 return "BayerGB12g24IDS";
1340 }
1341
1342 static constexpr size_t storageBitsPerPixel = 12;
1343 static constexpr size_t allocatedBitsPerPixel = 12;
1344 static constexpr bool isPacked = true;
1345 static constexpr bool isYUV = false;
1346};
1347
1348template <>
1349struct PixelFormatTraits<PixelFormat::BayerGR10g40IDS>
1350{
1351 using underlying_type = uint16_t;
1352
1353 static constexpr std::array<Channel, 1> Channels()
1354 {
1355 return { Channel::Bayer };
1356 }
1357
1358 static constexpr auto Name()
1359 {
1360 return "BayerGR10g40IDS";
1361 }
1362
1363 static constexpr size_t storageBitsPerPixel = 10;
1364 static constexpr size_t allocatedBitsPerPixel = 10;
1365 static constexpr bool isPacked = true;
1366 static constexpr bool isYUV = false;
1367};
1368
1369template <>
1370struct PixelFormatTraits<PixelFormat::BayerGR12g24IDS>
1371{
1372 using underlying_type = uint16_t;
1373
1374 static constexpr std::array<Channel, 1> Channels()
1375 {
1376 return { Channel::Bayer };
1377 }
1378
1379 static constexpr auto Name()
1380 {
1381 return "BayerGR12g24IDS";
1382 }
1383
1384 static constexpr size_t storageBitsPerPixel = 12;
1385 static constexpr size_t allocatedBitsPerPixel = 12;
1386 static constexpr bool isPacked = true;
1387 static constexpr bool isYUV = false;
1388};
1389
1390template <>
1391struct PixelFormatTraits<PixelFormat::BayerRG10g40IDS>
1392{
1393 using underlying_type = uint16_t;
1394
1395 static constexpr std::array<Channel, 1> Channels()
1396 {
1397 return { Channel::Bayer };
1398 }
1399
1400 static constexpr auto Name()
1401 {
1402 return "BayerRG10g40IDS";
1403 }
1404
1405 static constexpr size_t storageBitsPerPixel = 10;
1406 static constexpr size_t allocatedBitsPerPixel = 10;
1407 static constexpr bool isPacked = true;
1408 static constexpr bool isYUV = false;
1409};
1410
1411template <>
1412struct PixelFormatTraits<PixelFormat::BayerRG12g24IDS>
1413{
1414 using underlying_type = uint16_t;
1415
1416 static constexpr std::array<Channel, 1> Channels()
1417 {
1418 return { Channel::Bayer };
1419 }
1420
1421 static constexpr auto Name()
1422 {
1423 return "BayerRG12g24IDS";
1424 }
1425
1426 static constexpr size_t storageBitsPerPixel = 12;
1427 static constexpr size_t allocatedBitsPerPixel = 12;
1428 static constexpr bool isPacked = true;
1429 static constexpr bool isYUV = false;
1430};
1431
1432template <>
1434{
1435 using underlying_type = uint8_t;
1436
1437 static constexpr std::array<Channel, 3> Channels()
1438 {
1439 return { Channel::Intensity, Channel::Intensity, Channel::Intensity };
1440 }
1441
1442 static constexpr auto Name()
1443 {
1444 return "YUV420_8_YY_UV_SemiplanarIDS";
1445 }
1446
1447 static constexpr size_t storageBitsPerPixel = 8;
1448 static constexpr size_t allocatedBitsPerPixel = 12;
1449 static constexpr bool isPacked = false;
1450 static constexpr bool isYUV = true;
1451};
1452
1453template <>
1455{
1456 using underlying_type = uint8_t;
1457
1458 static constexpr std::array<Channel, 3> Channels()
1459 {
1460 return { Channel::Intensity, Channel::Intensity, Channel::Intensity };
1461 }
1462
1463 static constexpr auto Name()
1464 {
1465 return "YUV420_8_YY_VU_SemiplanarIDS";
1466 }
1467
1468 static constexpr size_t storageBitsPerPixel = 8;
1469 static constexpr size_t allocatedBitsPerPixel = 12;
1470 static constexpr bool isPacked = false;
1471 static constexpr bool isYUV = true;
1472};
1473
1474template <>
1475struct PixelFormatTraits<PixelFormat::YUV422_8_UYVY>
1476{
1477 using underlying_type = uint8_t;
1478
1479 static constexpr std::array<Channel, 3> Channels()
1480 {
1481 return { Channel::Intensity, Channel::Intensity, Channel::Intensity };
1482 }
1483
1484 static constexpr auto Name()
1485 {
1486 return "YUV422_8_UYVY";
1487 }
1488
1489 static constexpr size_t storageBitsPerPixel = 8;
1490 static constexpr size_t allocatedBitsPerPixel = 16;
1491 static constexpr bool isPacked = false;
1492 static constexpr bool isYUV = true;
1493};
1494
1495template <>
1496struct PixelFormatTraits<PixelFormat::Mono10g40IDS>
1497{
1498 using underlying_type = uint16_t;
1499
1500 static constexpr std::array<Channel, 1> Channels()
1501 {
1502 return { Channel::Intensity };
1503 }
1504
1505 static constexpr auto Name()
1506 {
1507 return "Mono10g40IDS";
1508 }
1509
1510 static constexpr size_t storageBitsPerPixel = 10;
1511 static constexpr size_t allocatedBitsPerPixel = 10;
1512 static constexpr bool isPacked = true;
1513 static constexpr bool isYUV = false;
1514};
1515
1516template <>
1517struct PixelFormatTraits<PixelFormat::Mono12g24IDS>
1518{
1519 using underlying_type = uint16_t;
1520
1521 static constexpr std::array<Channel, 1> Channels()
1522 {
1523 return { Channel::Intensity };
1524 }
1525
1526 static constexpr auto Name()
1527 {
1528 return "Mono12g24IDS";
1529 }
1530
1531 static constexpr size_t storageBitsPerPixel = 12;
1532 static constexpr size_t allocatedBitsPerPixel = 12;
1533 static constexpr bool isPacked = true;
1534 static constexpr bool isYUV = false;
1535};
1536
1538template <typename T, bool isFloat>
1539struct ValueRangeHelper;
1540
1541template <typename T>
1542struct ValueRangeHelper<T, false> // Integer
1543{
1544 static constexpr T Minimum(size_t)
1545 {
1546 return 0;
1547 }
1548
1549 static constexpr T Maximum(size_t bitsPerChannel)
1550 {
1551 return static_cast<T>((1ULL << bitsPerChannel) - 1);
1552 }
1553};
1554
1555template <typename T>
1556struct ValueRangeHelper<T, true> // Float
1557{
1558 static constexpr T Minimum(size_t)
1559 {
1560 return std::numeric_limits<T>::lowest();
1561 }
1562
1563 static constexpr T Maximum(size_t)
1564 {
1565 return (std::numeric_limits<T>::max)();
1566 }
1567};
1568
1569template <PixelFormat pixelFormat>
1570struct PixelFormatInfo
1571{
1572 using traits = PixelFormatTraits<pixelFormat>;
1573 using underlying_type = typename traits::underlying_type;
1574 static constexpr bool is_floating_point = std::is_floating_point<underlying_type>::value;
1575
1576 static constexpr size_t storageBitsPerPixel = traits::storageBitsPerPixel;
1577 static constexpr size_t allocatedBitsPerPixel = traits::allocatedBitsPerPixel;
1578
1579 static constexpr size_t storageBitsPerChannel = storageBitsPerPixel / traits::Channels().size();
1580
1581 static constexpr underlying_type minimumValuePerChannel = ValueRangeHelper<underlying_type, is_floating_point>::Minimum(
1582 storageBitsPerChannel);
1583
1584 static constexpr underlying_type maximumValuePerChannel = ValueRangeHelper<underlying_type, is_floating_point>::Maximum(
1585 storageBitsPerChannel);
1586
1587 static constexpr auto Channels()
1588 {
1589 return traits::Channels();
1590 }
1591
1592 static constexpr const char* Name()
1593 {
1594 return traits::Name();
1595 }
1596
1597 static constexpr size_t GetSizeInBytes(const Size& size)
1598 {
1599 const auto area = static_cast<uint64_t>(size.GetWidth()) * size.GetHeight();
1600 return static_cast<size_t>(((area * PixelFormatInfo<pixelFormat>::allocatedBitsPerPixel) + 7) / 8);
1601 }
1602};
1603
1604template <typename PixelFormatInfo>
1605inline auto ChannelsVector()
1606{
1607 constexpr auto arr = PixelFormatInfo::Channels();
1608 using T = typename std::decay_t<typename decltype(arr)::value_type>;
1609 return std::vector<T>(arr.begin(), arr.end());
1610}
1611
1613
1614} // namespace detail
1615
1617 : m_pixelFormat{ pixelFormat }
1618{}
1619
1620inline PixelFormatInfo::PixelFormatInfo(const std::string& name)
1621{
1622 static const std::unordered_map<std::string, PixelFormat> map = {
1623 { detail::PixelFormatInfo<PixelFormat::BayerGR8>::Name(), PixelFormat::BayerGR8 },
1624 { detail::PixelFormatInfo<PixelFormat::BayerGR10>::Name(), PixelFormat::BayerGR10 },
1625 { detail::PixelFormatInfo<PixelFormat::BayerGR12>::Name(), PixelFormat::BayerGR12 },
1626 { detail::PixelFormatInfo<PixelFormat::BayerRG8>::Name(), PixelFormat::BayerRG8 },
1627 { detail::PixelFormatInfo<PixelFormat::BayerRG10>::Name(), PixelFormat::BayerRG10 },
1628 { detail::PixelFormatInfo<PixelFormat::BayerRG12>::Name(), PixelFormat::BayerRG12 },
1629 { detail::PixelFormatInfo<PixelFormat::BayerGB8>::Name(), PixelFormat::BayerGB8 },
1630 { detail::PixelFormatInfo<PixelFormat::BayerGB10>::Name(), PixelFormat::BayerGB10 },
1631 { detail::PixelFormatInfo<PixelFormat::BayerGB12>::Name(), PixelFormat::BayerGB12 },
1632 { detail::PixelFormatInfo<PixelFormat::BayerBG8>::Name(), PixelFormat::BayerBG8 },
1633 { detail::PixelFormatInfo<PixelFormat::BayerBG10>::Name(), PixelFormat::BayerBG10 },
1634 { detail::PixelFormatInfo<PixelFormat::BayerBG12>::Name(), PixelFormat::BayerBG12 },
1635 { detail::PixelFormatInfo<PixelFormat::Mono8>::Name(), PixelFormat::Mono8 },
1636 { detail::PixelFormatInfo<PixelFormat::Mono10>::Name(), PixelFormat::Mono10 },
1637 { detail::PixelFormatInfo<PixelFormat::Mono12>::Name(), PixelFormat::Mono12 },
1638 { detail::PixelFormatInfo<PixelFormat::Mono16>::Name(), PixelFormat::Mono16 },
1639 { detail::PixelFormatInfo<PixelFormat::Confidence8>::Name(), PixelFormat::Confidence8 },
1640 { detail::PixelFormatInfo<PixelFormat::Confidence16>::Name(), PixelFormat::Confidence16 },
1641 { detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::Name(), PixelFormat::Coord3D_C8 },
1642 { detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::Name(), PixelFormat::Coord3D_C16 },
1643 { detail::PixelFormatInfo<PixelFormat::Coord3D_C32f>::Name(), PixelFormat::Coord3D_C32f },
1644 { detail::PixelFormatInfo<PixelFormat::Coord3D_ABC32f>::Name(), PixelFormat::Coord3D_ABC32f },
1645 { detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::Name(), PixelFormat::YUV420_8_YY_UV_SemiplanarIDS },
1646 { detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::Name(), PixelFormat::YUV420_8_YY_VU_SemiplanarIDS },
1647 { detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::Name(), PixelFormat::YUV422_8_UYVY },
1648 { detail::PixelFormatInfo<PixelFormat::RGB8>::Name(), PixelFormat::RGB8 },
1649 { detail::PixelFormatInfo<PixelFormat::RGB10>::Name(), PixelFormat::RGB10 },
1650 { detail::PixelFormatInfo<PixelFormat::RGB12>::Name(), PixelFormat::RGB12 },
1651 { detail::PixelFormatInfo<PixelFormat::BGR8>::Name(), PixelFormat::BGR8 },
1652 { detail::PixelFormatInfo<PixelFormat::BGR10>::Name(), PixelFormat::BGR10 },
1653 { detail::PixelFormatInfo<PixelFormat::BGR12>::Name(), PixelFormat::BGR12 },
1654 { detail::PixelFormatInfo<PixelFormat::RGBa8>::Name(), PixelFormat::RGBa8 },
1655 { detail::PixelFormatInfo<PixelFormat::RGBa10>::Name(), PixelFormat::RGBa10 },
1656 { detail::PixelFormatInfo<PixelFormat::RGBa12>::Name(), PixelFormat::RGBa12 },
1657 { detail::PixelFormatInfo<PixelFormat::BGRa8>::Name(), PixelFormat::BGRa8 },
1658 { detail::PixelFormatInfo<PixelFormat::BGRa10>::Name(), PixelFormat::BGRa10 },
1659 { detail::PixelFormatInfo<PixelFormat::BGRa12>::Name(), PixelFormat::BGRa12 },
1660 { detail::PixelFormatInfo<PixelFormat::BayerBG10p>::Name(), PixelFormat::BayerBG10p },
1661 { detail::PixelFormatInfo<PixelFormat::BayerBG12p>::Name(), PixelFormat::BayerBG12p },
1662 { detail::PixelFormatInfo<PixelFormat::BayerGB10p>::Name(), PixelFormat::BayerGB10p },
1663 { detail::PixelFormatInfo<PixelFormat::BayerGB12p>::Name(), PixelFormat::BayerGB12p },
1664 { detail::PixelFormatInfo<PixelFormat::BayerGR10p>::Name(), PixelFormat::BayerGR10p },
1665 { detail::PixelFormatInfo<PixelFormat::BayerGR12p>::Name(), PixelFormat::BayerGR12p },
1666 { detail::PixelFormatInfo<PixelFormat::BayerRG10p>::Name(), PixelFormat::BayerRG10p },
1667 { detail::PixelFormatInfo<PixelFormat::BayerRG12p>::Name(), PixelFormat::BayerRG12p },
1668 { detail::PixelFormatInfo<PixelFormat::Mono10p>::Name(), PixelFormat::Mono10p },
1669 { detail::PixelFormatInfo<PixelFormat::Mono12p>::Name(), PixelFormat::Mono12p },
1670 { detail::PixelFormatInfo<PixelFormat::RGB10p32>::Name(), PixelFormat::RGB10p32 },
1671 { detail::PixelFormatInfo<PixelFormat::BGR10p32>::Name(), PixelFormat::BGR10p32 },
1672 { detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::Name(), PixelFormat::BayerRG10g40IDS },
1673 { detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::Name(), PixelFormat::BayerGB10g40IDS },
1674 { detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::Name(), PixelFormat::BayerGR10g40IDS },
1675 { detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::Name(), PixelFormat::BayerBG10g40IDS },
1676 { detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::Name(), PixelFormat::BayerRG12g24IDS },
1677 { detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::Name(), PixelFormat::BayerGB12g24IDS },
1678 { detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::Name(), PixelFormat::BayerGR12g24IDS },
1679 { detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::Name(), PixelFormat::BayerBG12g24IDS },
1680 { detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::Name(), PixelFormat::Mono10g40IDS },
1681 { detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::Name(), PixelFormat::Mono12g24IDS }
1682 };
1683
1684 const auto iter = map.find(name);
1685 if (iter == map.end())
1686 {
1687 throw InvalidParameterException("The given pixel format " + name + " is unkown!");
1688 }
1689 m_pixelFormat = iter->second;
1690}
1691
1705template <>
1707{
1708 switch (m_pixelFormat)
1709 {
1711 return detail::PixelFormatInfo<peak::common::PixelFormat::Coord3D_ABC32f>::maximumValuePerChannel;
1713 return detail::PixelFormatInfo<peak::common::PixelFormat::Coord3D_C32f>::maximumValuePerChannel;
1714 default:
1716 "The template does not match the data type of pixel format " + GetName() + "! Use size_t as template argument.");
1717 }
1718}
1719
1732template <>
1734{
1735 switch (m_pixelFormat)
1736 {
1737 case PixelFormat::Mono8:
1738 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono8>::maximumValuePerChannel;
1740 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>::maximumValuePerChannel;
1742 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>::maximumValuePerChannel;
1744 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>::maximumValuePerChannel;
1746 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>::maximumValuePerChannel;
1748 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>::maximumValuePerChannel;
1749 case PixelFormat::RGB8:
1750 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>::maximumValuePerChannel;
1751 case PixelFormat::RGB10:
1752 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>::maximumValuePerChannel;
1753 case PixelFormat::RGB12:
1754 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>::maximumValuePerChannel;
1755 case PixelFormat::RGBa8:
1756 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>::maximumValuePerChannel;
1758 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>::maximumValuePerChannel;
1760 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>::maximumValuePerChannel;
1761 case PixelFormat::BGR8:
1762 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>::maximumValuePerChannel;
1763 case PixelFormat::BGR10:
1764 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>::maximumValuePerChannel;
1765 case PixelFormat::BGR12:
1766 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>::maximumValuePerChannel;
1767 case PixelFormat::BGRa8:
1768 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>::maximumValuePerChannel;
1770 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>::maximumValuePerChannel;
1772 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>::maximumValuePerChannel;
1774 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>::maximumValuePerChannel;
1776 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>::maximumValuePerChannel;
1778 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>::maximumValuePerChannel;
1780 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>::maximumValuePerChannel;
1782 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>::maximumValuePerChannel;
1784 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>::maximumValuePerChannel;
1786 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>::maximumValuePerChannel;
1788 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>::maximumValuePerChannel;
1790 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>::maximumValuePerChannel;
1792 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>::maximumValuePerChannel;
1794 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>::maximumValuePerChannel;
1796 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>::maximumValuePerChannel;
1798 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>::maximumValuePerChannel;
1800 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>::maximumValuePerChannel;
1802 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>::maximumValuePerChannel;
1804 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>::maximumValuePerChannel;
1806 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>::maximumValuePerChannel;
1808 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>::maximumValuePerChannel;
1810 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>::maximumValuePerChannel;
1812 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>::maximumValuePerChannel;
1814 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>::maximumValuePerChannel;
1816 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>::maximumValuePerChannel;
1818 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>::maximumValuePerChannel;
1820 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>::maximumValuePerChannel;
1822 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::maximumValuePerChannel;
1824 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::maximumValuePerChannel;
1826 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::maximumValuePerChannel;
1828 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::maximumValuePerChannel;
1830 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::maximumValuePerChannel;
1832 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::maximumValuePerChannel;
1834 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::maximumValuePerChannel;
1836 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::maximumValuePerChannel;
1838 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::maximumValuePerChannel;
1840 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::maximumValuePerChannel;
1842 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::maximumValuePerChannel;
1844 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::maximumValuePerChannel;
1846 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::maximumValuePerChannel;
1848 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::maximumValuePerChannel;
1850 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::maximumValuePerChannel;
1851 default:
1853 "The template does not match the data type of pixel format " + GetName() + "! Use float as template argument.");
1854 }
1855}
1856
1857/* @cond HIDE_FROM_DOXYGEN */
1863template <typename T>
1865{
1866 static_assert(true, "The given template type is not supported! Only size_t and float can be used.");
1867}
1868
1869/* @endcond */
1870
1884template <>
1886{
1887 switch (m_pixelFormat)
1888 {
1890 return detail::PixelFormatInfo<peak::common::PixelFormat::Coord3D_ABC32f>::minimumValuePerChannel;
1892 return detail::PixelFormatInfo<peak::common::PixelFormat::Coord3D_C32f>::minimumValuePerChannel;
1893 default:
1895 "The template does not match the data type of pixel format " + GetName() + "! Use size_t as template argument.");
1896 }
1897}
1898
1911template <>
1913{
1914 switch (m_pixelFormat)
1915 {
1916 case PixelFormat::Mono8:
1917 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono8>::minimumValuePerChannel;
1919 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>::minimumValuePerChannel;
1921 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>::minimumValuePerChannel;
1923 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>::minimumValuePerChannel;
1925 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>::minimumValuePerChannel;
1927 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>::minimumValuePerChannel;
1928 case PixelFormat::RGB8:
1929 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>::minimumValuePerChannel;
1930 case PixelFormat::RGB10:
1931 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>::minimumValuePerChannel;
1932 case PixelFormat::RGB12:
1933 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>::minimumValuePerChannel;
1934 case PixelFormat::RGBa8:
1935 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>::minimumValuePerChannel;
1937 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>::minimumValuePerChannel;
1939 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>::minimumValuePerChannel;
1940 case PixelFormat::BGR8:
1941 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>::minimumValuePerChannel;
1942 case PixelFormat::BGR10:
1943 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>::minimumValuePerChannel;
1944 case PixelFormat::BGR12:
1945 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>::minimumValuePerChannel;
1946 case PixelFormat::BGRa8:
1947 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>::minimumValuePerChannel;
1949 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>::minimumValuePerChannel;
1951 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>::minimumValuePerChannel;
1953 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>::minimumValuePerChannel;
1955 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>::minimumValuePerChannel;
1957 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>::minimumValuePerChannel;
1959 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>::minimumValuePerChannel;
1961 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>::minimumValuePerChannel;
1963 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>::minimumValuePerChannel;
1965 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>::minimumValuePerChannel;
1967 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>::minimumValuePerChannel;
1969 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>::minimumValuePerChannel;
1971 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>::minimumValuePerChannel;
1973 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>::minimumValuePerChannel;
1975 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>::minimumValuePerChannel;
1977 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>::minimumValuePerChannel;
1979 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>::minimumValuePerChannel;
1981 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>::minimumValuePerChannel;
1983 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>::minimumValuePerChannel;
1985 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>::minimumValuePerChannel;
1987 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>::minimumValuePerChannel;
1989 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>::minimumValuePerChannel;
1991 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>::minimumValuePerChannel;
1993 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>::minimumValuePerChannel;
1995 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>::minimumValuePerChannel;
1997 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>::minimumValuePerChannel;
1999 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>::minimumValuePerChannel;
2001 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::minimumValuePerChannel;
2003 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::minimumValuePerChannel;
2005 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::minimumValuePerChannel;
2007 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::minimumValuePerChannel;
2009 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::minimumValuePerChannel;
2011 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::minimumValuePerChannel;
2013 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::minimumValuePerChannel;
2015 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::minimumValuePerChannel;
2017 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::minimumValuePerChannel;
2019 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::minimumValuePerChannel;
2021 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::minimumValuePerChannel;
2023 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::minimumValuePerChannel;
2025 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::minimumValuePerChannel;
2027 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::minimumValuePerChannel;
2029 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::minimumValuePerChannel;
2030 default:
2032 "The template does not match the data type of pixel format " + GetName() + "! Use float as template argument.");
2033 }
2034}
2035
2036/* @cond HIDE_FROM_DOXYGEN */
2042template <typename T>
2044{
2045 static_assert(true, "The given template type is not supported! Only size_t and float can be used.");
2046}
2047
2048/* @endcond */
2049
2051{
2052 switch (m_pixelFormat)
2053 {
2054 case PixelFormat::Mono8:
2055 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono8>::storageBitsPerPixel;
2057 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>::storageBitsPerPixel;
2059 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>::storageBitsPerPixel;
2061 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>::storageBitsPerPixel;
2063 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>::storageBitsPerPixel;
2065 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>::storageBitsPerPixel;
2066 case PixelFormat::RGB8:
2067 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>::storageBitsPerPixel;
2068 case PixelFormat::RGB10:
2069 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>::storageBitsPerPixel;
2070 case PixelFormat::RGB12:
2071 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>::storageBitsPerPixel;
2072 case PixelFormat::RGBa8:
2073 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>::storageBitsPerPixel;
2075 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>::storageBitsPerPixel;
2077 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>::storageBitsPerPixel;
2078 case PixelFormat::BGR8:
2079 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>::storageBitsPerPixel;
2080 case PixelFormat::BGR10:
2081 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>::storageBitsPerPixel;
2082 case PixelFormat::BGR12:
2083 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>::storageBitsPerPixel;
2084 case PixelFormat::BGRa8:
2085 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>::storageBitsPerPixel;
2087 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>::storageBitsPerPixel;
2089 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>::storageBitsPerPixel;
2091 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>::storageBitsPerPixel;
2093 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>::storageBitsPerPixel;
2095 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>::storageBitsPerPixel;
2097 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>::storageBitsPerPixel;
2099 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>::storageBitsPerPixel;
2101 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>::storageBitsPerPixel;
2103 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>::storageBitsPerPixel;
2105 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>::storageBitsPerPixel;
2107 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>::storageBitsPerPixel;
2109 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>::storageBitsPerPixel;
2111 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>::storageBitsPerPixel;
2113 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>::storageBitsPerPixel;
2115 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>::storageBitsPerPixel;
2117 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>::storageBitsPerPixel;
2119 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>::storageBitsPerPixel;
2121 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>::storageBitsPerPixel;
2123 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>::storageBitsPerPixel;
2125 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>::storageBitsPerPixel;
2127 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>::storageBitsPerPixel;
2129 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>::storageBitsPerPixel;
2131 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>::storageBitsPerPixel;
2133 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>::storageBitsPerPixel;
2135 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>::storageBitsPerPixel;
2137 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>::storageBitsPerPixel;
2139 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::storageBitsPerPixel;
2141 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::storageBitsPerPixel;
2143 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C32f>::storageBitsPerPixel;
2145 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_ABC32f>::storageBitsPerPixel;
2147 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::storageBitsPerPixel;
2149 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::storageBitsPerPixel;
2151 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::storageBitsPerPixel;
2153 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::storageBitsPerPixel;
2155 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::storageBitsPerPixel;
2157 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::storageBitsPerPixel;
2159 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::storageBitsPerPixel;
2161 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::storageBitsPerPixel;
2163 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::storageBitsPerPixel;
2165 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::storageBitsPerPixel;
2167 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::storageBitsPerPixel;
2169 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::storageBitsPerPixel;
2171 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::storageBitsPerPixel;
2172 default:
2173 const auto pixelFormatValue = static_cast<typename std::underlying_type<decltype(m_pixelFormat)>::type>(m_pixelFormat);
2175 "The given pixel format with the integer value of " + std::to_string(pixelFormatValue) + " is unknown!");
2176 }
2177}
2178
2180{
2181 switch (m_pixelFormat)
2182 {
2183 case PixelFormat::Mono8:
2184 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono8>::storageBitsPerChannel;
2186 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>::storageBitsPerChannel;
2188 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>::storageBitsPerChannel;
2190 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>::storageBitsPerChannel;
2192 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>::storageBitsPerChannel;
2194 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>::storageBitsPerChannel;
2195 case PixelFormat::RGB8:
2196 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>::storageBitsPerChannel;
2197 case PixelFormat::RGB10:
2198 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>::storageBitsPerChannel;
2199 case PixelFormat::RGB12:
2200 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>::storageBitsPerChannel;
2201 case PixelFormat::RGBa8:
2202 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>::storageBitsPerChannel;
2204 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>::storageBitsPerChannel;
2206 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>::storageBitsPerChannel;
2207 case PixelFormat::BGR8:
2208 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>::storageBitsPerChannel;
2209 case PixelFormat::BGR10:
2210 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>::storageBitsPerChannel;
2211 case PixelFormat::BGR12:
2212 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>::storageBitsPerChannel;
2213 case PixelFormat::BGRa8:
2214 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>::storageBitsPerChannel;
2216 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>::storageBitsPerChannel;
2218 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>::storageBitsPerChannel;
2220 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>::storageBitsPerChannel;
2222 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>::storageBitsPerChannel;
2224 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>::storageBitsPerChannel;
2226 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>::storageBitsPerChannel;
2228 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>::storageBitsPerChannel;
2230 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>::storageBitsPerChannel;
2232 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>::storageBitsPerChannel;
2234 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>::storageBitsPerChannel;
2236 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>::storageBitsPerChannel;
2238 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>::storageBitsPerChannel;
2240 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>::storageBitsPerChannel;
2242 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>::storageBitsPerChannel;
2244 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>::storageBitsPerChannel;
2246 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>::storageBitsPerChannel;
2248 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>::storageBitsPerChannel;
2250 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>::storageBitsPerChannel;
2252 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>::storageBitsPerChannel;
2254 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>::storageBitsPerChannel;
2256 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>::storageBitsPerChannel;
2258 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>::storageBitsPerChannel;
2260 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>::storageBitsPerChannel;
2262 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>::storageBitsPerChannel;
2264 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>::storageBitsPerChannel;
2266 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>::storageBitsPerChannel;
2268 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::storageBitsPerChannel;
2270 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::storageBitsPerChannel;
2272 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C32f>::storageBitsPerChannel;
2274 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_ABC32f>::storageBitsPerChannel;
2276 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::storageBitsPerChannel;
2278 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::storageBitsPerChannel;
2280 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::storageBitsPerChannel;
2282 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::storageBitsPerChannel;
2284 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::storageBitsPerChannel;
2286 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::storageBitsPerChannel;
2288 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::storageBitsPerChannel;
2290 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::storageBitsPerChannel;
2292 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::storageBitsPerChannel;
2294 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::storageBitsPerChannel;
2296 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::storageBitsPerChannel;
2298 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::storageBitsPerChannel;
2300 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::storageBitsPerChannel;
2301 default:
2302 const auto pixelFormatValue = static_cast<typename std::underlying_type<decltype(m_pixelFormat)>::type>(m_pixelFormat);
2304 "The given pixel format with the integer value of " + std::to_string(pixelFormatValue) + " is unknown!");
2305 }
2306}
2307
2308inline std::string PixelFormatInfo::GetName() const
2309{
2310 switch (m_pixelFormat)
2311 {
2312 case PixelFormat::Mono8:
2313 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono8>::Name();
2315 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>::Name();
2317 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>::Name();
2319 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>::Name();
2321 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>::Name();
2323 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>::Name();
2324 case PixelFormat::RGB8:
2325 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>::Name();
2326 case PixelFormat::RGB10:
2327 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>::Name();
2328 case PixelFormat::RGB12:
2329 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>::Name();
2330 case PixelFormat::RGBa8:
2331 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>::Name();
2333 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>::Name();
2335 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>::Name();
2336 case PixelFormat::BGR8:
2337 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>::Name();
2338 case PixelFormat::BGR10:
2339 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>::Name();
2340 case PixelFormat::BGR12:
2341 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>::Name();
2342 case PixelFormat::BGRa8:
2343 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>::Name();
2345 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>::Name();
2347 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>::Name();
2349 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>::Name();
2351 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>::Name();
2353 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>::Name();
2355 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>::Name();
2357 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>::Name();
2359 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>::Name();
2361 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>::Name();
2363 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>::Name();
2365 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>::Name();
2367 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>::Name();
2369 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>::Name();
2371 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>::Name();
2373 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>::Name();
2375 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>::Name();
2377 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>::Name();
2379 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>::Name();
2381 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>::Name();
2383 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>::Name();
2385 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>::Name();
2387 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>::Name();
2389 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>::Name();
2391 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>::Name();
2393 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>::Name();
2395 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>::Name();
2397 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::Name();
2399 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::Name();
2401 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C32f>::Name();
2403 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_ABC32f>::Name();
2405 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::Name();
2407 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::Name();
2409 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::Name();
2411 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::Name();
2413 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::Name();
2415 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::Name();
2417 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::Name();
2419 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::Name();
2421 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::Name();
2423 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::Name();
2425 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::Name();
2427 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::Name();
2429 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::Name();
2430 default:
2431 const auto pixelFormatValue = static_cast<typename std::underlying_type<decltype(m_pixelFormat)>::type>(m_pixelFormat);
2433 "The given pixel format with the integer value of " + std::to_string(pixelFormatValue) + " is unknown!");
2434 }
2435}
2436
2437inline std::vector<Channel> PixelFormatInfo::GetChannels() const
2438{
2439 switch (m_pixelFormat)
2440 {
2441 case PixelFormat::Mono8:
2442 return { detail::ChannelsVector<detail::PixelFormatInfo<peak::common::PixelFormat::Mono8>>() };
2444 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>>() };
2446 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>>() };
2448 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>>() };
2450 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>>() };
2452 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>>() };
2453 case PixelFormat::RGB8:
2454 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>>() };
2455 case PixelFormat::RGB10:
2456 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>>() };
2457 case PixelFormat::RGB12:
2458 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>>() };
2459 case PixelFormat::RGBa8:
2460 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>>() };
2462 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>>() };
2464 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>>() };
2465 case PixelFormat::BGR8:
2466 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>>() };
2467 case PixelFormat::BGR10:
2468 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>>() };
2469 case PixelFormat::BGR12:
2470 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>>() };
2471 case PixelFormat::BGRa8:
2472 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>>() };
2474 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>>() };
2476 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>>() };
2478 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>>() };
2480 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>>() };
2482 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>>() };
2484 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>>() };
2486 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>>() };
2488 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>>() };
2490 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>>() };
2492 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>>() };
2494 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>>() };
2496 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>>() };
2498 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>>() };
2500 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>>() };
2502 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>>() };
2504 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>>() };
2506 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>>() };
2508 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>>() };
2510 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>>() };
2512 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>>() };
2514 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>>() };
2516 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>>() };
2518 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>>() };
2520 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>>() };
2522 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>>() };
2524 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>>() };
2526 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>>() };
2528 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>>() };
2530 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C32f>>() };
2532 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_ABC32f>>() };
2534 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>>() };
2536 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>>() };
2538 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>>() };
2540 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>>() };
2542 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>>() };
2544 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>>() };
2546 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>>() };
2548 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>>() };
2550 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>>() };
2552 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>>() };
2554 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>>() };
2556 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>>() };
2558 return { detail::ChannelsVector<peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>>() };
2559 default:
2560 const auto pixelFormatValue = static_cast<typename std::underlying_type<decltype(m_pixelFormat)>::type>(m_pixelFormat);
2562 "The given pixel format with the integer value of " + std::to_string(pixelFormatValue) + " is unknown!");
2563 }
2564}
2565
2567{
2568 switch (m_pixelFormat)
2569 {
2570 case PixelFormat::Mono8:
2571 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono8>::allocatedBitsPerPixel;
2573 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>::allocatedBitsPerPixel;
2575 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>::allocatedBitsPerPixel;
2577 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>::allocatedBitsPerPixel;
2579 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>::allocatedBitsPerPixel;
2581 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>::allocatedBitsPerPixel;
2582 case PixelFormat::RGB8:
2583 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>::allocatedBitsPerPixel;
2584 case PixelFormat::RGB10:
2585 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>::allocatedBitsPerPixel;
2586 case PixelFormat::RGB12:
2587 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>::allocatedBitsPerPixel;
2588 case PixelFormat::RGBa8:
2589 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>::allocatedBitsPerPixel;
2591 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>::allocatedBitsPerPixel;
2593 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>::allocatedBitsPerPixel;
2594 case PixelFormat::BGR8:
2595 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>::allocatedBitsPerPixel;
2596 case PixelFormat::BGR10:
2597 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>::allocatedBitsPerPixel;
2598 case PixelFormat::BGR12:
2599 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>::allocatedBitsPerPixel;
2600 case PixelFormat::BGRa8:
2601 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>::allocatedBitsPerPixel;
2603 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>::allocatedBitsPerPixel;
2605 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>::allocatedBitsPerPixel;
2607 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>::allocatedBitsPerPixel;
2609 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>::allocatedBitsPerPixel;
2611 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>::allocatedBitsPerPixel;
2613 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>::allocatedBitsPerPixel;
2615 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>::allocatedBitsPerPixel;
2617 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>::allocatedBitsPerPixel;
2619 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>::allocatedBitsPerPixel;
2621 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>::allocatedBitsPerPixel;
2623 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>::allocatedBitsPerPixel;
2625 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>::allocatedBitsPerPixel;
2627 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>::allocatedBitsPerPixel;
2629 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>::allocatedBitsPerPixel;
2631 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>::allocatedBitsPerPixel;
2633 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>::allocatedBitsPerPixel;
2635 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>::allocatedBitsPerPixel;
2637 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>::allocatedBitsPerPixel;
2639 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>::allocatedBitsPerPixel;
2641 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>::allocatedBitsPerPixel;
2643 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>::allocatedBitsPerPixel;
2645 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>::allocatedBitsPerPixel;
2647 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>::allocatedBitsPerPixel;
2649 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>::allocatedBitsPerPixel;
2651 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>::allocatedBitsPerPixel;
2653 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>::allocatedBitsPerPixel;
2655 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::allocatedBitsPerPixel;
2657 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::allocatedBitsPerPixel;
2659 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C32f>::allocatedBitsPerPixel;
2661 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_ABC32f>::allocatedBitsPerPixel;
2663 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::allocatedBitsPerPixel;
2665 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::allocatedBitsPerPixel;
2667 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::allocatedBitsPerPixel;
2669 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::allocatedBitsPerPixel;
2671 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::allocatedBitsPerPixel;
2673 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::allocatedBitsPerPixel;
2675 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::allocatedBitsPerPixel;
2677 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::allocatedBitsPerPixel;
2679 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::allocatedBitsPerPixel;
2681 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::allocatedBitsPerPixel;
2683 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::allocatedBitsPerPixel;
2685 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::allocatedBitsPerPixel;
2687 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::allocatedBitsPerPixel;
2688 default:
2689 const auto pixelFormatValue = static_cast<typename std::underlying_type<decltype(m_pixelFormat)>::type>(m_pixelFormat);
2691 "The given pixel format with the integer value of " + std::to_string(pixelFormatValue) + " is unknown!");
2692 }
2693}
2694
2696{
2698}
2699
2700inline size_t PixelFormatInfo::GetChannelIndex(Channel channel) const
2701{
2702 const auto channels = this->GetChannels();
2703 const auto it = std::find(channels.cbegin(), channels.cend(), channel);
2704 if (it == channels.end())
2705 {
2706 throw InvalidParameterException("The given channel is not part of the pixel format " + GetName() + '!');
2707 }
2708
2709 return static_cast<size_t>(std::distance(channels.begin(), it));
2710}
2711
2713{
2714 return this->GetChannels().size();
2715}
2716
2718{
2719 return GetNumberOfChannels() == 1;
2720}
2721
2722inline bool PixelFormatInfo::HasChannel(Channel channel) const
2723{
2724 const auto channels = this->GetChannels();
2725 return std::find(channels.cbegin(), channels.cend(), channel) != channels.cend();
2726}
2727
2729{
2730 return m_pixelFormat;
2731}
2732
2733inline size_t PixelFormatInfo::GetSizeInBytes(const Size& size) const
2734{
2735 switch (m_pixelFormat)
2736 {
2737 case PixelFormat::Mono8:
2738 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono8>::GetSizeInBytes(size);
2740 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10>::GetSizeInBytes(size);
2742 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12>::GetSizeInBytes(size);
2744 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono16>::GetSizeInBytes(size);
2746 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10p>::GetSizeInBytes(size);
2748 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12p>::GetSizeInBytes(size);
2749 case PixelFormat::RGB8:
2750 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB8>::GetSizeInBytes(size);
2751 case PixelFormat::RGB10:
2752 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10>::GetSizeInBytes(size);
2753 case PixelFormat::RGB12:
2754 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB12>::GetSizeInBytes(size);
2755 case PixelFormat::RGBa8:
2756 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa8>::GetSizeInBytes(size);
2758 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa10>::GetSizeInBytes(size);
2760 return peak::common::detail::PixelFormatInfo<PixelFormat::RGBa12>::GetSizeInBytes(size);
2761 case PixelFormat::BGR8:
2762 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR8>::GetSizeInBytes(size);
2763 case PixelFormat::BGR10:
2764 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10>::GetSizeInBytes(size);
2765 case PixelFormat::BGR12:
2766 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR12>::GetSizeInBytes(size);
2767 case PixelFormat::BGRa8:
2768 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa8>::GetSizeInBytes(size);
2770 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa10>::GetSizeInBytes(size);
2772 return peak::common::detail::PixelFormatInfo<PixelFormat::BGRa12>::GetSizeInBytes(size);
2774 return peak::common::detail::PixelFormatInfo<PixelFormat::RGB10p32>::GetSizeInBytes(size);
2776 return peak::common::detail::PixelFormatInfo<PixelFormat::BGR10p32>::GetSizeInBytes(size);
2778 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR8>::GetSizeInBytes(size);
2780 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10>::GetSizeInBytes(size);
2782 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12>::GetSizeInBytes(size);
2784 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG8>::GetSizeInBytes(size);
2786 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10>::GetSizeInBytes(size);
2788 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12>::GetSizeInBytes(size);
2790 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB8>::GetSizeInBytes(size);
2792 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10>::GetSizeInBytes(size);
2794 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12>::GetSizeInBytes(size);
2796 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG8>::GetSizeInBytes(size);
2798 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10>::GetSizeInBytes(size);
2800 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12>::GetSizeInBytes(size);
2802 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10p>::GetSizeInBytes(size);
2804 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12p>::GetSizeInBytes(size);
2806 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10p>::GetSizeInBytes(size);
2808 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12p>::GetSizeInBytes(size);
2810 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10p>::GetSizeInBytes(size);
2812 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12p>::GetSizeInBytes(size);
2814 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10p>::GetSizeInBytes(size);
2816 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12p>::GetSizeInBytes(size);
2818 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence8>::GetSizeInBytes(size);
2820 return peak::common::detail::PixelFormatInfo<PixelFormat::Confidence16>::GetSizeInBytes(size);
2822 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C8>::GetSizeInBytes(size);
2824 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C16>::GetSizeInBytes(size);
2826 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_C32f>::GetSizeInBytes(size);
2828 return peak::common::detail::PixelFormatInfo<PixelFormat::Coord3D_ABC32f>::GetSizeInBytes(size);
2830 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG10g40IDS>::GetSizeInBytes(size);
2832 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerBG12g24IDS>::GetSizeInBytes(size);
2834 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB10g40IDS>::GetSizeInBytes(size);
2836 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGB12g24IDS>::GetSizeInBytes(size);
2838 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR10g40IDS>::GetSizeInBytes(size);
2840 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerGR12g24IDS>::GetSizeInBytes(size);
2842 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG10g40IDS>::GetSizeInBytes(size);
2844 return peak::common::detail::PixelFormatInfo<PixelFormat::BayerRG12g24IDS>::GetSizeInBytes(size);
2846 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono10g40IDS>::GetSizeInBytes(size);
2848 return peak::common::detail::PixelFormatInfo<PixelFormat::Mono12g24IDS>::GetSizeInBytes(size);
2850 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_UV_SemiplanarIDS>::GetSizeInBytes(size);
2852 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV420_8_YY_VU_SemiplanarIDS>::GetSizeInBytes(size);
2854 return peak::common::detail::PixelFormatInfo<PixelFormat::YUV422_8_UYVY>::GetSizeInBytes(size);
2855 default:
2856 const auto pixelFormatValue = static_cast<typename std::underlying_type<decltype(m_pixelFormat)>::type>(m_pixelFormat);
2858 "The given pixel format with the integer value of " + std::to_string(pixelFormatValue) + " is unknown!");
2859 }
2860}
2861
2862
2863} // namespace common
2864} // 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.
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.
Represents a two-dimensional size with non-negative width and height.
#define PEAK_COMMON_NO_DISCARD
Compatability macro for the nodiscard attribute.
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)