**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
/* === P R O C E D U R E S ================================================= */
/* === M E T H O D S ======================================================= */
/* === P R O C E D U R E S ================================================= */
/* === M E T H O D S ======================================================= */
// We add COLOR_EPSILON in order to avoid a divide-by-zero condition.
// This causes DIVIDE to bias toward positive values, but the effect is
// really negligible. There is a reason why we use COLOR_EPSILON--we
// We add COLOR_EPSILON in order to avoid a divide-by-zero condition.
// This causes DIVIDE to bias toward positive values, but the effect is
// really negligible. There is a reason why we use COLOR_EPSILON--we
b.set_r(((b.get_r()/(a.get_r()+COLOR_EPSILON))-b.get_r())*(amount)+b.get_r());
b.set_g(((b.get_g()/(a.get_g()+COLOR_EPSILON))-b.get_g())*(amount)+b.get_g());
b.set_r(((b.get_r()/(a.get_r()+COLOR_EPSILON))-b.get_r())*(amount)+b.get_r());
b.set_g(((b.get_g()/(a.get_g()+COLOR_EPSILON))-b.get_g())*(amount)+b.get_g());
a.set_a(a.get_a()*amount);
return blendfunc_COMPOSITE(b,a,1.0);
}
a.set_a(a.get_a()*amount);
return blendfunc_COMPOSITE(b,a,1.0);
}
- if(a.get_a()<b.get_a()*amount)
+ // \todo can this be right, multiplying amount by *b*'s alpha?
+ // compare with blendfunc_BRIGHTEN where it is multiplied by *a*'s
+ if(a.get_a() < b.get_a()*amount)