Made LedBlend_Overwrite more useful
This commit is contained in:
parent
4f293980ed
commit
b3fbae340b
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue