PixelMagic.Texture.ReadColor C# (CSharp) Method

ReadColor() public method

public ReadColor ( int x, int y ) : Mono.Simd.Vector4f
x int
y int
return Mono.Simd.Vector4f
        public Vector4f ReadColor(int x, int y)
        {
            uint p = Read (x, y);
            //float r = (p & 0xFF) / 255f;
            //float b = ((p >> 16) & 0xFF) / 255f;

            float b = (p & 0xFF) / 255f;
            float g = ((p >> 8) & 0xFF) / 255f;
            float r = ((p >> 16) & 0xFF) / 255f;
            float a = ((p >> 24) & 0xFF) / 255f;

            Vector4f color = new Vector4f (r, g, b, a);
            if (Tracing.Enabled) Console.WriteLine ("read color [{0}, {1}] = {2:X}  / {3}", x, y, p, color);
            return color;
        }