Tag Parser  7.0.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 TAG_PARSER_ASPECTRATIO_H
2 #define TAG_PARSER_ASPECTRATIO_H
3 
4 #include "./global.h"
5 
6 #include <c++utilities/conversion/types.h>
7 
8 namespace TagParser {
9 
11  constexpr AspectRatio();
12  AspectRatio(byte aspectRatioType);
13  constexpr AspectRatio(uint16 numerator, uint16 denominator);
14  constexpr bool isValid() const;
15  constexpr 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 }
31 
36 constexpr AspectRatio::AspectRatio(uint16 numerator, uint16 denominator)
37  : type(0xFF)
38  , numerator(numerator)
39  , denominator(denominator)
40 {
41 }
42 
46 constexpr bool AspectRatio::isValid() const
47 {
48  return type && numerator && denominator;
49 }
50 
54 constexpr bool AspectRatio::isExtended() const
55 {
56  return type == 0xFF;
57 }
58 
59 } // namespace TagParser
60 
61 #endif // TAG_PARSER_ASPECTRATIO_H
constexpr AspectRatio()
Constructs an invalid aspect ratio.
Definition: aspectratio.h:25
constexpr bool isValid() const
Returns an indication whether the aspect ratio is present and valid.
Definition: aspectratio.h:46
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
constexpr bool isExtended() const
Returns whether numerator and denominator must be read from extended SAR header.
Definition: aspectratio.h:54