示例#1
0
 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));
 }
示例#2
0
 //--------------------------------------------------------------------
 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));
 }
示例#3
0
 //--------------------------------------------------------------------
 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;
 }
示例#4
0
 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));
 }
示例#5
0
        //--------------------------------------------------------------------
        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);
        }
示例#6
0
 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);
 }