X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fraw_image_proxy.cc;h=1ad78827c51d362ac237e489a9b38bc44b2f6ade;hb=557afd0041173da9d67a850c04b6c8f7ce674860;hp=ac8ff0763d103556b20b649574bad94515171f04;hpb=9bfa07293928c371d59db2091ba2b7e715ce5994;p=dcpomatic.git diff --git a/src/lib/raw_image_proxy.cc b/src/lib/raw_image_proxy.cc index ac8ff0763..1ad78827c 100644 --- a/src/lib/raw_image_proxy.cc +++ b/src/lib/raw_image_proxy.cc @@ -21,16 +21,16 @@ #include "raw_image_proxy.h" #include "image.h" -#include "warnings.h" #include #include +#include #include extern "C" { #include } -DCPOMATIC_DISABLE_WARNINGS +LIBDCP_DISABLE_WARNINGS #include -DCPOMATIC_ENABLE_WARNINGS +LIBDCP_ENABLE_WARNINGS #include "i18n.h" @@ -45,7 +45,7 @@ using boost::optional; using dcp::raw_convert; -RawImageProxy::RawImageProxy (shared_ptr image) +RawImageProxy::RawImageProxy(shared_ptr image) : _image (image) { @@ -58,26 +58,27 @@ RawImageProxy::RawImageProxy (shared_ptr xml, shared_ptr soc xml->number_child("Width"), xml->number_child("Height") ); - _image = make_shared(static_cast(xml->number_child("PixelFormat")), size, true); - _image->read_from_socket (socket); + auto image = make_shared(static_cast(xml->number_child("PixelFormat")), size, Image::Alignment::PADDED); + image->read_from_socket (socket); + _image = image; } ImageProxy::Result -RawImageProxy::image (bool aligned, optional) const +RawImageProxy::image (Image::Alignment alignment, optional) const { - /* This ensure_aligned could be wasteful */ - return Result (Image::ensure_aligned(_image, aligned), 0); + /* This ensure_alignment could be wasteful */ + return Result (Image::ensure_alignment(_image, alignment), 0); } void -RawImageProxy::add_metadata (xmlpp::Node* node) const +RawImageProxy::add_metadata(xmlpp::Element* element) const { - node->add_child("Type")->add_child_text(N_("Raw")); - node->add_child("Width")->add_child_text(raw_convert(_image->size().width)); - node->add_child("Height")->add_child_text(raw_convert(_image->size().height)); - node->add_child("PixelFormat")->add_child_text(raw_convert(static_cast(_image->pixel_format()))); + cxml::add_text_child(element, "Type", N_("Raw")); + cxml::add_text_child(element, "Width", raw_convert(_image->size().width)); + cxml::add_text_child(element, "Height", raw_convert(_image->size().height)); + cxml::add_text_child(element, "PixelFormat", raw_convert(static_cast(_image->pixel_format()))); } @@ -96,7 +97,7 @@ RawImageProxy::same (shared_ptr other) const return false; } - return (*_image.get()) == (*rp->image(_image->aligned()).image.get()); + return (*_image.get()) == (*rp->image(_image->alignment()).image.get()); }