Various libdcp API changes.
authorCarl Hetherington <cth@carlh.net>
Sat, 3 Jan 2015 23:08:27 +0000 (23:08 +0000)
committerCarl Hetherington <cth@carlh.net>
Sat, 3 Jan 2015 23:08:27 +0000 (23:08 +0000)
src/lib/colour_conversion.cc
src/lib/dcp_examiner.cc
src/lib/image.cc
src/lib/image.h
src/lib/j2k_image_proxy.cc
src/lib/render_subtitles.cc
src/lib/subrip_decoder.cc
src/lib/subrip_subtitle.h
src/wx/colour_conversion_editor.cc

index 32bc3c1a5c31c6803ce087883ebb580698e025ef..6b3d3b0f16a5a15c58d8664b3fa9064e54fca67d 100644 (file)
@@ -58,14 +58,15 @@ ColourConversion::ColourConversion (cxml::NodePtr node)
        cxml::ConstNodePtr in_node = node->node_child ("InputTransferFunction");
        string in_type = in_node->string_child ("Type");
        if (in_type == "Gamma") {
-               _in.reset (new dcp::GammaTransferFunction (in_node->number_child<double> ("Gamma")));
+               _in.reset (new dcp::GammaTransferFunction (false, in_node->number_child<double> ("Gamma")));
        } else if (in_type == "ModifiedGamma") {
                _in.reset (new dcp::ModifiedGammaTransferFunction (
-                                 in_node->number_child<double> ("Power"),
-                                 in_node->number_child<double> ("Threshold"),
-                                 in_node->number_child<double> ("A"),
-                                 in_node->number_child<double> ("B")
-                                 ));
+                                  false,
+                                  in_node->number_child<double> ("Power"),
+                                  in_node->number_child<double> ("Threshold"),
+                                  in_node->number_child<double> ("A"),
+                                  in_node->number_child<double> ("B")
+                                  ));
        }
 
        list<cxml::NodePtr> m = node->node_children ("Matrix");
@@ -75,7 +76,7 @@ ColourConversion::ColourConversion (cxml::NodePtr node)
                _matrix(ti, tj) = raw_convert<double> ((*i)->content ());
        }
 
-       _out.reset (new dcp::GammaTransferFunction (node->number_child<double> ("OutputGamma")));
+       _out.reset (new dcp::GammaTransferFunction (true, node->number_child<double> ("OutputGamma")));
 }
 
 boost::optional<ColourConversion>
index 052c8bd76c9b35a827665a4ca92de069a7f4e8cc..de7e9539976c08ff94c7dae4c567b625adb92197 100644 (file)
@@ -117,12 +117,12 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content)
                        shared_ptr<dcp::MonoPictureMXF> mono = dynamic_pointer_cast<dcp::MonoPictureMXF> (mxf);
                        shared_ptr<dcp::StereoPictureMXF> stereo = dynamic_pointer_cast<dcp::StereoPictureMXF> (mxf);
                        
-                       shared_ptr<Image> image (new Image (PIX_FMT_RGB24, _video_size.get(), false));
+                       shared_ptr<Image> image (new Image (PIX_FMT_RGB48LE, _video_size.get(), false));
                        
                        if (mono) {
-                               mono->get_frame(0)->rgb_frame (image->data()[0]);
+                               mono->get_frame(0)->rgb_frame (reinterpret_cast<uint16_t*> (image->data()[0]));
                        } else {
-                               stereo->get_frame(0)->rgb_frame (dcp::EYE_LEFT, image->data()[0]);
+                               stereo->get_frame(0)->rgb_frame (dcp::EYE_LEFT, reinterpret_cast<uint16_t*> (image->data()[0]));
                        }
                        
                }
index 847ad104631c32b3c181d1fe9d41c5f8a7f0084b..ffe9f3e0b5f656eac2b8f5204a718e387922dd23 100644 (file)
@@ -660,7 +660,7 @@ Image::~Image ()
        av_free (_stride);
 }
 
-uint8_t **
+uint8_t * const *
 Image::data () const
 {
        return _data;
@@ -672,7 +672,7 @@ Image::line_size () const
        return _line_size;
 }
 
-int *
+int const *
 Image::stride () const
 {
        return _stride;
index 8ca6aae09b751a05512fd44038694e081ce946b5..22f3f6e502ca6f6775f7c71265220efe9d84d399 100644 (file)
@@ -48,9 +48,9 @@ public:
        Image& operator= (Image const &);
        ~Image ();
        
-       uint8_t ** data () const;
+       uint8_t * const * data () const;
        int * line_size () const;
-       int * stride () const;
+       int const * stride () const;
        dcp::Size size () const;
        bool aligned () const;
 
index 9312a7763ba8e5c959cf48e39cd227de5c686a9f..20bf70cf17eb92eb710905a2aad5250d8502d052 100644 (file)
@@ -76,12 +76,12 @@ J2KImageProxy::J2KImageProxy (shared_ptr<cxml::Node> xml, shared_ptr<Socket> soc
 shared_ptr<Image>
 J2KImageProxy::image () const
 {
-       shared_ptr<Image> image (new Image (PIX_FMT_RGB24, _size, false));
+       shared_ptr<Image> image (new Image (PIX_FMT_RGB48LE, _size, false));
 
        if (_mono) {
-               _mono->rgb_frame (image->data()[0]);
+               _mono->rgb_frame (reinterpret_cast<uint16_t*> (image->data()[0]));
        } else {
-               _stereo->rgb_frame (_eye, image->data()[0]);
+               _stereo->rgb_frame (_eye, reinterpret_cast<uint16_t*> (image->data()[0]));
        }
 
        return shared_ptr<Image> (new Image (image, true));
index b2900d27a8dfdc3e99f0f5fd289b45beb3b56c8e..4ff28df6a7548cbcd4326e3e12ee9bcaf9e23db2 100644 (file)
@@ -119,7 +119,7 @@ render_subtitles (list<dcp::SubtitleString> subtitles, dcp::Size target)
 
                if (i->effect() == dcp::SHADOW) {
                        /* Drop-shadow effect */
-                       dcp::Color const ec = i->effect_color ();
+                       dcp::Colour const ec = i->effect_colour ();
                        context->set_source_rgba (float(ec.r) / 255, float(ec.g) / 255, float(ec.b) / 255, fade_factor);
                        context->move_to (x + 4, y + 4);
                        layout->add_to_cairo_context (context);
@@ -128,7 +128,7 @@ render_subtitles (list<dcp::SubtitleString> subtitles, dcp::Size target)
 
                /* The actual subtitle */
                context->move_to (x, y);
-               dcp::Color const c = i->color ();
+               dcp::Colour const c = i->colour ();
                context->set_source_rgba (float(c.r) / 255, float(c.g) / 255, float(c.b) / 255, fade_factor);
                layout->add_to_cairo_context (context);
                context->fill ();
@@ -136,7 +136,7 @@ render_subtitles (list<dcp::SubtitleString> subtitles, dcp::Size target)
                if (i->effect() == dcp::BORDER) {
                        /* Border effect */
                        context->move_to (x, y);
-                       dcp::Color ec = i->effect_color ();
+                       dcp::Colour ec = i->effect_colour ();
                        context->set_source_rgba (float(ec.r) / 255, float(ec.g) / 255, float(ec.b) / 255, fade_factor);
                        layout->add_to_cairo_context (context);
                        context->stroke ();
index 77c3f16a5f6d9179385da6272bfdb936e614db09..0ef747cf17a44c94d3ddff92e1017af66c0b2612 100644 (file)
@@ -62,7 +62,7 @@ SubRipDecoder::pass ()
                                dcp::SubtitleString (
                                        SubRipContent::font_id,
                                        j->italic,
-                                       dcp::Color (255, 255, 255),
+                                       dcp::Colour (255, 255, 255),
                                        j->font_size.points (72 * 11),
                                        dcp::Time (rint (_subtitles[_next].from.metric().get().all_as_milliseconds() / 4)),
                                        dcp::Time (rint (_subtitles[_next].to.metric().get().all_as_milliseconds() / 4)),
@@ -70,7 +70,7 @@ SubRipDecoder::pass ()
                                        dcp::TOP,
                                        j->text,
                                        dcp::NONE,
-                                       dcp::Color (255, 255, 255),
+                                       dcp::Colour (255, 255, 255),
                                        0,
                                        0
                                        )
index 6fd0bdf74da490cab2fdbc63689e3a6ff35d7c11..d4d27e1400013865653395b0ddf6159cb74c0663 100644 (file)
@@ -37,7 +37,7 @@ struct SubRipSubtitlePiece
        bool bold;
        bool italic;
        bool underline;
-       dcp::Color color;
+       dcp::Colour color;
 };
 
 struct SubRipSubtitle
index e11c09f1761ea18e038a1d2313fda63666eb960c..4658716c6bb091bb500ce1bbf368db965a39fb9c 100644 (file)
@@ -171,6 +171,7 @@ ColourConversionEditor::get () const
                conversion.set_in (
                        shared_ptr<dcp::ModifiedGammaTransferFunction> (
                                new dcp::ModifiedGammaTransferFunction (
+                                       false,
                                        _input_power->GetValue (),
                                        raw_convert<double> (wx_to_std (_input_threshold->GetValue ())),
                                        raw_convert<double> (wx_to_std (_input_A->GetValue ())),
@@ -182,6 +183,7 @@ ColourConversionEditor::get () const
                conversion.set_in (
                        shared_ptr<dcp::GammaTransferFunction> (
                                new dcp::GammaTransferFunction (
+                                       false,
                                        _input_gamma->GetValue ()
                                        )
                                )
@@ -202,7 +204,7 @@ ColourConversionEditor::get () const
 
        conversion.set_matrix (matrix);
 
-       conversion.set_out (shared_ptr<dcp::GammaTransferFunction> (new dcp::GammaTransferFunction (_output_gamma->GetValue ())));
+       conversion.set_out (shared_ptr<dcp::GammaTransferFunction> (new dcp::GammaTransferFunction (true, _output_gamma->GetValue ())));
 
        return conversion;
 }