You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user