You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Added a new ImageReader class, which uses ImageMagick++ to read image files, and produce openshot::Frame objects.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user