Initial hack to support 12-bit colour.
authorCarl Hetherington <cth@carlh.net>
Mon, 7 Jul 2014 12:21:42 +0000 (13:21 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 7 Jul 2014 12:21:42 +0000 (13:21 +0100)
src/lib/dcp_video_frame.cc
src/lib/image.cc
src/lib/player_video_frame.cc
src/lib/player_video_frame.h
src/wx/film_viewer.cc

index 09b909696f2fcbb89a028d295b66d843d37cff9e..c8f8c3cc5a019e607172bcb0aaccb2475d914cf2 100644 (file)
@@ -127,7 +127,7 @@ DCPVideoFrame::encode_locally ()
        }
 
        shared_ptr<libdcp::XYZFrame> xyz = libdcp::rgb_to_xyz (
-               _frame->image(),
+               _frame->image(AV_PIX_FMT_RGB48BE),
                in_lut,
                libdcp::GammaLUT::cache.get (16, 1 / _frame->colour_conversion().output_gamma),
                matrix
index f340637dc7ebf2d515983fe6921de162045e9afa..1c6c02979ca122d0034baf192db6b501ba99878a 100644 (file)
@@ -320,6 +320,8 @@ Image::make_black ()
        case PIX_FMT_ABGR:
        case PIX_FMT_BGRA:
        case PIX_FMT_RGB555LE:
+       case PIX_FMT_RGB48LE:
+       case PIX_FMT_RGB48BE:
                memset (data()[0], 0, lines(0) * stride()[0]);
                break;
 
index 94760e495ce95b5ce0c284b5c5d2f8a4492e24c5..63ddc637b2fd60eb9ebac578479cbc83b8c1572f 100644 (file)
@@ -84,7 +84,7 @@ PlayerVideoFrame::set_subtitle (shared_ptr<const Image> image, Position<int> pos
 }
 
 shared_ptr<Image>
-PlayerVideoFrame::image () const
+PlayerVideoFrame::image (AVPixelFormat pixel_format) const
 {
        shared_ptr<Image> im = _in->image ();
        
@@ -106,7 +106,7 @@ PlayerVideoFrame::image () const
                break;
        }
                
-       shared_ptr<Image> out = im->crop_scale_window (total_crop, _inter_size, _out_size, _scaler, PIX_FMT_RGB24, false);
+       shared_ptr<Image> out = im->crop_scale_window (total_crop, _inter_size, _out_size, _scaler, pixel_format, false);
 
        Position<int> const container_offset ((_out_size.width - _inter_size.width) / 2, (_out_size.height - _inter_size.width) / 2);
 
index b085cb609e659f59b55f6a709c88b046c2a6a078..6a6868292076b8e83ebaac110b46c1b763ccdbf4 100644 (file)
@@ -18,6 +18,9 @@
 */
 
 #include <boost/shared_ptr.hpp>
+extern "C" {
+#include <libavutil/pixfmt.h>
+}
 #include "types.h"
 #include "position.h"
 #include "colour_conversion.h"
@@ -40,7 +43,7 @@ public:
 
        void set_subtitle (boost::shared_ptr<const Image>, Position<int>);
        
-       boost::shared_ptr<Image> image () const;
+       boost::shared_ptr<Image> image (AVPixelFormat) const;
 
        void add_metadata (xmlpp::Node* node) const;
        void send_binary (boost::shared_ptr<Socket> socket) const;
index ed1a2ce4109293b3d932be8fabacb2bc4477878b..112736b679867252e08b7c1b9db8ccd404b43e67 100644 (file)
@@ -295,7 +295,7 @@ FilmViewer::process_video (shared_ptr<PlayerVideoFrame> pvf, Time t)
                return;
        }
        
-       _frame = pvf->image ();
+       _frame = pvf->image (PIX_FMT_RGB24);
        _got_frame = true;
 
        set_position_text (t);