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; }
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); }
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; }
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); }