You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Fixed bug in AddImage() method on a frame, to copy the image instead of just pointing to it. This fixed many issues in the FrameMapper as well, which copies images alot.
This commit is contained in:
@@ -420,28 +420,6 @@ int FrameMapper::GetSamplesPerFrame(int frame_number, Fraction rate)
|
||||
return samples_per_frame;
|
||||
}
|
||||
|
||||
// De-interlace a frame
|
||||
tr1::shared_ptr<Frame> FrameMapper::DeInterlaceFrame(tr1::shared_ptr<Frame> frame, bool isOdd)
|
||||
{
|
||||
// Calculate the new size (used to shrink and expand the image, to remove interlacing)
|
||||
Magick::Geometry original_size = frame->GetImage()->size();
|
||||
Magick::Geometry frame_size = frame->GetImage()->size();
|
||||
frame_size.aspect(false); // allow the image to be re-sized to an invalid aspect ratio
|
||||
frame_size.height(frame_size.height() / 2.0); // height set to 50% of original height
|
||||
|
||||
if (isOdd)
|
||||
// Roll the image by 1 pixel, to use the ODD horizontal lines (instead of the even ones)
|
||||
frame->GetImage()->roll(0,1);
|
||||
|
||||
// Resample the image to 50% height (to remove every other line)
|
||||
frame->GetImage()->sample(frame_size);
|
||||
|
||||
// Resize image back to original height
|
||||
frame->GetImage()->resize(original_size);
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
||||
void FrameMapper::PrintMapping()
|
||||
{
|
||||
// Get the difference (in frames) between the original and target frame rates
|
||||
|
||||
Reference in New Issue
Block a user