2 Copyright (C) 2012 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 /** @file src/picture_asset.h
21 * @brief An asset made up of JPEG2000 files
25 #include "mxf_asset.h"
30 class MonoPictureFrame;
31 class StereoPictureFrame;
33 /** @brief An asset made up of JPEG2000 files */
34 class PictureAsset : public MXFAsset
38 std::string directory, std::string mxf_name, boost::signals2::signal<void (float)>* progress, int fps, int entry_point, int length, bool encrypted
41 /** Write details of the asset to a CPL AssetList node.
42 * @param p Parent node.
44 void write_to_cpl (xmlpp::Element* p) const;
46 bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, std::list<std::string>& notes) const;
58 bool frame_buffer_equals (
59 int frame, EqualityOptions opt, std::list<std::string>& notes,
60 uint8_t const * data_A, unsigned int size_A, uint8_t const * data_B, unsigned int size_B
63 /** picture width in pixels */
65 /** picture height in pixels */
69 /** A 2D (monoscopic) picture asset */
70 class MonoPictureAsset : public PictureAsset
73 /** Construct a PictureAsset, generating the MXF from the JPEG2000 files.
74 * This may take some time; progress is indicated by emission of the Progress signal.
75 * @param files Pathnames of JPEG2000 files, in frame order.
76 * @param directory Directory in which to create MXF file.
77 * @param mxf_name Name of MXF file to create.
78 * @param progress Signal to inform of progress.
79 * @param fps Frames per second.
80 * @param length Length in frames.
81 * @param width Width of images in pixels.
82 * @param height Height of images in pixels.
83 * @param encrypted true if asset should be encrypted.
86 std::vector<std::string> const & files,
87 std::string directory,
89 boost::signals2::signal<void (float)>* progress,
97 /** Construct a PictureAsset, generating the MXF from the JPEG2000 files.
98 * This may take some time; progress is indicated by emission of the Progress signal.
99 * @param get_path Functor which returns a JPEG2000 file path for a given frame (frames counted from 0).
100 * @param directory Directory in which to create MXF file.
101 * @param mxf_name Name of MXF file to create.
102 * @param progress Signal to inform of progress.
103 * @param fps Frames per second.
104 * @param length Length in frames.
105 * @param width Width of images in pixels.
106 * @param height Height of images in pixels.
107 * @param encrypted true if asset should be encrypted.
110 boost::function<std::string (int)> get_path,
111 std::string directory,
112 std::string mxf_name,
113 boost::signals2::signal<void (float)>* progress,
121 MonoPictureAsset (std::string directory, std::string mxf_name, int fps, int entry_point, int length);
123 boost::shared_ptr<const MonoPictureFrame> get_frame (int n) const;
124 bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, std::list<std::string>& notes) const;
127 std::string path_from_list (int f, std::vector<std::string> const & files) const;
128 void construct (boost::function<std::string (int)>);
131 /** A 3D (stereoscopic) picture asset */
132 class StereoPictureAsset : public PictureAsset
135 StereoPictureAsset (std::string directory, std::string mxf_name, int fps, int entry_point, int length);
137 boost::shared_ptr<const StereoPictureFrame> get_frame (int n) const;
138 bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, std::list<std::string>& notes) const;