Exemplo n.º 1
0
        public override PointColor Transform(PointColor input)
        {
            input.X = input.X + (RandomNumberProvider.GetDouble() * _maxAmount);
            input.Y = input.Y + (RandomNumberProvider.GetDouble() * _maxAmount);

            return(input);
        }
Exemplo n.º 2
0
        public override PointColor Transform(PointColor input)
        {
            input.X = input.X + _moveX;
            input.Y = input.Y + _moveY;

            return(input);
        }
        public override PointColor Transform(PointColor input)
        {
            input.X = input.X / _amount;
            input.Y = input.Y / _amount;

            return(input);
        }
Exemplo n.º 4
0
        public override PointColor Transform(PointColor input)
        {
            input.Color = new DoubleColor(input.Color.R * _amount, input.Color.G, input.Color.B, input.Color.A);
            input.Color.NormalizeRGB();

            return(input);
        }
        public override PointColor Transform(PointColor input)
        {
            double newAlpha = (RandomNumberProvider.GetDouble() * (_maxValue - _minValue)) + _minValue;

            input.Color = new DoubleColor(input.Color.R, input.Color.G, input.Color.B, newAlpha);

            return(input);
        }
Exemplo n.º 6
0
        public override PointColor Transform(PointColor input)
        {
            double inX = input.X - 0.5;
            double inY = input.Y - 0.5;

            double outX = inX * (inY * _amount);

            input.X = outX + 0.5;
            input.Y = inY + 0.5;

            return(input);
        }
Exemplo n.º 7
0
        public override PointColor Transform(PointColor input)
        {
            double inX = input.X;
            double inY = input.Y;

            double outY = inY + Math.Sin(inX * _amount) * 0.5;

            input.X = inX;
            input.Y = outY;

            return(input);
        }
Exemplo n.º 8
0
        public Color GetColorFromPointInverse(int x, int y)
        {
            var pc = new PointColor((Convert.ToDouble(x) / _width), (Convert.ToDouble(y) / _height), new DoubleColor());

            for (int i = _transforms.Count; i > 0; i--)
            {
                pc = _transforms[i - 1].Transform(pc);
            }

            pc.Color.A = 1.0;

            return(pc.Color.ToColor());
        }
Exemplo n.º 9
0
        public Color GetColorFromPointColor(PointColor pc)
        {
            pc.Color = new DoubleColor();

            for (int i = 0; i < _transforms.Count; i++)
            {
                pc = _transforms[i].Transform(pc);
            }

            pc.Color.A = 1.0;

            return(pc.Color.ToColor());
        }
Exemplo n.º 10
0
        public override PointColor Transform(PointColor input)
        {
            double inX = input.X - 0.5;
            double inY = input.Y - 0.5;

            double outX = inX * Math.Cos(_amount) - inY * Math.Sin(_amount);
            double outY = inX * Math.Sin(_amount) + inY * Math.Cos(_amount);

            input.X = outX + 0.5;
            input.Y = outY + 0.5;

            return(input);
        }
Exemplo n.º 11
0
        public override PointColor Transform(PointColor input)
        {
            var inY = input.Y;

            inY = inY % 1.0;
            inY = Math.Abs(inY);

            var outColor = _gradient.GetColorAtValue(inY);

            input.Color = outColor;

            return(input);
        }
Exemplo n.º 12
0
        public override PointColor Transform(PointColor input)
        {
            double inX = input.X - 0.5;
            double inY = input.Y - 0.5;

            double dist = Math.Sqrt(Math.Pow(inX, 2.0) + Math.Pow(inY, 2.0));
            double outX = inX + (inX * Math.Sin(dist * _amount));
            double outY = inY + (inY * Math.Sin(dist * _amount));

            input.X = outX + 0.5;
            input.Y = outY + 0.5;

            return(input);
        }
Exemplo n.º 13
0
        public override PointColor Transform(PointColor input)
        {
            double inX = input.X;

            if (inX < 0)
            {
                inX = -inX + _stripeWidth;
            }

            if (inX % (_stripeWidth * 2) < _stripeWidth)
            {
                input.Color = DoubleColor.Combine(input.Color, _stripeColor);
            }

            return(input);
        }
Exemplo n.º 14
0
        public override PointColor Transform(PointColor input)
        {
            double inX = input.X;
            double inY = input.Y;

            double xOffset = inX % _zigAmount;

            if (xOffset > (_zigAmount / 2))
            {
                xOffset = _zigAmount - xOffset;
            }
            double outY = inY + xOffset;

            input.Y = outY;

            return(input);
        }
Exemplo n.º 15
0
        public override PointColor Transform(PointColor input)
        {
            double inX = input.X - 0.5;
            double inY = input.Y - 0.5;

            double amount = (Math.Sqrt(Math.Pow(inX, 2.0) + Math.Pow(inY, 2.0))) * (2 * Math.PI);

            amount = amount * _amountMultiplier;

            double outX = inX * Math.Cos(amount) - inY * Math.Sin(amount);
            double outY = inX * Math.Sin(amount) + inY * Math.Cos(amount);

            input.X = outX + 0.5;
            input.Y = outY + 0.5;

            return(input);
        }
Exemplo n.º 16
0
        public override PointColor Transform(PointColor input)
        {
            var inX = input.X - 0.5;
            var inY = input.Y - 0.5;

            inX = inX % 1.0;
            inY = inY % 1.0;

            var dist = Math.Sqrt(Math.Pow(inX, 2.0) + Math.Pow(inY, 2.0));

            if (dist < _circleRadius)
            {
                input.Color = DoubleColor.Combine(input.Color, _circleColor);
            }

            return(input);
        }
Exemplo n.º 17
0
        public override PointColor Transform(PointColor input)
        {
            double inX = input.X;
            double inY = input.Y;

            double yOffset = inY % _zigAmount;

            if (yOffset > (_zigAmount / 2))
            {
                yOffset = _zigAmount - yOffset;
            }
            double outX = inX + yOffset;

            input.X = outX;

            return(input);
        }
Exemplo n.º 18
0
        public override PointColor Transform(PointColor input)
        {
            double inX = input.X - 0.5;
            double inY = input.Y - 0.5;

            inX = inX % 1.0;
            inY = inY % 1.0;

            double dist = Math.Sqrt(Math.Pow(inX - _originX, 2.0) + Math.Pow(inY - _originY, 2.0));

            dist = dist % 1.0;

            var outColor = _gradient.GetColorAtValue(dist);

            input.Color = outColor;

            return(input);
        }
        public override PointColor Transform(PointColor input)
        {
            double tempOriginX = RandomNumberProvider.GetDouble() * _originX;
            double tempOriginY = RandomNumberProvider.GetDouble() * _originY;

            double inX = input.X - 0.5;
            double inY = input.Y - 0.5;

            inX = inX % 1.0;
            inY = inY % 1.0;

            double dist = Math.Sqrt(Math.Pow(inX - tempOriginX, 2.0) + Math.Pow(inY - tempOriginY, 2.0));

            dist = dist % 1.0;

            var outColor = _gradient.GetColorAtValue(dist);

            input.Color = outColor;

            return(input);
        }
Exemplo n.º 20
0
        public override PointColor Transform(PointColor input)
        {
            var inX = input.X;

            inX = inX % 1.0;
            var greyVal = inX * 256.0;

            if (greyVal < 0.0)
            {
                greyVal = 0;
            }
            ;
            if (greyVal > 1.0)
            {
                greyVal = 1.0;
            }
            ;

            input.Color = new DoubleColor(greyVal, greyVal, greyVal, _alpha);

            return(input);
        }
Exemplo n.º 21
0
        public Color GetColorFromPointAntiAlias(int x, int y)
        {
            // Let's grab 3 colors, 120 degrees away from the center point, and average the values.
            double xDouble = Convert.ToDouble(x);
            double yDouble = Convert.ToDouble(y);

            List <Color> colors = new List <Color>();

            for (int i = 0; i < NUMBER_OF_AA_POINTS; i++)
            {
                PointColor pc = new PointColor();

                pc.X = xDouble + (RandomNumberProvider.GetDouble() - 0.5);
                pc.Y = yDouble + (RandomNumberProvider.GetDouble() - 0.5);

                Color c = GetColorFromPointColor(pc);

                colors.Add(c);
            }

            int aTotal = 0;
            int rTotal = 0;
            int gTotal = 0;
            int bTotal = 0;

            for (int j = 0; j < NUMBER_OF_AA_POINTS; j++)
            {
                aTotal += colors[j].A;
                rTotal += colors[j].R;
                gTotal += colors[j].G;
                bTotal += colors[j].B;
            }

            Color result = Color.FromArgb(aTotal / NUMBER_OF_AA_POINTS, rTotal / NUMBER_OF_AA_POINTS, gTotal / NUMBER_OF_AA_POINTS, bTotal / NUMBER_OF_AA_POINTS);

            return(result);
        }
Exemplo n.º 22
0
 public virtual PointColor Transform(PointColor input)
 {
     return(input);
 }
Exemplo n.º 23
0
        public override PointColor Transform(PointColor input)
        {
            input.X = input.X + (input.Y * _amount);

            return(input);
        }
Exemplo n.º 24
0
        public Color GetColorFromPoint(int x, int y)
        {
            var pc = new PointColor((Convert.ToDouble(x) / _width), (Convert.ToDouble(y) / _height), new DoubleColor());

            return(GetColorFromPointColor(pc));
        }