return s;
}
+int
+ImageMagickDecoder::video_length () const
+{
+ return _imagemagick_content->video_length ();
+}
+
bool
ImageMagickDecoder::pass ()
{
- if (_position > 0 && _position < _imagemagick_content->video_length ()) {
- repeat_last_video ();
+ if (_position < 0 || _position >= _imagemagick_content->video_length ()) {
+ return true;
+ }
+
+ if (_image) {
+ emit_video (_image, true, double (_position) / 24);
_position++;
return false;
- } else if (_position >= _imagemagick_content->video_length ()) {
- return true;
}
Magick::Image* magick_image = new Magick::Image (_imagemagick_content->file().string ());
libdcp::Size size = native_size ();
- shared_ptr<Image> image (new SimpleImage (PIX_FMT_RGB24, size, false));
+ _image.reset (new SimpleImage (PIX_FMT_RGB24, size, false));
using namespace MagickCore;
- uint8_t* p = image->data()[0];
+ uint8_t* p = _image->data()[0];
for (int y = 0; y < size.height; ++y) {
for (int x = 0; x < size.width; ++x) {
Magick::Color c = magick_image->pixelColor (x, y);
delete magick_image;
- image = image->crop (_film->crop(), true);
-
- emit_video (image, 0);
+ _image = _image->crop (_film->crop(), true);
+ emit_video (_image, false, double (_position) / 24);
++_position;
return false;
return PIX_FMT_RGB24;
}
-bool
-ImageMagickDecoder::seek_to_last ()
-{
- if (_position > 0) {
- --_position;
- }
-
- return false;
-}
-
bool
ImageMagickDecoder::seek (double t)
{
_position = f;
return false;
}
-
-void
-ImageMagickDecoder::film_changed (Film::Property p)
-{
- if (p == Film::CROP) {
- OutputChanged ();
- }
-}