Tag Parser  6.4.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
aspectratio.cpp
Go to the documentation of this file.
1 #include "./aspectratio.h"
2 
3 using namespace std;
4 
5 namespace Media {
6 
15 AspectRatio::AspectRatio(byte aspectRatioType)
16 {
17  static const AspectRatio predefinedPars[] = {
18  AspectRatio(), AspectRatio(1, 1), AspectRatio(12, 11), AspectRatio(10, 11),
19  AspectRatio(16, 11), AspectRatio(40, 33), AspectRatio(24, 11), AspectRatio(20, 11),
20  AspectRatio(32, 11), AspectRatio(80, 33), AspectRatio(18, 11), AspectRatio(15, 11),
21  AspectRatio(64, 33), AspectRatio(160, 99), AspectRatio(4, 3), AspectRatio(3, 2),
22  AspectRatio(2, 1)
23  };
24  if(aspectRatioType < (sizeof(predefinedPars) / sizeof(AspectRatio))) {
25  *this = predefinedPars[aspectRatioType];
26  } else {
27  numerator = denominator = 0;
28  }
29  type = aspectRatioType;
30 }
31 
32 }
The AspectRatio struct defines an aspect ratio.
Definition: aspectratio.h:10
STL namespace.
Contains all classes and functions of the TagInfo library.
Definition: exceptions.h:9