2 Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
4 This file is part of libdcp.
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.
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.
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/>.
20 #ifndef LIBDCP_PICTURE_ASSET_H
21 #define LIBDCP_PICTURE_ASSET_H
23 /** @file src/picture_asset.h
24 * @brief PictureAsset class.
33 struct PictureDescriptor;
40 class MonoPictureFrame;
41 class StereoPictureFrame;
42 class PictureAssetWriter;
44 /** @class PictureAsset
45 * @brief An asset made up of JPEG2000 data.
47 class PictureAsset : public Asset, public MXF
50 explicit PictureAsset (boost::filesystem::path file);
51 explicit PictureAsset (Fraction edit_rate);
53 virtual boost::shared_ptr<PictureAssetWriter> start_write (
54 boost::filesystem::path file,
63 void set_size (Size s) {
67 Fraction frame_rate () const {
71 void set_frame_rate (Fraction r) {
75 Fraction screen_aspect_ratio () const {
76 return _screen_aspect_ratio;
79 void set_screen_aspect_ratio (Fraction r) {
80 _screen_aspect_ratio = r;
83 Fraction edit_rate () const {
87 int64_t intrinsic_duration () const {
88 return _intrinsic_duration;
92 friend class MonoPictureAssetWriter;
93 friend class StereoPictureAssetWriter;
95 bool frame_buffer_equals (
96 int frame, EqualityOptions opt, NoteHandler note,
97 uint8_t const * data_A, unsigned int size_A, uint8_t const * data_B, unsigned int size_B
100 bool descriptor_equals (
101 ASDCP::JP2K::PictureDescriptor const & a,
102 ASDCP::JP2K::PictureDescriptor const & b,
106 void read_picture_descriptor (ASDCP::JP2K::PictureDescriptor const &);
109 /** The total length of this content in video frames. The amount of
110 * content presented may be less than this.
112 int64_t _intrinsic_duration;
113 /** picture size in pixels */
115 Fraction _frame_rate;
116 Fraction _screen_aspect_ratio;
119 std::string pkl_type (Standard standard) const;