Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ PreMultiplyAlpha()

static unsafe void ReLogic.Content.Readers.PngReader.PreMultiplyAlpha ( IntPtr img,
int len )
inlinestaticprivate

Definition at line 64 of file PngReader.cs.

65 {
66 byte* colors = (byte*)img.ToPointer();
67 for (int i = 0; i < len; i += 4)
68 {
69 int a = colors[i + 3];
70 colors[i] = (byte)(colors[i] * a / 255);
71 colors[i + 1] = (byte)(colors[i + 1] * a / 255);
72 colors[i + 2] = (byte)(colors[i + 2] * a / 255);
73 }
74 }
unsafe void * ToPointer()
Definition IntPtr.cs:210

References System.len, and System.IntPtr.ToPointer().

Referenced by ReLogic.Content.Readers.PngReader.FromStream< T >().