Made LedBlend_Overwrite more useful

This commit is contained in:
PS 2021-04-09 12:14:00 -10:00
parent 4f293980ed
commit b3fbae340b
1 changed files with 10 additions and 1 deletions

View File

@ -8,13 +8,22 @@
internal pixel internal pixel
LedBlend_Overwrite(pixel PixelA, pixel PixelB, u8* UserData) LedBlend_Overwrite(pixel PixelA, pixel PixelB, u8* UserData)
{ {
r32 MagB = (r32)(PixelB.R + PixelB.G + PixelB.B) / (255 * 3);
pixel Result = {};
Result.R = (u8)LerpR32(MagB, PixelA.R, PixelB.R);
Result.G = (u8)LerpR32(MagB, PixelA.G, PixelB.G);
Result.B = (u8)LerpR32(MagB, PixelA.B, PixelB.B);
#if 0
pixel Result = PixelB; pixel Result = PixelB;
if (PixelB.R == 0 && if (PixelB.R == 0 &&
PixelB.G == 0 && PixelB.G == 0 &&
PixelB.G == 0) PixelB.B == 0)
{ {
Result = PixelA; Result = PixelA;
} }
#endif
return Result; return Result;
} }