Merge master.
[dcpomatic.git] / src / lib / dcp_video.h
1 /*
2     Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
3
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.
8
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.
13
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.
17
18 */
19
20 extern "C" {
21 #include <libavutil/avutil.h>
22 }
23 #include <boost/shared_ptr.hpp>
24 #include "types.h"
25 #include "colour_conversion.h"
26 #include "position.h"
27 #include "position_image.h"
28
29 class Image;
30 class Scaler;
31
32 /** @class DCPVideo
33  *
34  *  A ContentVideo image with:
35  *     - content parameters (crop, scaling, colour conversion)
36  *     - merged content (subtitles)
37  *  and with its time converted from a ContentTime to a DCPTime.
38  */
39 class DCPVideo
40 {
41 public:
42         DCPVideo (boost::shared_ptr<const Image>, Eyes eyes, Crop, dcp::Size, dcp::Size, Scaler const *, ColourConversion conversion, DCPTime time);
43
44         void set_subtitle (PositionImage);
45         boost::shared_ptr<Image> image (AVPixelFormat, bool) const;
46
47         Eyes eyes () const {
48                 return _eyes;
49         }
50
51         ColourConversion conversion () const {
52                 return _conversion;
53         }
54
55 private:
56         boost::shared_ptr<const Image> _in;
57         Eyes _eyes;
58         Crop _crop;
59         dcp::Size _inter_size;
60         dcp::Size _out_size;
61         Scaler const * _scaler;
62         ColourConversion _conversion;
63         DCPTime _time;
64         PositionImage _subtitle;
65 };