Hi Joey
> I have an AVI file which I am reading in PERL. I wish to do a
> composite of the first x many frames and do that for the rest of the
> AVI file until I've gone through the whole thing.
> My questions is how do I take a slice of the array images such that I
> have n many frames to put together?
I have just switched from ActivePerl (compiled with MS VC++) to Strawberry
Perl (compiled with gcc), so PerlMagick is no longer available to me :-(.
What this means is that the following code is off the top of my head - I
have certainly not tested it!
Image::Magick creates objects of type Image::Magick as array refs. So this
code:
my($image) = Image::Magick -> new();
my($status) = $image -> Read('1.png', '2.png', '3.png'); # Or AVI etc.
populates $image as an array ref. Getting n images just requires
understanding @$image is an array of images, so:
my($n) = 2;
my($subset) = @$image[0 .. ($n - 1)];
populates $subset as an array ref of the first n images out of $image.
Hence:
my($next_subset) = @$image[1 .. $n];
my($another_subset) = @$image[2 .. ($n + 1)];
and so on show how to get any contiguous subset.
--
Ron Savage
[EMAIL PROTECTED]
http://savage.net.au/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users