public RGBA_Bytes(RGBA_Doubles c) { m_R = ((byte)Basics.RoundUint(c.m_r * (double)BaseMask)); m_G = ((byte)Basics.RoundUint(c.m_g * (double)BaseMask)); m_B = ((byte)Basics.RoundUint(c.m_b * (double)BaseMask)); m_A = ((byte)Basics.RoundUint(c.m_a * (double)BaseMask)); }
//-------------------------------------------------------------------- RGBA_Bytes(RGBA_Doubles c, double a_) { m_R = ((byte)Basics.RoundUint(c.m_r * (double)BaseMask)); m_G = ((byte)Basics.RoundUint(c.m_g * (double)BaseMask)); m_B = ((byte)Basics.RoundUint(c.m_b * (double)BaseMask)); m_A = ((byte)Basics.RoundUint(a_ * (double)BaseMask)); }
//-------------------------------------------------------------------- public RGBA_Bytes(double r_, double g_, double b_) { m_R = ((byte)Basics.RoundUint(r_ * (double)BaseMask)); m_G = ((byte)Basics.RoundUint(g_ * (double)BaseMask)); m_B = ((byte)Basics.RoundUint(b_ * (double)BaseMask)); m_A = (byte)BaseMask; }
public override void ToPix(ref RGBA_Bytes c) { //c.R = (Byte)Basics.RoundUint(R); //c.G = (Byte)Basics.RoundUint(G); //c.B = (Byte)Basics.RoundUint(B); c = new RGBA_Bytes( (Byte)Basics.RoundUint(R), (Byte)Basics.RoundUint(G), (Byte)Basics.RoundUint(B)); }
//-------------------------------------------------------------------- public RGBA_Bytes Gradient(RGBA_Bytes c, double k) { RGBA_Bytes ret = new RGBA_Bytes(); uint ik = Basics.RoundUint(k * BaseScale); ret.R_Byte = (byte)((uint)(R_Byte) + ((((uint)(c.R_Byte) - R_Byte) * ik) >> BaseShift)); ret.G_Byte = (byte)((uint)(G_Byte) + ((((uint)(c.G_Byte) - G_Byte) * ik) >> BaseShift)); ret.B_Byte = (byte)((uint)(B_Byte) + ((((uint)(c.B_Byte) - B_Byte) * ik) >> BaseShift)); ret.A_Byte = (byte)((uint)(A_Byte) + ((((uint)(c.A_Byte) - A_Byte) * ik) >> BaseShift)); return(ret); }
public override void ToPix(ref RGBA_Bytes c) { c = new RGBA_Bytes((Byte)Basics.RoundUint(R), c.G, c.B, c.A); //c.R = (Byte)Basics.RoundUint(R); }