Example #1
0
            public RGB Calculate(double x, double y)
            {
                var distance   = Math.Abs(lineY - y);
                var multiplier = (radius - distance) / radius;

                var rgb = lightSource.Calculate(x, lineY);

                return(rgb * multiplier);
            }
Example #2
0
        public RGB Get(float x, float y, long ms)
        {
            var start = previous.Calculate(x, y);
            var end   = lightSource.Calculate(x, y);

            var percentage = totalMs == 0 || ms > totalMs
                ? 1
                : ms / totalMs;

            return(new RGB(
                       start.R + (end.R - start.R) * percentage,
                       start.G + (end.G - start.G) * percentage,
                       start.B + (end.B - start.B) * percentage));
        }
Example #3
0
        public RGB Calculate(double x, double y)
        {
            var radians = CalculateRadians(x - centerX, y - centerY);

            if (radians < radiansStart && (radiansEnd < TWO_PI || radians + TWO_PI > radiansEnd))
            {
                return(RGB.Black);
            }

            if (radians > radiansEnd)
            {
                return(RGB.Black);
            }

            return(baseLightSource.Calculate(x, y));
        }
Example #4
0
 public RGB Get(float x, float y, long ms)
 {
     return(lightSource.Calculate(
                x - xMovement * (ms / totalMs),
                y - yMovement * (ms / totalMs)));
 }