Remove multi-reel, for now, and sort out Size vs libdcp::Size.
[dcpomatic.git] / src / lib / image.cc
index e136a84697c44eb8464ba94101467d5c83f48103..feda09ec578bb41baeda31f033c7b770d650a45a 100644 (file)
@@ -95,7 +95,7 @@ Image::components () const
 }
 
 shared_ptr<Image>
-Image::scale (Size out_size, Scaler const * scaler, bool aligned) const
+Image::scale (libdcp::Size out_size, Scaler const * scaler, bool aligned) const
 {
        assert (scaler);
 
@@ -124,11 +124,11 @@ Image::scale (Size out_size, Scaler const * scaler, bool aligned) const
  *  @param scaler Scaler to use.
  */
 shared_ptr<Image>
-Image::scale_and_convert_to_rgb (Size out_size, int padding, Scaler const * scaler, bool aligned) const
+Image::scale_and_convert_to_rgb (libdcp::Size out_size, int padding, Scaler const * scaler, bool aligned) const
 {
        assert (scaler);
 
-       Size content_size = out_size;
+       libdcp::Size content_size = out_size;
        content_size.width -= (padding * 2);
 
        shared_ptr<Image> rgb (new SimpleImage (PIX_FMT_RGB24, content_size, aligned));
@@ -215,7 +215,7 @@ Image::post_process (string pp, bool aligned) const
 shared_ptr<Image>
 Image::crop (Crop crop, bool aligned) const
 {
-       Size cropped_size = size ();
+       libdcp::Size cropped_size = size ();
        cropped_size.width -= crop.left + crop.right;
        cropped_size.height -= crop.top + crop.bottom;
 
@@ -368,7 +368,7 @@ Image::bytes_per_pixel (int c) const
  *  @param p Pixel format.
  *  @param s Size in pixels.
  */
-SimpleImage::SimpleImage (AVPixelFormat p, Size s, bool aligned)
+SimpleImage::SimpleImage (AVPixelFormat p, libdcp::Size s, bool aligned)
        : Image (p)
        , _size (s)
        , _aligned (aligned)
@@ -448,26 +448,6 @@ SimpleImage::~SimpleImage ()
        av_free (_stride);
 }
 
-SimpleImage::SimpleImage (shared_ptr<const Image> im, bool aligned)
-       : Image (im->pixel_format())
-{
-       assert (components() == im->components());
-
-       for (int c = 0; c < components(); ++c) {
-
-               assert (line_size()[c] == im->line_size()[c]);
-
-               uint8_t* t = data()[c];
-               uint8_t* o = im->data()[c];
-               
-               for (int y = 0; y < lines(c); ++y) {
-                       memcpy (t, o, line_size()[c]);
-                       t += stride()[c];
-                       o += im->stride()[c];
-               }
-       }
-}
-
 uint8_t **
 SimpleImage::data () const
 {
@@ -486,7 +466,7 @@ SimpleImage::stride () const
        return _stride;
 }
 
-Size
+libdcp::Size
 SimpleImage::size () const
 {
        return _size;
@@ -523,10 +503,10 @@ FilterBufferImage::stride () const
        return _buffer->linesize;
 }
 
-Size
+libdcp::Size
 FilterBufferImage::size () const
 {
-       return Size (_buffer->video->w, _buffer->video->h);
+       return libdcp::Size (_buffer->video->w, _buffer->video->h);
 }
 
 RGBPlusAlphaImage::RGBPlusAlphaImage (shared_ptr<const Image> im)