The timeline classes are finally working correctly, and have the following features:

1) Layers (unlimited # of layers)
2) IN, OUT, and Position (time)
3) X, Y offset
4) Alpha
5) Rotation
6) Transparency + compositing + overlays
This commit is contained in:
Jonathan Thomas
2012-11-08 04:35:21 -06:00
parent 42d7565ba1
commit 5b77abdf27
8 changed files with 82 additions and 53 deletions

View File

@@ -430,6 +430,9 @@ void Frame::AddColor(int width, int height, string color)
// Create new image object, and fill with pixel data
image = tr1::shared_ptr<Magick::Image>(new Magick::Image(Magick::Geometry(width, height), Magick::Color(color)));
// Give image a transparent background color
image->backgroundColor(Magick::Color("none"));
// Update height and width
width = image->columns();
height = image->rows();
@@ -441,6 +444,9 @@ void Frame::AddImage(int width, int height, const string map, const Magick::Stor
// Create new image object, and fill with pixel data
image = tr1::shared_ptr<Magick::Image>(new Magick::Image(width, height, map, type, pixels));
// Give image a transparent background color
image->backgroundColor(Magick::Color("none"));
// Update height and width
width = image->columns();
height = image->rows();
@@ -520,6 +526,10 @@ void Frame::AddImage(tr1::shared_ptr<Magick::Image> new_image, float alpha)
// Add audio samples to a specific channel
void Frame::AddAudio(int destChannel, int destStartSample, const float* source, int numSamples, float gainToApplyToSource = 1.0f)
{
// Extend audio buffer (if needed)
if (destStartSample + numSamples > audio->getNumSamples())
audio->setSize(audio->getNumChannels(), destStartSample + numSamples, true, true, false);
// Always clear the range of samples first
audio->clear(destChannel, destStartSample, numSamples);