26 #ifndef __SYNFIG_COLOR_CAIROCOLORBLENDINGFUNCTIONS_H
27 #define __SYNFIG_COLOR_CAIROCOLORBLENDINGFUNCTIONS_H
44 float faa, fab, A, AA;
98 rc= ((ra*aa-rb*ab)*amount + rb*ab)/ac;
99 gc= ((ga*aa-gb*ab)*amount + gb*ab)/ac;
100 bc= ((ba*aa-bb*ab)*amount + bb*ab)/ac;
111 unsigned char alpha(b.
get_a());
141 const float alpha = aa*amount/255.0;
142 const int raab(ra*alpha);
143 const int gaab(ga*alpha);
144 const int baab(ba*alpha);
184 const float alpha=aa*amount/255.0;
186 int rcompare=(ra-255)*alpha+255;
192 int gcompare=(ga-255)*alpha+255;
198 int bcompare=(ba-255)*alpha+255;
227 const float aaa=aa*amount/255.0;
256 const float aaa=aa*amount/255.0;
284 const float aaa=aa*amount/255.0;
298 if(amount<0) a=~a, amount=-amount;
299 amount*=a.
get_a()/255.0;
311 b.
set_r((rb*ra*amount/255.0)+rb*(1.0-amount));
312 b.
set_g((gb*ga*amount/255.0)+gb*(1.0-amount));
313 b.
set_b((bb*ba*amount/255.0)+bb*(1.0-amount));
335 const float alpha=amount*aa/255.0;
336 const float ahpla=1.0-alpha;
345 rc=rb*(alpha*255)/(ra) + ahpla*rb;
350 gc=gb*(alpha*255)/(ga) + ahpla*gb;
355 bc=bb*(alpha*255)/(ba) + ahpla*bb;
405 unsigned char ra, ga, ba, aa;
407 unsigned char rc, gc, bc, ac;
419 float acaa=(aa*amount)/aa;
433 unsigned char ra, ga, ba, aa;
435 unsigned char rc, gc, bc, ac;
447 float acaa=(aa*amount)/aa;
461 if(amount<0) a=~a, amount=-amount;
474 if(amount<0) a=~a, amount=-amount;
476 int ra, ga, ba, aa, ras, gas, bas;
497 rc=(2*rb*ra+ras-2*rb*ras/255.0)/255.0;
498 gc=(2*gb*ga+gas-2*gb*gas/255.0)/255.0;
499 bc=(2*bb*ba+bas-2*bb*bas/255.0)/255.0;
509 if(amount<0) a=~a, amount=-amount;
524 if(ra>127) rc =255 - (255-(ra*2-255)) * (255-rb)/255.0;
525 else rc= rb*(ra*2)/255.0;
526 if(ga>127) gc =255 - (255-(ga*2-255)) * (255-gb)/255.0;
527 else gc= gb*(ga*2)/255.0;
528 if(ba>127) bc =255 - (255-(ba*2-255)) * (255-bb)/255.0;
529 else bc= bb*(ba*2)/255.0;
559 #endif // __SYNFIG_COLOR_CAIROCOLORBLENDINGFUNCTIONS_H