Added a new ImageReader class, which uses ImageMagick++ to read image files, and produce openshot::Frame objects.

This commit is contained in:
Jonathan Thomas
2012-08-29 15:29:15 -05:00
parent 8831dd0c49
commit b3cf902f22
9 changed files with 175 additions and 3 deletions

View File

@@ -458,13 +458,30 @@ void Frame::Save(string path, float scale)
void Frame::AddImage(int width, int height, const string map, const Magick::StorageType type, const void *pixels)
{
// Deallocate image memory
delete image;
image = NULL;
if (image)
{
delete image;
image = NULL;
}
// Create new image object, and fill with pixel data
image = new Magick::Image(width, height, map, type, pixels);
}
// Add (or replace) pixel data to the frame
void Frame::AddImage(Magick::Image* new_image)
{
// Deallocate image memory
if (image)
{
delete image;
image = NULL;
}
// assign image data
image = new_image;
}
// Add audio samples to a specific channel
void Frame::AddAudio(int destChannel, int destStartSample, const float* source, int numSamples, float gainToApplyToSource = 1.0f)
{