Lines Matching refs:s

243 typedef uint8_t(*SwMask)(uint8_t s, uint8_t d, uint8_t a);                  //src, dst, alpha
244 typedef uint32_t(*SwBlender)(uint32_t s, uint32_t d, uint8_t a); //src, dst, alpha
311 static inline uint32_t INTERPOLATE(uint32_t s, uint32_t d, uint8_t a) in INTERPOLATE() argument
313 …return (((((((s >> 8) & 0xff00ff) - ((d >> 8) & 0xff00ff)) * a) + (d & 0xff00ff00)) & 0xff00ff00) … in INTERPOLATE()
316 static inline uint8_t INTERPOLATE8(uint8_t s, uint8_t d, uint8_t a) in INTERPOLATE8() argument
318 return (((s) * (a) + 0xff) >> 8) + (((d) * ~(a) + 0xff) >> 8); in INTERPOLATE8()
351 static inline uint32_t opBlendInterp(uint32_t s, uint32_t d, uint8_t a) in opBlendInterp() argument
353 return INTERPOLATE(s, d, a); in opBlendInterp()
356 static inline uint32_t opBlendNormal(uint32_t s, uint32_t d, uint8_t a) in opBlendNormal() argument
358 auto t = ALPHA_BLEND(s, a); in opBlendNormal()
362 static inline uint32_t opBlendPreNormal(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) in opBlendPreNormal() argument
364 return s + ALPHA_BLEND(d, IA(s)); in opBlendPreNormal()
367 static inline uint32_t opBlendSrcOver(uint32_t s, TVG_UNUSED uint32_t d, TVG_UNUSED uint8_t a) in opBlendSrcOver() argument
369 return s; in opBlendSrcOver()
373 static inline uint32_t opBlendDifference(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) in opBlendDifference() argument
377 auto c1 = (C1(s) > C1(d)) ? (C1(s) - C1(d)) : (C1(d) - C1(s)); in opBlendDifference()
378 auto c2 = (C2(s) > C2(d)) ? (C2(s) - C2(d)) : (C2(d) - C2(s)); in opBlendDifference()
379 auto c3 = (C3(s) > C3(d)) ? (C3(s) - C3(d)) : (C3(d) - C3(s)); in opBlendDifference()
383 static inline uint32_t opBlendExclusion(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) in opBlendExclusion() argument
386 auto c1 = std::min(255, C1(s) + C1(d) - std::min(255, (C1(s) * C1(d)) << 1)); in opBlendExclusion()
387 auto c2 = std::min(255, C2(s) + C2(d) - std::min(255, (C2(s) * C2(d)) << 1)); in opBlendExclusion()
388 auto c3 = std::min(255, C3(s) + C3(d) - std::min(255, (C3(s) * C3(d)) << 1)); in opBlendExclusion()
392 static inline uint32_t opBlendAdd(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) in opBlendAdd() argument
395 auto c1 = std::min(C1(s) + C1(d), 255); in opBlendAdd()
396 auto c2 = std::min(C2(s) + C2(d), 255); in opBlendAdd()
397 auto c3 = std::min(C3(s) + C3(d), 255); in opBlendAdd()
401 static inline uint32_t opBlendScreen(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) in opBlendScreen() argument
404 auto c1 = C1(s) + C1(d) - MULTIPLY(C1(s), C1(d)); in opBlendScreen()
405 auto c2 = C2(s) + C2(d) - MULTIPLY(C2(s), C2(d)); in opBlendScreen()
406 auto c3 = C3(s) + C3(d) - MULTIPLY(C3(s), C3(d)); in opBlendScreen()
410 static inline uint32_t opBlendMultiply(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) in opBlendMultiply() argument
413 auto c1 = MULTIPLY(C1(s), C1(d)); in opBlendMultiply()
414 auto c2 = MULTIPLY(C2(s), C2(d)); in opBlendMultiply()
415 auto c3 = MULTIPLY(C3(s), C3(d)); in opBlendMultiply()
419 static inline uint32_t opBlendOverlay(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) in opBlendOverlay() argument
423 … (C1(d) < 128) ? std::min(255, 2 * MULTIPLY(C1(s), C1(d))) : (255 - std::min(255, 2 * MULTIPLY(255… in opBlendOverlay()
424 … (C2(d) < 128) ? std::min(255, 2 * MULTIPLY(C2(s), C2(d))) : (255 - std::min(255, 2 * MULTIPLY(255… in opBlendOverlay()
425 … (C3(d) < 128) ? std::min(255, 2 * MULTIPLY(C3(s), C3(d))) : (255 - std::min(255, 2 * MULTIPLY(255… in opBlendOverlay()
429 static inline uint32_t opBlendDarken(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) in opBlendDarken() argument
432 auto c1 = std::min(C1(s), C1(d)); in opBlendDarken()
433 auto c2 = std::min(C2(s), C2(d)); in opBlendDarken()
434 auto c3 = std::min(C3(s), C3(d)); in opBlendDarken()
438 static inline uint32_t opBlendLighten(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) in opBlendLighten() argument
441 auto c1 = std::max(C1(s), C1(d)); in opBlendLighten()
442 auto c2 = std::max(C2(s), C2(d)); in opBlendLighten()
443 auto c3 = std::max(C3(s), C3(d)); in opBlendLighten()
447 static inline uint32_t opBlendColorDodge(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) in opBlendColorDodge() argument
450 auto is = 0xffffffff - s; in opBlendColorDodge()
457 static inline uint32_t opBlendColorBurn(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) in opBlendColorBurn() argument
461 auto c1 = 255 - ((C1(s) > 0) ? (C1(id) / C1(s)) : C1(id)); in opBlendColorBurn()
462 auto c2 = 255 - ((C2(s) > 0) ? (C2(id) / C2(s)) : C2(id)); in opBlendColorBurn()
463 auto c3 = 255 - ((C3(s) > 0) ? (C3(id) / C3(s)) : C3(id)); in opBlendColorBurn()
467 static inline uint32_t opBlendHardLight(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) in opBlendHardLight() argument
469 …auto c1 = (C1(s) < 128) ? std::min(255, 2 * MULTIPLY(C1(s), C1(d))) : (255 - std::min(255, 2 * MUL… in opBlendHardLight()
470 …auto c2 = (C2(s) < 128) ? std::min(255, 2 * MULTIPLY(C2(s), C2(d))) : (255 - std::min(255, 2 * MUL… in opBlendHardLight()
471 …auto c3 = (C3(s) < 128) ? std::min(255, 2 * MULTIPLY(C3(s), C3(d))) : (255 - std::min(255, 2 * MUL… in opBlendHardLight()
475 static inline uint32_t opBlendSoftLight(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) in opBlendSoftLight() argument
478 …= std::min(255, MULTIPLY(255 - std::min(255, 2 * C1(s)), MULTIPLY(C1(d), C1(d))) + 2 * MULTIPLY(C1… in opBlendSoftLight()
479 …= std::min(255, MULTIPLY(255 - std::min(255, 2 * C2(s)), MULTIPLY(C2(d), C2(d))) + 2 * MULTIPLY(C2… in opBlendSoftLight()
480 …= std::min(255, MULTIPLY(255 - std::min(255, 2 * C3(s)), MULTIPLY(C3(d), C3(d))) + 2 * MULTIPLY(C3… in opBlendSoftLight()