X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fbluebanana%2Fbluebananacolor.c;h=357518aee8216155a953abded8cff5eece219a47;hb=331564c0ebb30688da917fc1c89058e12771e348;hp=0de216de661580925b992bb469c7782188d7af13;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/plugins/bluebanana/bluebananacolor.c b/cinelerra-5.1/plugins/bluebanana/bluebananacolor.c index 0de216de..357518ae 100644 --- a/cinelerra-5.1/plugins/bluebanana/bluebananacolor.c +++ b/cinelerra-5.1/plugins/bluebanana/bluebananacolor.c @@ -225,6 +225,16 @@ static inline void RGB_to_rgb8(float *R, float *G, float *B, float *S, float F, } } +static inline void Aal_to_alp8(float *S, float F, unsigned char *row, int w, int bpp){ + F = 1.f - F; + while(w--){ + float a = (1 - *S*F)*255.f +.5f; + row[3] = CLAMP(a,0,255); + row+=bpp; ++S; + } +} + + static inline void RGB_to_rgbF(float *R, float *G, float *B, float *S, float F, float *row, int w, int bpp){ if(F>SELECT_THRESH){ if(S){ @@ -264,6 +274,16 @@ static inline void RGB_to_rgbF(float *R, float *G, float *B, float *S, float F, } } +static inline void Aal_to_alpF(float *S, float F, float *row, int w, int bpp){ + F = 1.f - F; + while(w--){ + float a = 1.f - *S*F; + row[3] = a; + row+=bpp; + } +} + + static inline void unmask_rgba8(unsigned char *row,int w){ while(w--){ row[3] = 255;