CSharpImageLibrary.DDS.DDS_BlockHelpers.BuildDXTColour C# (CSharp) Method

BuildDXTColour() private static method

Creates a packed DXT colour from RGB.
private static BuildDXTColour ( byte r, byte g, byte b ) : int
r byte Red byte.
g byte Green byte.
b byte Blue byte.
return int
        private static int BuildDXTColour(byte r, byte g, byte b)
        {
            // Compress to 5:6:5
            byte r1 = (byte)(r >> 3);
            byte g1 = (byte)(g >> 2);
            byte b1 = (byte)(b >> 3);

            return (r1 << 11) | (g1 << 5) | (b1);
        }