ADTF
imagetypes.h
Go to the documentation of this file.
1 
7 #ifndef _IMAGE_TYPES_HEADER_
8 #define _IMAGE_TYPES_HEADER_
9 
10 namespace A_UTILS_NS
11 {
12 
13  // basic types are defined in structs.h
14 
15 #ifdef _MSC_VER
16  #pragma pack(push)
17  #pragma pack(1)
18 #else
19  #pragma pack(push)
20  #pragma pack(1)
21 #endif
22 
26  union tFOURCC
27  {
30 
35  {
36  nValue = 0;
37  }
38 
44  tFOURCC(tUInt32 nFOURCC)
45  {
46  nValue = nFOURCC;
47  }
48 
54  tFOURCC(const tChar* strFOURCC)
55  {
56  tInt nLen = (tInt) cStringUtil::GetLength(strFOURCC);
57  strValue[0] = strFOURCC[0];
58  strValue[1] = (nLen > 1) ? strFOURCC[1] : 0;
59  strValue[2] = (nLen > 2) ? strFOURCC[2] : 0;
60  strValue[3] = (nLen > 3) ? strFOURCC[3] : 0;
61  }
62 
68  cString asString() const
69  {
70  tChar strFOURCC[5];
71  strFOURCC[0] = strValue[0];
72  strFOURCC[1] = strValue[1];
73  strFOURCC[2] = strValue[2];
74  strFOURCC[3] = strValue[3];
75  strFOURCC[4] = 0;
76  return cString(strFOURCC);
77  }
78 
84  operator tUInt32() const
85  {
86  return nValue;
87  }
88  };
89 
90 #ifdef _MSC_VER
91  #pragma pack(pop)
92 #else
93  #pragma pack(pop)
94 #endif
95 
96 } // namespace
97 
98 #endif // _IMAGE_TYPES_HEADER_
char tChar
The tChar defines the type for platform character set (platform and compiler dependent type).
int tInt
type definition for signed integer value (platform and compiler dependent type).
uint32_t tUInt32
type definition for unsigned integer values (32bit) (platform and compiler independent type).
static tSize GetLength(const tChar *pcStr)
Returns the length of the string.
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.
Definition: d_ptr.h:11
string_base< cStackString > cString
cString implementation for a stack string which works on stack if string is lower than A_UTILS_DEFAUL...
Definition: string.h:2784
The FOURCC type is used as identifier for video compression codecs.
Definition: imagetypes.h:27
tFOURCC(tUInt32 nFOURCC)
Constructor.
Definition: imagetypes.h:44
tFOURCC()
Constructor.
Definition: imagetypes.h:34
tChar strValue[4]
FOURCC of codec as string.
Definition: imagetypes.h:29
cString asString() const
Retrieve FOURCC value as string.
Definition: imagetypes.h:68
tUInt32 nValue
FOURCC of codec as integer.
Definition: imagetypes.h:28
tFOURCC(const tChar *strFOURCC)
Constructor.
Definition: imagetypes.h:54