示例#1
0
 public void Clear(Color c)
 {
     for (int i = 0; i < Buffer.Count; i++)
     {
         Buffer[i] = c;
     }
 }
示例#2
0
 // TODO Pattern class that can be created w/ a lambda and used in place of a color
 public void Clear(byte R = 0, byte G = 0, byte B = 0, byte A = 255)
 {
     for (int i = 0; i < Buffer.Count; i++)
     {
         Buffer[i] = new Color(R, G, B, A);
     }
 }
示例#3
0
        public void DrawSegment(int startPixel, Color color, int length)
        {
            for (int i = startPixel; i < startPixel + length; i++)
            {
                if (i >= Buffer.Count) // TODO: Or should it wrap?
                    return;

                Buffer[i] = color;
            }
        }
示例#4
0
        public override PixelBuffer Render()
        {
            buffer.WholeBufferTransparency = 0;
            buffer.ZIndex = 0;

            x += 1;
            for (int i = 0; i < pixelcount; i++)
                buffer[i] = new Color((byte)(i + x / 3), (byte)x, (byte)((i + x) / 4));
            return buffer;
        }
示例#5
0
        public PixelBuffer CompositeBuffers(List<PixelBuffer> buffers)
        {
            var pixelCount = buffers.First().Buffer.Count;
            var resultBuffer = new PixelBuffer(pixelCount);
            for (int pixel = 0; pixel < pixelCount; pixel++)
            {
                Color compositeColor = new Color(0, 0, 0, 0);

                // TODO: Order buffers by ZIndex
                for (int i = 0; i < buffers.Count(); i++)
                {
                    compositeColor.Mix(buffers[i][pixel], buffers[i].WholeBufferTransparency);
                }
                resultBuffer[pixel] = compositeColor;
            }
            return resultBuffer;
        }
示例#6
0
 public FlatColorRenderer(Color c)
 {
     this.c = c;
 }
示例#7
0
 public override void SetPixel(int pixelNum, Color c)
 {
     sim.SetPixel(pixelNum, c);
 }
示例#8
0
 public void DrawPoint(int pixel, Color color)
 {
     Buffer[pixel] = color;
 }