ADTF  3.18.2
streamimageformat.h
Go to the documentation of this file.
1 
7 #pragma once
8 #include <adtf_utils.h>
9 
10 namespace adtf
11 {
12 namespace streaming
13 {
14 namespace ant
15 {
16 
18 #define ADTF_STREAMING_DEFAULT_SIZE_OF_STREAM_IMAGE_FORMATNAME 24
19 
21 typedef adtf_util::stack_string_base < ADTF_STREAMING_DEFAULT_SIZE_OF_STREAM_IMAGE_FORMATNAME, adtf_util::assert_out_of_range > cStreamFormatStorageType;
23 typedef adtf_util::string_base<cStreamFormatStorageType> tStreamImageFormatName;
24 
30 {
35  uint32_t m_ui32Width = 0;
37  uint32_t m_ui32Height = 0;
39  size_t m_szMaxByteSize = 0;
44 };
45 
53 bool operator!=(const tStreamImageFormat& sLeft, const tStreamImageFormat& sRight);
61 bool operator==(const tStreamImageFormat& sLeft, const tStreamImageFormat& sRight);
62 
67 namespace imageformat_definition
68 {
69 }
72 #define ADTF_DEFINE_STREAM_IMAGE_FORMAT( _FORMAT_STRUCT_TYPE_, _FORMAT_NAME_) \
73 namespace imageformat_definition \
74 { \
75  struct _FORMAT_STRUCT_TYPE_ \
76  { \
77  static constexpr const char *const FormatName = _FORMAT_NAME_; \
78  }; \
79 }
80 
83 ADTF_DEFINE_STREAM_IMAGE_FORMAT(GREYSCALE_8, "GREY(8)")
85 ADTF_DEFINE_STREAM_IMAGE_FORMAT(GREYSCALE_16, "GREY(16)")
87 ADTF_DEFINE_STREAM_IMAGE_FORMAT(GREYSCALE_24, "GREY(24)")
89 ADTF_DEFINE_STREAM_IMAGE_FORMAT(GREYSCALE_32, "GREY(32)")
90 
94 ADTF_DEFINE_STREAM_IMAGE_FORMAT(RGB_555, "R(5)G(5)B(5)(1)")
96 ADTF_DEFINE_STREAM_IMAGE_FORMAT(RGB_565, "R(5)G(6)B(5)")
97 
99 ADTF_DEFINE_STREAM_IMAGE_FORMAT(RGB_24, "R(8)G(8)B(8)")
104 ADTF_DEFINE_STREAM_IMAGE_FORMAT(RGB_32, "R(8)G(8)B(8)(8)")
107 ADTF_DEFINE_STREAM_IMAGE_FORMAT(BGR_32, "B(8)G(8)R(8)(8)")
110 ADTF_DEFINE_STREAM_IMAGE_FORMAT(RGBA_32, "R(8)G(8)B(8)A(8)")
113 ADTF_DEFINE_STREAM_IMAGE_FORMAT(BGRA_32, "B(8)G(8)R(8)A(8)")
116 ADTF_DEFINE_STREAM_IMAGE_FORMAT(ABGR_32, "A(8)B(8)G(8)R(8)")
119 ADTF_DEFINE_STREAM_IMAGE_FORMAT(ARGB_32, "A(8)R(8)G(8)B(8)")
121 ADTF_DEFINE_STREAM_IMAGE_FORMAT(YUV420P, "YUV420P")
125 
126 
133 bool stream_image_format_is_generic_greyscale(const tStreamImageFormat& strFormat);
134 
142 
149 
156 
163 uint32_t stream_image_format_get_generic_mask(const char* strChannel, const tStreamImageFormat& strFormat);
164 
165 } // namespace ant
166 
167 using ant::tStreamImageFormatName;
168 using ant::tStreamImageFormat;
169 
174 namespace stream_image_format
175 {
176  using namespace ant::imageformat_definition;
177 } // namespace stream_image_format
178 
183 #define ADTF_IMAGE_FORMAT(_FORMAT_) ::adtf::streaming::stream_image_format::_FORMAT_::FormatName
184 
185 
186 
187 using ant::stream_image_format_is_generic_greyscale;
192 }
193 } // namespace adtf
Copyright © Audi Electronics Venture GmbH.
#define PLATFORM_BYTEORDER
defines a link to __get_platform_byteorder.
Definition: constants.h:124
bool operator==(const tStreamImageFormat &sLeft, const tStreamImageFormat &sRight)
is equal operator to compare tStreamImageFormat
bool stream_image_format_is_generic(const tStreamImageFormat &strFormat)
Check if all bits are well defined and at least one component is available in Generic Pixel Format.
uint32_t stream_image_format_get_generic_mask(const char *strChannel, const tStreamImageFormat &strFormat)
Retrieves the pixelsize by a Generic Pixel Format.
adtf_util::string_base< cStreamFormatStorageType > tStreamImageFormatName
formatname type as stack string (max byte size defined by ADTF_STREAMING_DEFAULT_SIZE_OF_STREAM_IMAGE...
B(8) G(8) R(8)") ADTF_DEFINE_STREAM_IMAGE_FORMAT(RGB_32
Format definition this description means always first in lowest bit of lowest byte.
A(8) B(8) G(8) R(8)") ADTF_DEFINE_STREAM_IMAGE_FORMAT(ARGB_32
Format definition this description means always first in lowest bit of lowest byte.
adtf_util::stack_string_base< ADTF_STREAMING_DEFAULT_SIZE_OF_STREAM_IMAGE_FORMATNAME, adtf_util::assert_out_of_range > cStreamFormatStorageType
formatname storage type (max byte size defined by ADTF_STREAMING_DEFAULT_SIZE_OF_STREAM_IMAGE_FORMATN...
bool operator!=(const tStreamImageFormat &sLeft, const tStreamImageFormat &sRight)
is not equal operator to compare tStreamImageFormat
bool stream_image_format_is_generic_rgb(const tStreamImageFormat &strFormat)
Check if R, G and B components are available in Generic Pixel Format.
unsigned int stream_image_format_get_generic_pixel_size(const tStreamImageFormat &strFormat)
Retrieves the pixelsize by a Generic Pixel Format.
ADTF_DEFINE_STREAM_IMAGE_FORMAT(RGB_8, "R(3)G(3)B(2)") ADTF_DEFINE_STREAM_IMAGE_FORMAT(RGB_555
BYTE ORDER FORMAT DESCRIPTION Format definition.
R(5) G(5) B(5)(1)") ADTF_DEFINE_STREAM_IMAGE_FORMAT(RGB_565
Format definition.
Namespace for entire ADTF SDK.
Simple Stream Type and Stream Meta Type definition for video frames or an image sequence as a conveni...
uint32_t m_ui32Height
Pixel height of the image.
tStreamImageFormatName m_strFormatName
Formatname of the image - see adtf::streaming::ant::imageformat_definition.
size_t m_szMaxByteSize
Maximal byte size of the image.
uint32_t m_ui32Width
Pixel width of the image.
uint8_t m_ui8DataEndianess
Endianess of the image (usually pixel endianess) - by default this is PLATFORM_BYTEORDER (PLATFORM_BI...