libdcp
reel_picture_asset.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
3 
4  This file is part of libdcp.
5 
6  libdcp is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  libdcp is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with libdcp. If not, see <http://www.gnu.org/licenses/>.
18 
19  In addition, as a special exception, the copyright holders give
20  permission to link the code of portions of this program with the
21  OpenSSL library under certain conditions as described in each
22  individual source file, and distribute linked combinations
23  including the two.
24 
25  You must obey the GNU General Public License in all respects
26  for all of the code used other than OpenSSL. If you modify
27  file(s) with this exception, you may extend this exception to your
28  version of the file(s), but you are not obligated to do so. If you
29  do not wish to do so, delete this exception statement from your
30  version. If you delete this exception statement from all source
31  files in the program, then also delete it here.
32 */
33 
34 
40 #ifndef LIBDCP_REEL_PICTURE_ASSET_H
41 #define LIBDCP_REEL_PICTURE_ASSET_H
42 
43 
44 #include "reel_file_asset.h"
45 #include "j2k_picture_asset.h"
46 #include "mpeg2_picture_asset.h"
47 
48 
49 namespace dcp {
50 
51 
56 {
57 public:
58  ReelPictureAsset(std::shared_ptr<PictureAsset> asset, int64_t entry_point);
59  explicit ReelPictureAsset (std::shared_ptr<const cxml::Node>);
60 
62  std::shared_ptr<const PictureAsset> asset() const {
63  return asset_of_type<const PictureAsset>();
64  }
65 
67  std::shared_ptr<PictureAsset> asset() {
68  return asset_of_type<PictureAsset>();
69  }
70 
72  std::shared_ptr<const J2KPictureAsset> j2k_asset() const {
73  return asset_of_type<const J2KPictureAsset>();
74  }
75 
77  std::shared_ptr<J2KPictureAsset> j2k_asset() {
78  return asset_of_type<J2KPictureAsset>();
79  }
80 
82  std::shared_ptr<const MPEG2PictureAsset> mpeg2_asset() const {
83  return asset_of_type<const MPEG2PictureAsset>();
84  }
85 
87  std::shared_ptr<MPEG2PictureAsset> mpeg2_asset() {
88  return asset_of_type<MPEG2PictureAsset>();
89  }
90 
91  virtual xmlpp::Element* write_to_cpl(xmlpp::Element* node, Standard standard) const override;
92 
93  bool equals(std::shared_ptr<const ReelPictureAsset>, EqualityOptions const&, NoteHandler) const;
94 
96  Fraction frame_rate () const {
97  return _frame_rate;
98  }
99 
104  _screen_aspect_ratio = a;
105  }
106 
107  Fraction screen_aspect_ratio () const {
108  return _screen_aspect_ratio;
109  }
110 
111 private:
112  boost::optional<std::string> key_type () const override {
113  return std::string ("MDIK");
114  }
115 
116  Fraction _frame_rate;
117  Fraction _screen_aspect_ratio;
118 };
119 
120 
121 }
122 
123 
124 #endif
A class to describe what "equality" means for a particular test.
A fraction (i.e. a thing with an integer numerator and an integer denominator).
Definition: types.h:168
Part of a Reel's description which refers to a picture asset.
std::shared_ptr< const MPEG2PictureAsset > mpeg2_asset() const
std::shared_ptr< PictureAsset > asset()
std::shared_ptr< const PictureAsset > asset() const
std::shared_ptr< const J2KPictureAsset > j2k_asset() const
std::shared_ptr< J2KPictureAsset > j2k_asset()
std::shared_ptr< MPEG2PictureAsset > mpeg2_asset()
Fraction frame_rate() const
void set_screen_aspect_ratio(Fraction a)
J2KPictureAsset class.
MPEG2PictureAsset class.
Namespace for everything in libdcp.
Definition: array_data.h:50
ReelFileAsset class.