You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Fixed a regression with audio files and seeking, added a few new methods, and more accurately detect the End() of clips.
This commit is contained in:
@@ -106,6 +106,9 @@ void Frame::DeepCopy(const Frame& other)
|
||||
pixel_ratio = Fraction(other.pixel_ratio.num, other.pixel_ratio.den);
|
||||
sample_rate = other.sample_rate;
|
||||
channels = other.channels;
|
||||
|
||||
if (other.wave_image)
|
||||
wave_image = new Magick::Image(*(other.wave_image));
|
||||
}
|
||||
|
||||
// Deallocate image and audio memory
|
||||
@@ -116,6 +119,8 @@ void Frame::DeletePointers()
|
||||
image = NULL;
|
||||
delete audio;
|
||||
audio = NULL;
|
||||
delete wave_image;
|
||||
wave_image = NULL;
|
||||
}
|
||||
|
||||
// Display the frame image to the screen (primarily used for debugging reasons)
|
||||
@@ -272,7 +277,7 @@ const Magick::PixelPacket* Frame::GetWaveformPixels(int width, int height)
|
||||
void Frame::DisplayWaveform()
|
||||
{
|
||||
// Get audio wave form image
|
||||
Magick::Image *wave_image = GetWaveform(720, 480);
|
||||
GetWaveform(720, 480);
|
||||
|
||||
// Display Image
|
||||
wave_image->display();
|
||||
@@ -385,24 +390,6 @@ const Magick::PixelPacket* Frame::GetPixels(int row)
|
||||
return image->getConstPixels(0,row, image->columns(), 1);
|
||||
}
|
||||
|
||||
// Get pixel data (for a resized image)
|
||||
const Magick::PixelPacket* Frame::GetPixels(unsigned int width, unsigned int height, int frame)
|
||||
{
|
||||
// Create a new resized image
|
||||
//Magick::Image newImage = *image;
|
||||
small_image = new Magick::Image(*(image));
|
||||
small_image->resize(Magick::Geometry(width, height));
|
||||
small_image->colorize(255, 0, 0, Magick::Color(0,0,255));
|
||||
small_image->blur(5.0, 5.0);
|
||||
|
||||
// stringstream file;
|
||||
// file << "frame" << frame << ".png";
|
||||
// small_image->write(file.str());
|
||||
|
||||
// Return arry of pixel packets
|
||||
return small_image->getConstPixels(0,0, small_image->columns(), small_image->rows());
|
||||
}
|
||||
|
||||
// Set Pixel Aspect Ratio
|
||||
void Frame::SetPixelRatio(int num, int den)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user