示例#1
0
 public DxtColor565 FromColor(Color c)
 {
     DxtColor565 d = new DxtColor565();
     d.r = From8To5(c.R);
     d.g = From8To6(c.G);
     d.b = From8To5(c.B);
     return d;
 }
示例#2
0
        public DxtColor565 FromColor(Color c)
        {
            DxtColor565 d = new DxtColor565();

            d.r = From8To5(c.R);
            d.g = From8To6(c.G);
            d.b = From8To5(c.B);
            return(d);
        }
示例#3
0
 public static DxtColor565 Read(BinaryReader br)
 {
     short val = br.ReadInt16();
     DxtColor565 color = new DxtColor565();
     color.b = unchecked((byte)((byte)((byte)(val >> 11)) & (byte)0x1f));
     color.g = unchecked((byte)((byte)((byte)(val >> 5)) & (byte)0x3f));
     color.r = (byte)((byte)val & (byte)0x1f);
     return color;
 }
示例#4
0
        public static DxtColor565 Read(BinaryReader br)
        {
            short       val   = br.ReadInt16();
            DxtColor565 color = new DxtColor565();

            color.b = unchecked ((byte)((byte)((byte)(val >> 11)) & (byte)0x1f));
            color.g = unchecked ((byte)((byte)((byte)(val >> 5)) & (byte)0x3f));
            color.r = (byte)((byte)val & (byte)0x1f);
            return(color);
        }