Tag Parser  6.4.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  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 
35 constexpr AspectRatio::AspectRatio(uint16 numerator, uint16 denominator) :
36  type(0xFF),
37  numerator(numerator),
38  denominator(denominator)
39 {}
40 
44 constexpr bool AspectRatio::isValid() const
45 {
46  return type && numerator && denominator;
47 }
48 
52 constexpr bool AspectRatio::isExtended() const
53 {
54  return type == 0xFF;
55 }
56 
57 }
58 
59 #endif // MEDIA_ASPECTRATIO_H
The AspectRatio struct defines an aspect ratio.
Definition: aspectratio.h:10
constexpr bool isExtended() const
Returns whether numerator and denominator must be read from extended SAR header.
Definition: aspectratio.h:52
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:44
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.