ADTF  3.18.2
streammetatypeimage.h
Go to the documentation of this file.
1 
7 #pragma once
9 #include <adtfbase/property.h>
10 #include "streamtype_intf.h"
11 #include "streamimageformat.h"
12 #include "streamtype.h"
13 
14 #include <adtf_base_deprecated.h>
15 
16 namespace adtf
17 {
18 namespace streaming
19 {
20 namespace ant
21 {
22 
33 {
35  static constexpr const tChar *const MetaTypeName = "adtf/image";
40  static constexpr const tChar *const FormatName = "format_name";
45  static constexpr const tChar *const MaxByteSize = "max_byte_size";
50  static constexpr const tChar *const PixelWidth = "pixel_width";
55  static constexpr const tChar *const PixelHeight = "pixel_height";
60  static constexpr const tChar *const DataEndianess = "data_endianess";
61 
67  {
68  pProperties->SetProperty(adtf::base::property<adtf_util::cString>(FormatName, ""));
69  pProperties->SetProperty(adtf::base::property<uint32_t>(MaxByteSize, 0));
70  pProperties->SetProperty(adtf::base::property<unsigned int>(PixelWidth, 0));
71  pProperties->SetProperty(adtf::base::property<unsigned int>(PixelHeight, 0));
73  }
74 };
83 
92 
93 } // namespace ant
94 
95 namespace lucky
96 {
97 
103 {
104 public:
110  {
112  }
136  const adtf::streaming::ant::IStreamType& oTypeExpected);
137 };
138 
144 ADTF3_DEPRECATED("Use adtf::ucom::make_object_ptr<stream_type_image<>>() instead!")
146 {
147  return ucom::ant::make_object_ptr<ant::cStreamType>(lucky::stream_meta_type_image());
148 }
149 
156 ADTF3_DEPRECATED("Use adtf::ucom::make_object_ptr<stream_type_image<>>(const ant::tStreamImageFormat&) instead!")
157 inline ucom::ant::object_ptr<ant::IStreamType> create_adtf_image_stream_type(const ant::tStreamImageFormat& oFormat)
158 {
159  auto oCreatedType = ucom::ant::make_object_ptr<ant::cStreamType>(lucky::stream_meta_type_image());
160  THROW_IF_FAILED(ant::set_stream_type_image_format(*oCreatedType, oFormat));
161  return oCreatedType;
162 }
163 
164 } //namespace lucky
165 
166 namespace penguin
167 {
175 template<typename T = ant::tStreamImageFormat>
177 {
178  static_assert(std::is_same_v<ant::tStreamImageFormat, T>,
179  "Currently only T=ant::tStreamImageFormat is possible."
180  "To support your own type you need to specialize this template stream_type_image<T>");
181 
182 public:
185  {
186  }
187  stream_type_image(const T& sImageFormat):
189  {
191  }
192 };
193 }
194 
200 
201 } // namespace streaming
202 } // namespace adtf
Copyright © Audi Electronics Venture GmbH.
#define ADTF3_DEPRECATED(_depr_message_)
Mark a function or variable as deprecated.
char tChar
The tChar defines the type for platform character set (platform and compiler dependent type).
Defines access methods for the interface of a Stream Type - see also Stream Type and Stream Meta Type...
Default StreamType implementation.
Definition: streamtype.h:282
Generator template to create an instance of a ant::IStreamType class for lucky::stream_meta_type_imag...
Base object pointer to realize binary compatible reference counting in interface methods.
#define PLATFORM_BYTEORDER
defines a link to __get_platform_byteorder.
Definition: constants.h:124
tResult get_stream_type_image_format(tStreamImageFormat &oFormat, const IStreamType &oType)
Helper function to retrieve the oFormat (tStreamImageFormat) out of the of a IStreamType for a stream...
tResult set_stream_type_image_format(IStreamType &oType, const tStreamImageFormat &oFormat)
Helper function to set the properties of a IStreamType for a stream_meta_type_image.
ucom::ant::object_ptr< ant::IStreamType > create_adtf_image_stream_type()
Convenience functionality to create a stream type image - see sec_stream_type_image.
ant::object_ptr< T > object_ptr
Alias always bringing the latest version of ant::object_ptr into scope.
Definition: object_ptr.h:413
Namespace for entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Use this Stream Meta Type for describing a video stream with single frames and there format and set t...
static constexpr const tChar *const MaxByteSize
Name for the Property of the max byte size.
static constexpr const tChar *const DataEndianess
Name for the Property of the data endianess (usually pixel endianess).
static void SetProperties(const adtf::ucom::iobject_ptr< adtf::base::IProperties > &pProperties)
Sets the default properties to the given pProperties.
static constexpr const tChar *const FormatName
Name for the Property of the format name - see imageformat_definition and Generic Pixel Format.
static constexpr const tChar *const PixelWidth
Name for the Property of the pixel width.
static constexpr const tChar *const MetaTypeName
StreamMetaTypeName for imagetype (video stream).
static constexpr const tChar *const PixelHeight
Name for the Property of the pixel height.
Simple Stream Type and Stream Meta Type definition for video frames or an image sequence as a conveni...
Use this Stream Meta Type for describing a video stream with single frames and there format and set t...
static void SetProperties(const adtf::ucom::iobject_ptr< adtf::base::IProperties > &pProperties)
Sets the default properties to the given pProperties.
static tResult IsCompatible(const adtf::streaming::ant::IStreamType &oTypeToCheck, const adtf::streaming::ant::IStreamType &oTypeExpected)
Compares the oTypeExpected Stream Type with the oTypeToCheck - see Default Stream Meta Types in ADTF ...
#define THROW_IF_FAILED(s)
throws if the expression returns a failed tResult