Пример #1
0
 ///<summary>
 ///Copies data by value from paintSource to this rpaint
 ///</summary>
 public void Set(RPaint paintSource)
 {
     //return SetArgb(paintSource.A,paintSource.R,paintSource.G,paintSource.B);
     RMemory.CopyFastVoid(ref paintSource.data32, ref data32);
     RMemory.CopyFastVoid(ref paintSource.data32Copied64, ref data32Copied64);
     RMemory.CopyFastVoid(ref paintSource.data24Copied48, ref data24Copied48);
 }
Пример #2
0
        public static RPaint From(Color color)
        {
            RPaint paintReturn = new RPaint();

            paintReturn.Set(color);
            return(paintReturn);
        }
Пример #3
0
        public static RPaint FromArgbRatio(double a, double r, double g, double b)
        {
            RPaint paintReturn = new RPaint(false);

            paintReturn.SetArgbRatio(a, r, g, b);
            return(paintReturn);
        }
Пример #4
0
        public static RPaint FromArgbRatio(float a, float r, float g, float b)
        {
            RPaint paintReturn = new RPaint(false);

            paintReturn.SetArgbRatio(a, r, g, b);
            return(paintReturn);
        }
Пример #5
0
        public static RPaint FromRgb(byte r, byte g, byte b)
        {
            RPaint paintReturn = new RPaint(false);

            paintReturn.SetArgb(255, r, g, b);
            return(paintReturn);
        }
Пример #6
0
        public RPaint Copy()
        {
            RPaint paintReturn = new RPaint();

            paintReturn.SetArgb(A, R, G, B);
            return(paintReturn);
        }
Пример #7
0
 public static void Multiply(ref RPaint rpaintOut, RPaint paintSource, double multiplier)
 {
     if (rpaintOut == null)
     {
         rpaintOut = new RPaint();
     }
     rpaintOut.SetArgb(paintSource.A, RMath.ByRound((double)paintSource.R * multiplier), RMath.ByRound((double)paintSource.G * multiplier), RMath.ByRound((double)paintSource.B * multiplier));
 }
Пример #8
0
        /// <summary>
        /// Multiplies everything EXCEPT a by multiplier then returns a resulting rpaint object
        /// </summary>
        /// <param name="paintReturn">Set to paintSource, or argb(0,0,0,0) if paintSource is null</param>
        /// <param name="paintSource">source</param>
        /// <param name="multiplier"></param>
        /// <returns></returns>
        public static bool From(ref RPaint paintReturn, RPaint paintSource, double multiplier)
        {
            bool bGood = true;

            if (paintReturn == null)
            {
                paintReturn = new RPaint(false);
            }
            if (paintSource != null)
            {
                paintReturn.SetArgb(paintSource.A, RMath.ByRound((double)paintSource.R * multiplier), RMath.ByRound((double)paintSource.G * multiplier), RMath.ByRound((double)paintSource.B * multiplier));
            }
            else
            {
                bGood = false;
                paintReturn.SetArgb(0, 0, 0, 0);             //if source is null set dest to 0s
            }
            return(bGood);
        }
Пример #9
0
 public bool Set(RPaint paintSource, double multiplier)
 {
     return(SetArgb(paintSource.A, RMath.ByRound((double)paintSource.R * multiplier), RMath.ByRound((double)paintSource.G * multiplier), RMath.ByRound((double)paintSource.B * multiplier)));
 }