#include "raw_image_proxy.h"
#include "image.h"
-#include "warnings.h"
#include <dcp/raw_convert.h>
#include <dcp/util.h>
+#include <dcp/warnings.h>
#include <libcxml/cxml.h>
extern "C" {
#include <libavutil/pixfmt.h>
}
-DCPOMATIC_DISABLE_WARNINGS
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
#include "i18n.h"
using dcp::raw_convert;
-RawImageProxy::RawImageProxy (shared_ptr<Image> image)
+RawImageProxy::RawImageProxy(shared_ptr<const Image> image)
: _image (image)
{
xml->number_child<int>("Width"), xml->number_child<int>("Height")
);
- _image = make_shared<Image>(static_cast<AVPixelFormat>(xml->number_child<int>("PixelFormat")), size, true);
- _image->read_from_socket (socket);
+ auto image = make_shared<Image>(static_cast<AVPixelFormat>(xml->number_child<int>("PixelFormat")), size, Image::Alignment::PADDED);
+ image->read_from_socket (socket);
+ _image = image;
}
ImageProxy::Result
-RawImageProxy::image (optional<dcp::Size>) const
+RawImageProxy::image (Image::Alignment alignment, optional<dcp::Size>) const
{
- return Result (_image, 0);
+ /* This ensure_alignment could be wasteful */
+ return Result (Image::ensure_alignment(_image, alignment), 0);
}
return false;
}
- return (*_image.get()) == (*rp->image().image.get());
+ return (*_image.get()) == (*rp->image(_image->alignment()).image.get());
}