2 Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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 PictureAsset (boost::filesystem::path file);
51 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;