public RGBA_Doubles(RGBA_Doubles c, double a_) { m_r = c.m_r; m_g = c.m_g; m_b = c.m_b; m_a = a_; }
public RGBA_Bytes(RGBA_Doubles c) { m_R = ((byte)Basics.RoundUint(c.R * (double)ColorConstants.BaseMask)); m_G = ((byte)Basics.RoundUint(c.G * (double)ColorConstants.BaseMask)); m_B = ((byte)Basics.RoundUint(c.B * (double)ColorConstants.BaseMask)); m_A = ((byte)Basics.RoundUint(c.A * (double)ColorConstants.BaseMask)); }
public RasterBufferAccessorClip(IPixelFormat pixf, RGBA_Doubles bk) { m_pixf = pixf; m_PixelWidthInBytes = m_pixf.PixelWidthInBytes; //pixfmt_alpha_blend_bgra32.make_pix(m_bk_buf, bk); unsafe { m_pBackBufferColor = (byte*)Marshal.AllocHGlobal(16); } }
//-------------------------------------------------------------------- public RGBA_Bytes Gradient(RGBA_Bytes c_8, double k) { RGBA_Doubles c = c_8.GetAsRGBA_Doubles(); return(new RGBA_Doubles( R + (c.R - R) * k, G + (c.G - G) * k, B + (c.B - B) * k, A + (c.A - A) * k).GetAsRGBA_Bytes()); //return ret.GetAsRGBA_Bytes(); }
public static RGBA_Doubles GetTweenColor(RGBA_Doubles Color1, RGBA_Doubles Color2, double RatioOf2) { if (RatioOf2 <= 0) { return(new RGBA_Doubles(Color1)); } if (RatioOf2 >= 1.0) { return(new RGBA_Doubles(Color2)); } // figure out how much of each color we should be. double RatioOf1 = 1.0 - RatioOf2; return(new RGBA_Doubles( Color1.R * RatioOf1 + Color2.R * RatioOf2, Color1.G * RatioOf1 + Color2.G * RatioOf2, Color1.B * RatioOf1 + Color2.B * RatioOf2)); }
public static RGBA_Doubles GetTweenColor(RGBA_Doubles Color1, RGBA_Doubles Color2, double RatioOf2) { if (RatioOf2 <= 0) { return new RGBA_Doubles(Color1); } if (RatioOf2 >= 1.0) { return new RGBA_Doubles(Color2); } // figure out how much of each color we should be. double RatioOf1 = 1.0 - RatioOf2; return new RGBA_Doubles( Color1.R * RatioOf1 + Color2.R * RatioOf2, Color1.G * RatioOf1 + Color2.G * RatioOf2, Color1.B * RatioOf1 + Color2.B * RatioOf2); }
public static RGBA_Doubles RgbaPre(RGBA_Doubles c, double a) { return new RGBA_Doubles(c, a).PreMultiply(); }
public static RGBA_Doubles RgbaPre(RGBA_Doubles c) { return new RGBA_Doubles(c).PreMultiply(); }
//-------------------------------------------------------------------- public RGBA_Doubles(RGBA_Doubles c) : this(c, 1) { }
public static RGBA_Doubles RgbaPre(RGBA_Doubles c, double a) { return(new RGBA_Doubles(c, a).PreMultiply()); }