Lines Matching refs:bottom

37 blend_gamma(uint16 b1, uint16 b2, uint16 b3, uint8 ba,	// bottom components
61 blend(uint8 b1, uint8 b2, uint8 b3, uint8 ba, // bottom components
88 blend_colors_copy(uint8* bottom, uint8 alpha, uint8* dest,
93 if (bottom[3] == 0 || alpha == 255) {
99 // only bottom components need to be gamma corrected
100 uint16 gb1 = kGammaTable[bottom[0]];
101 uint16 gb2 = kGammaTable[bottom[1]];
102 uint16 gb3 = kGammaTable[bottom[2]];
104 blend_gamma(gb1, gb2, gb3, bottom[3],
109 *((uint32*)dest) = *((uint32*)bottom);
115 blend_colors(uint8* bottom, uint8 alpha,
120 if (bottom[3] == 0 || alpha == 255) {
121 bottom[0] = c1;
122 bottom[1] = c2;
123 bottom[2] = c3;
124 bottom[3] = alpha;
126 // only bottom components need to be gamma corrected
127 uint16 gb1 = kGammaTable[bottom[0]];
128 uint16 gb2 = kGammaTable[bottom[1]];
129 uint16 gb3 = kGammaTable[bottom[2]];
131 blend_gamma(gb1, gb2, gb3, bottom[3],
133 &bottom[0], &bottom[1], &bottom[2], &bottom[3]);
140 blend_colors_copy(uint8* bottom, uint8 alpha, uint8* dest,
144 if (bottom[3] == 0 || alpha == 255) {
150 blend(bottom[0], bottom[1], bottom[2], bottom[3],
155 *((uint32*)dest) = *((uint32*)bottom);
161 blend_colors(uint8* bottom, uint8 alpha, uint8 c1, uint8 c2, uint8 c3)
164 if (bottom[3] == 0 || alpha == 255) {
165 bottom[0] = c1;
166 bottom[1] = c2;
167 bottom[2] = c3;
168 bottom[3] = alpha;
170 blend(bottom[0], bottom[1], bottom[2], bottom[3],
172 &bottom[0], &bottom[1], &bottom[2], &bottom[3]);
179 blend_colors(uint8* bottom, uint8* source, uint8 alphaOverride)
183 if (bottom[3] == 0 || alpha == 255) {
184 bottom[0] = source[0];
185 bottom[1] = source[1];
186 bottom[2] = source[2];
187 bottom[3] = alpha;
189 blend(bottom[0], bottom[1], bottom[2], bottom[3],
191 &bottom[0], &bottom[1], &bottom[2], &bottom[3]);
198 blend_colors(uint8* bottom, uint8* source)
201 if (bottom[3] == 0 || source[3] == 255) {
202 bottom[0] = source[0];
203 bottom[1] = source[1];
204 bottom[2] = source[2];
205 bottom[3] = source[3];
207 blend(bottom[0], bottom[1], bottom[2], bottom[3],
209 &bottom[0], &bottom[1], &bottom[2], &bottom[3]);
216 blend_colors_copy(uint8* dest, uint8* bottom, uint8* top)
218 if (bottom[3] == 0 || top[3] == 255) {
224 blend(bottom[0], bottom[1], bottom[2], bottom[3],
232 blend_pixels(uint8* bottom, uint8* top, uint8 alpha)
236 bottom[0] = top[0];
237 bottom[1] = top[1];
238 bottom[2] = top[2];
239 bottom[3] = top[3];
245 uint16 b1 = kGammaTable[bottom[0]];
246 uint16 b2 = kGammaTable[bottom[1]];
247 uint16 b3 = kGammaTable[bottom[2]];
249 uint8 mergeAlpha = bottom[3] ? (top[3] * alpha) / 255 : 255;
251 bottom[0] = kInverseGammaTable[(b1 * invAlpha + t1 * mergeAlpha) / 255];
252 bottom[1] = kInverseGammaTable[(b2 * invAlpha + t2 * mergeAlpha) / 255];
253 bottom[2] = kInverseGammaTable[(b3 * invAlpha + t3 * mergeAlpha) / 255];
254 bottom[3] = (bottom[3] * (255 - alpha) + top[3] * alpha) / 255;
261 blend_pixels_copy(uint8* bottom, uint8* top, uint8* dest, uint8 alpha)
274 uint16 b1 = kGammaTable[bottom[0]];
275 uint16 b2 = kGammaTable[bottom[1]];
276 uint16 b3 = kGammaTable[bottom[2]];
278 uint8 mergeAlpha = bottom[3] ? (top[3] * alpha) / 255 : 255;
283 dest[3] = (bottom[3] * (255 - alpha) + top[3] * alpha) / 255;
286 dest[0] = bottom[0];
287 dest[1] = bottom[1];
288 dest[2] = bottom[2];
289 dest[3] = bottom[3];
295 blend_pixels_overlay(uint8* bottom, uint8* top, uint8 alphaOverride)
300 bottom[0] = top[0];
301 bottom[1] = top[1];
302 bottom[2] = top[2];
303 bottom[3] = top[3];
309 uint16 b1 = kGammaTable[bottom[0]];
310 uint16 b2 = kGammaTable[bottom[1]];
311 uint16 b3 = kGammaTable[bottom[2]];
313 uint8 mergeAlpha = bottom[3] ? alpha : 255;
315 bottom[0] = kInverseGammaTable[(b1 * invAlpha + t1 * mergeAlpha) / 255];
316 bottom[1] = kInverseGammaTable[(b2 * invAlpha + t2 * mergeAlpha) / 255];
317 bottom[2] = kInverseGammaTable[(b3 * invAlpha + t3 * mergeAlpha) / 255];
318 bottom[3] = (bottom[3] * (255 - alpha) + top[3] * alpha) / 255;
325 blend_pixels_overlay_copy(uint8* bottom, uint8* top, uint8* dest, uint8 alphaOverride)
339 uint16 b1 = kGammaTable[bottom[0]];
340 uint16 b2 = kGammaTable[bottom[1]];
341 uint16 b3 = kGammaTable[bottom[2]];
343 uint8 mergeAlpha = bottom[3] ? alpha : 255;
348 dest[3] = (bottom[3] * (255 - alpha) + top[3] * alpha) / 255;
351 dest[0] = bottom[0];
352 dest[1] = bottom[1];
353 dest[2] = bottom[2];
354 dest[3] = bottom[3];
363 blend_colors_copy(uint8* bottom, uint8 alpha, uint8* dest,
367 if (bottom[3] == 0 || alpha == 255) {
373 if (bottom[3] == 255) {
375 dest[0] = (uint8)((bottom[0] * destAlpha + c1 * alpha) / 255);
376 dest[1] = (uint8)((bottom[1] * destAlpha + c2 * alpha) / 255);
377 dest[2] = (uint8)((bottom[2] * destAlpha + c3 * alpha) / 255);
381 uint32 alphaTemp = (65025 - alphaRest * (255 - bottom[3]));
382 uint32 alphaDest = bottom[3] * alphaRest;
384 dest[0] = (bottom[0] * alphaDest + c1 * alphaSrc) / alphaTemp;
385 dest[1] = (bottom[1] * alphaDest + c2 * alphaSrc) / alphaTemp;
386 dest[2] = (bottom[2] * alphaDest + c3 * alphaSrc) / alphaTemp;
391 *((uint32*)dest) = *((uint32*)bottom);
397 blend_colors(uint8* bottom, uint8 alpha, uint8 c1, uint8 c2, uint8 c3)
400 if (bottom[3] == 0 || alpha == 255) {
401 bottom[0] = c1;
402 bottom[1] = c2;
403 bottom[2] = c3;
404 bottom[3] = alpha;
406 if (bottom[3] == 255) {
408 bottom[0] = (uint8)((bottom[0] * destAlpha + c1 * alpha) / 255);
409 bottom[1] = (uint8)((bottom[1] * destAlpha + c2 * alpha) / 255);
410 bottom[2] = (uint8)((bottom[2] * destAlpha + c3 * alpha) / 255);
413 uint32 alphaTemp = (65025 - alphaRest * (255 - bottom[3]));
414 uint32 alphaDest = bottom[3] * alphaRest;
416 bottom[0] = (bottom[0] * alphaDest + c1 * alphaSrc) / alphaTemp;
417 bottom[1] = (bottom[1] * alphaDest + c2 * alphaSrc) / alphaTemp;
418 bottom[2] = (bottom[2] * alphaDest + c3 * alphaSrc) / alphaTemp;
419 bottom[3] = alphaTemp / 255;
427 blend_colors(uint8* bottom, uint8* source, uint8 alphaOverride)
431 if (bottom[3] == 0 || alpha == 255) {
432 bottom[0] = source[0];
433 bottom[1] = source[1];
434 bottom[2] = source[2];
435 bottom[3] = alpha;
437 if (bottom[3] == 255) {
439 bottom[0] = (uint8)((bottom[0] * destAlpha + source[0] * alpha) / 255);
440 bottom[1] = (uint8)((bottom[1] * destAlpha + source[1] * alpha) / 255);
441 bottom[2] = (uint8)((bottom[2] * destAlpha + source[2] * alpha) / 255);
444 uint32 alphaTemp = (65025 - alphaRest * (255 - bottom[3]));
445 uint32 alphaDest = bottom[3] * alphaRest;
447 bottom[0] = (bottom[0] * alphaDest + source[0] * alphaSrc) / alphaTemp;
448 bottom[1] = (bottom[1] * alphaDest + source[1] * alphaSrc) / alphaTemp;
449 bottom[2] = (bottom[2] * alphaDest + source[2] * alphaSrc) / alphaTemp;
450 bottom[3] = alphaTemp / 255;
458 blend_colors(uint8* bottom, uint8* source)
461 if (bottom[3] == 0 || source[3] == 255) {
462 bottom[0] = source[0];
463 bottom[1] = source[1];
464 bottom[2] = source[2];
465 bottom[3] = source[3];
467 if (bottom[3] == 255) {
469 bottom[0] = (uint8)((bottom[0] * destAlpha + source[0] * source[3]) / 255);
470 bottom[1] = (uint8)((bottom[1] * destAlpha + source[1] * source[3]) / 255);
471 bottom[2] = (uint8)((bottom[2] * destAlpha + source[2] * source[3]) / 255);
474 uint32 alphaTemp = (65025 - alphaRest * (255 - bottom[3]));
475 uint32 alphaDest = bottom[3] * alphaRest;
477 bottom[0] = (bottom[0] * alphaDest + source[0] * alphaSrc) / alphaTemp;
478 bottom[1] = (bottom[1] * alphaDest + source[1] * alphaSrc) / alphaTemp;
479 bottom[2] = (bottom[2] * alphaDest + source[2] * alphaSrc) / alphaTemp;
480 bottom[3] = alphaTemp / 255;
488 blend_colors_copy(uint8* dest, uint8* bottom, uint8* top)
490 if (bottom[3] == 0 || top[3] == 255) {
496 if (bottom[3] == 255) {
498 dest[0] = (uint8)((bottom[0] * destAlpha + top[0] * top[3]) / 255);
499 dest[1] = (uint8)((bottom[1] * destAlpha + top[1] * top[3]) / 255);
500 dest[2] = (uint8)((bottom[2] * destAlpha + top[2] * top[3]) / 255);
504 uint32 alphaTemp = (65025 - alphaRest * (255 - bottom[3]));
505 uint32 alphaDest = bottom[3] * alphaRest;
507 dest[0] = (bottom[0] * alphaDest + top[0] * alphaSrc) / alphaTemp;
508 dest[1] = (bottom[1] * alphaDest + top[1] * alphaSrc) / alphaTemp;
509 dest[2] = (bottom[2] * alphaDest + top[2] * alphaSrc) / alphaTemp;
517 blend_pixels(uint8* bottom, uint8* top, uint8 alpha)
521 bottom[0] = top[0];
522 bottom[1] = top[1];
523 bottom[2] = top[2];
524 bottom[3] = top[3];
526 uint8 mergeAlpha = bottom[3] ? (top[3] * alpha) / 255 : 255;
528 bottom[0] = (bottom[0] * invAlpha + top[0] * mergeAlpha) / 255;
529 bottom[1] = (bottom[1] * invAlpha + top[1] * mergeAlpha) / 255;
530 bottom[2] = (bottom[2] * invAlpha + top[2] * mergeAlpha) / 255;
531 bottom[3] = (bottom[3] * (255 - alpha) + top[3] * alpha) / 255;
538 blend_pixels_copy(uint8* bottom, uint8* top, uint8* dest, uint8 alpha)
547 uint8 mergeAlpha = bottom[3] ? (top[3] * alpha) / 255 : 255;
549 dest[0] = (bottom[0] * invAlpha + top[0] * mergeAlpha) / 255;
550 dest[1] = (bottom[1] * invAlpha + top[1] * mergeAlpha) / 255;
551 dest[2] = (bottom[2] * invAlpha + top[2] * mergeAlpha) / 255;
552 dest[3] = (bottom[3] * (255 - alpha) + top[3] * alpha) / 255;
555 dest[0] = bottom[0];
556 dest[1] = bottom[1];
557 dest[2] = bottom[2];
558 dest[3] = bottom[3];
564 blend_pixels_overlay(uint8* bottom, uint8* top, uint8 alphaOverride)
569 bottom[0] = top[0];
570 bottom[1] = top[1];
571 bottom[2] = top[2];
572 bottom[3] = top[3];
574 uint8 mergeAlpha = bottom[3] ? alpha : 255;
576 bottom[0] = (bottom[0] * invAlpha + top[0] * mergeAlpha) / 255;
577 bottom[1] = (bottom[1] * invAlpha + top[1] * mergeAlpha) / 255;
578 bottom[2] = (bottom[2] * invAlpha + top[2] * mergeAlpha) / 255;
579 bottom[3] = (bottom[3] * (255 - alpha) + top[3] * alpha) / 255;
586 blend_pixels_overlay_copy(uint8* bottom, uint8* top, uint8* dest, uint8 alphaOverride)
596 uint8 mergeAlpha = bottom[3] ? alpha : 255;
598 dest[0] = (bottom[0] * invAlpha + top[0] * mergeAlpha) / 255;
599 dest[1] = (bottom[1] * invAlpha + top[1] * mergeAlpha) / 255;
600 dest[2] = (bottom[2] * invAlpha + top[2] * mergeAlpha) / 255;
601 dest[3] = (bottom[3] * (255 - alpha) + top[3] * alpha) / 255;
604 dest[0] = bottom[0];
605 dest[1] = bottom[1];
606 dest[2] = bottom[2];
607 dest[3] = bottom[3];