OpenShot Library | libopenshot  0.3.0
Profiles.h
Go to the documentation of this file.
1 
9 // Copyright (c) 2008-2019 OpenShot Studios, LLC
10 //
11 // SPDX-License-Identifier: LGPL-3.0-or-later
12 
13 #ifndef OPENSHOT_PROFILE_H
14 #define OPENSHOT_PROFILE_H
15 
16 #include <iostream>
17 #include <string>
18 #include <sstream>
19 #include <fstream>
20 #include <QtCore/QString>
21 #include <QtCore/QStringList>
22 #include <QtCore/QFile>
23 #include <QTextStream>
24 #include <cstdio>
25 #include <cstdlib>
26 #include "Fraction.h"
27 #include "Json.h"
28 
29 namespace openshot
30 {
31 
38  struct ProfileInfo
39  {
40  std::string description;
41  int height;
42  int width;
47  bool interlaced_frame; // Are the contents of this frame interlaced
48  };
49 
63  class Profile
64  {
65  public:
68 
71  Profile(std::string path);
72 
73  // Get and Set JSON methods
74  std::string Json() const;
75  Json::Value JsonValue() const;
76  void SetJson(const std::string value);
77  void SetJsonValue(const Json::Value root);
78  };
79 
80 }
81 
82 #endif
Header file for Fraction class.
Header file for JSON class.
This class represents a fraction.
Definition: Fraction.h:30
This class loads a special text-based file called a Profile.
Definition: Profiles.h:64
Profile(std::string path)
Constructor for Profile.
Definition: Profiles.cpp:21
void SetJsonValue(const Json::Value root)
Load Json::Value into this object.
Definition: Profiles.cpp:166
std::string Json() const
Generate JSON string of this object.
Definition: Profiles.cpp:119
ProfileInfo info
Profile data stored here.
Definition: Profiles.h:67
void SetJson(const std::string value)
Load JSON string into this object.
Definition: Profiles.cpp:149
Json::Value JsonValue() const
Generate Json::Value for this object.
Definition: Profiles.cpp:126
This namespace is the default namespace for all code in the openshot library.
Definition: Compressor.h:29
This struct holds profile data, typically loaded from a file.
Definition: Profiles.h:39
std::string description
The description of this profile.
Definition: Profiles.h:40
int width
The width of the video (in pixels)
Definition: Profiles.h:42
Fraction pixel_ratio
The pixel ratio of the video stream as a fraction (i.e. some pixels are not square)
Definition: Profiles.h:45
Fraction display_ratio
The ratio of width to height of the video stream (i.e. 640x480 has a ratio of 4/3)
Definition: Profiles.h:46
Fraction fps
Frames per second, as a fraction (i.e. 24/1 = 24 fps)
Definition: Profiles.h:44
int height
The height of the video (in pixels)
Definition: Profiles.h:41
int pixel_format
The pixel format (i.e. YUV420P, RGB24, etc...)
Definition: Profiles.h:43