diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-01-03 23:08:27 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-01-03 23:08:27 +0000 |
| commit | a5095486e606adfe36de635a48710cf98872c1c6 (patch) | |
| tree | cf7a17cb48a258473fde05593653a759ad81f633 /src/lib | |
| parent | 4a291fd1e78c3307d6dffbbadf1bd005ed5a430b (diff) | |
Various libdcp API changes.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/colour_conversion.cc | 15 | ||||
| -rw-r--r-- | src/lib/dcp_examiner.cc | 6 | ||||
| -rw-r--r-- | src/lib/image.cc | 4 | ||||
| -rw-r--r-- | src/lib/image.h | 4 | ||||
| -rw-r--r-- | src/lib/j2k_image_proxy.cc | 6 | ||||
| -rw-r--r-- | src/lib/render_subtitles.cc | 6 | ||||
| -rw-r--r-- | src/lib/subrip_decoder.cc | 4 | ||||
| -rw-r--r-- | src/lib/subrip_subtitle.h | 2 |
8 files changed, 24 insertions, 23 deletions
diff --git a/src/lib/colour_conversion.cc b/src/lib/colour_conversion.cc index 32bc3c1a5..6b3d3b0f1 100644 --- a/src/lib/colour_conversion.cc +++ b/src/lib/colour_conversion.cc @@ -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> diff --git a/src/lib/dcp_examiner.cc b/src/lib/dcp_examiner.cc index 052c8bd76..de7e95399 100644 --- a/src/lib/dcp_examiner.cc +++ b/src/lib/dcp_examiner.cc @@ -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])); } } diff --git a/src/lib/image.cc b/src/lib/image.cc index 847ad1046..ffe9f3e0b 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -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; diff --git a/src/lib/image.h b/src/lib/image.h index 8ca6aae09..22f3f6e50 100644 --- a/src/lib/image.h +++ b/src/lib/image.h @@ -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; diff --git a/src/lib/j2k_image_proxy.cc b/src/lib/j2k_image_proxy.cc index 9312a7763..20bf70cf1 100644 --- a/src/lib/j2k_image_proxy.cc +++ b/src/lib/j2k_image_proxy.cc @@ -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)); diff --git a/src/lib/render_subtitles.cc b/src/lib/render_subtitles.cc index b2900d27a..4ff28df6a 100644 --- a/src/lib/render_subtitles.cc +++ b/src/lib/render_subtitles.cc @@ -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 (); diff --git a/src/lib/subrip_decoder.cc b/src/lib/subrip_decoder.cc index 77c3f16a5..0ef747cf1 100644 --- a/src/lib/subrip_decoder.cc +++ b/src/lib/subrip_decoder.cc @@ -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 ) diff --git a/src/lib/subrip_subtitle.h b/src/lib/subrip_subtitle.h index 6fd0bdf74..d4d27e140 100644 --- a/src/lib/subrip_subtitle.h +++ b/src/lib/subrip_subtitle.h @@ -37,7 +37,7 @@ struct SubRipSubtitlePiece bool bold; bool italic; bool underline; - dcp::Color color; + dcp::Colour color; }; struct SubRipSubtitle |
