Tag Parser  6.3.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
aspectratio.h
Go to the documentation of this file.
1 #ifndef MEDIA_ASPECTRATIO_H
2 #define MEDIA_ASPECTRATIO_H
3 
4 #include "./global.h"
5 
6 #include <c++utilities/conversion/types.h>
7 
8 namespace Media {
9 
11  AspectRatio();
12  AspectRatio(byte aspectRatioType);
13  AspectRatio(uint16 numerator, uint16 denominator);
14  bool isValid() const;
15  bool isExtended() const;
16 
17  byte type;
18  uint16 numerator;
19  uint16 denominator;
20 };
21 
26  type(0),
27  numerator(0),
28  denominator(0)
29 {}
30 
35  type(0xFF),
36  numerator(numerator),
37  denominator(denominator)
38 {}
39 
43 inline bool AspectRatio::isValid() const
44 {
45  return type && numerator && denominator;
46 }
47 
51 inline bool AspectRatio::isExtended() const
52 {
53  return type == 0xFF;
54 }
55 
56 }
57 
58 #endif // MEDIA_ASPECTRATIO_H
AspectRatio()
Constructs an invalid aspect ratio.
Definition: aspectratio.h:25
The AspectRatio struct defines an aspect ratio.
Definition: aspectratio.h:10
bool isExtended() const
Returns whether numerator and denominator must be read from extended SAR header.
Definition: aspectratio.h:51
bool isValid() const
Returns an indication whether the aspect ratio is present and valid.
Definition: aspectratio.h:43
Contains all classes and functions of the TagInfo library.
Definition: exceptions.h:9
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.