Flipping alpha channel values. It was brought to my attention that the meaning of alpha was opposite of what was being used. So, sorry if this breaks some things, but better to get it fixed quickly, and for the value to make sense.

This commit is contained in:
Jonathan Thomas
2016-01-16 21:53:07 -06:00
parent c695243a35
commit e2573e8144
3 changed files with 4 additions and 4 deletions

View File

@@ -218,7 +218,7 @@ namespace openshot {
Keyframe location_y; ///< Curve representing the relative Y position in percent based on the gravity (-100 to 100)
// Alpha and Rotation curves
Keyframe alpha; ///< Curve representing the alpha or transparency (0 to 1)
Keyframe alpha; ///< Curve representing the alpha (1 to 0)
Keyframe rotation; ///< Curve representing the rotation (0 to 360)
// Time and Volume curves

View File

@@ -52,7 +52,7 @@ void Clip::init_settings()
location_y = Keyframe(0.0);
// Init alpha & rotation
alpha = Keyframe(0.0);
alpha = Keyframe(1.0);
rotation = Keyframe(0.0);
// Init time & volume

View File

@@ -289,7 +289,7 @@ void Timeline::add_layer(tr1::shared_ptr<Frame> new_frame, Clip* source_clip, lo
int source_height = source_image->height();
/* ALPHA & OPACITY */
if (source_clip->alpha.GetValue(clip_frame_number) != 0)
if (source_clip->alpha.GetValue(clip_frame_number) != 1.0)
{
float alpha = source_clip->alpha.GetValue(clip_frame_number);
@@ -303,7 +303,7 @@ void Timeline::add_layer(tr1::shared_ptr<Frame> new_frame, Clip* source_clip, lo
int A = pixels[byte_index + 3];
// Apply alpha to pixel
pixels[byte_index + 3] *= (1.0 - alpha);
pixels[byte_index + 3] *= alpha;
}
// Debug output