2 Copyright (C) 2015 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 DCPOMATIC_JPEG2000_ENCODER_H
21 #define DCPOMATIC_JPEG2000_ENCODER_H
25 #include <dcp/types.h>
26 #include <boost/shared_ptr.hpp>
27 #include <boost/optional.hpp>
37 virtual ~JPEG2000Encoder () {}
39 /** @return Internationalised descriptive name for this encoder */
40 virtual std::string name () const = 0;
41 /** @return Non-internationalised ID for this encoder */
42 virtual std::string id () const = 0;
44 /** @param input XYZ input frame.
45 * @param note_handler Handler for notes about the encode.
47 * @return Encoded JPEG2000 data.
50 boost::shared_ptr<const dcp::OpenJPEGImage> input,
53 Resolution resolution,
57 static void setup_encoders ();
58 /** @return Return all available JPEG2000 encoders in order of preference (best first) */
59 static std::vector<boost::shared_ptr<JPEG2000Encoder> > all ();
60 static boost::shared_ptr<JPEG2000Encoder> from_id (std::string id);
64 virtual Data do_encode (
65 boost::shared_ptr<const dcp::OpenJPEGImage> input
68 virtual void parameters_changed () {}
70 boost::optional<int> _bandwidth;
71 boost::optional<int> _frame_rate;
72 boost::optional<Resolution> _resolution;
73 boost::optional<bool> _threed;
75 static std::vector<boost::shared_ptr<JPEG2000Encoder> > _encoders;