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.
34 struct PictureDescriptor;
41 class MonoPictureFrame;
42 class StereoPictureFrame;
43 class PictureAssetWriter;
45 /** @class PictureAsset
46 * @brief An asset made up of JPEG2000 data.
48 class PictureAsset : public Asset, public MXF
51 PictureAsset (boost::filesystem::path file);
52 PictureAsset (Fraction edit_rate);
54 virtual boost::shared_ptr<PictureAssetWriter> start_write (
55 boost::filesystem::path file,
64 void set_size (Size s) {
68 Fraction frame_rate () const {
72 void set_frame_rate (Fraction r) {
76 Fraction screen_aspect_ratio () const {
77 return _screen_aspect_ratio;
80 void set_screen_aspect_ratio (Fraction r) {
81 _screen_aspect_ratio = r;
84 Fraction edit_rate () const {
88 int64_t intrinsic_duration () const {
89 return _intrinsic_duration;
93 friend class MonoPictureAssetWriter;
94 friend class StereoPictureAssetWriter;
96 bool frame_buffer_equals (
97 int frame, EqualityOptions opt, NoteHandler note,
98 uint8_t const * data_A, unsigned int size_A, uint8_t const * data_B, unsigned int size_B
101 bool descriptor_equals (
102 ASDCP::JP2K::PictureDescriptor const & a,
103 ASDCP::JP2K::PictureDescriptor const & b,
107 void read_picture_descriptor (ASDCP::JP2K::PictureDescriptor const &);
110 /** The total length of this content in video frames. The amount of
111 * content presented may be less than this.
113 int64_t _intrinsic_duration;
114 /** picture size in pixels */
116 Fraction _frame_rate;
117 Fraction _screen_aspect_ratio;
120 std::string pkl_type (Standard standard) const;