* @param s Size in pixels.
*/
Image::Image (AVPixelFormat p, libdcp::Size s, bool aligned)
- : _pixel_format (p)
- , _size (s)
+ : libdcp::Image (s)
+ , _pixel_format (p)
, _aligned (aligned)
{
allocate ();
}
Image::Image (Image const & other)
- : _pixel_format (other._pixel_format)
- , _size (other._size)
+ : libdcp::Image (other)
+ , _pixel_format (other._pixel_format)
, _aligned (other._aligned)
{
allocate ();
}
Image::Image (AVFrame* frame)
- : _pixel_format (static_cast<AVPixelFormat> (frame->format))
- , _size (frame->width, frame->height)
+ : libdcp::Image (libdcp::Size (frame->width, frame->height))
+ , _pixel_format (static_cast<AVPixelFormat> (frame->format))
, _aligned (true)
{
allocate ();
}
Image::Image (shared_ptr<const Image> other, bool aligned)
- : _pixel_format (other->_pixel_format)
- , _size (other->size())
+ : libdcp::Image (other)
+ , _pixel_format (other->_pixel_format)
, _aligned (aligned)
{
allocate ();
void
Image::swap (Image & other)
{
+ libdcp::Image::swap (other);
+
std::swap (_pixel_format, other._pixel_format);
- std::swap (_size, other._size);
for (int i = 0; i < 4; ++i) {
std::swap (_data[i], other._data[i]);