Beispiel #1
0
        public void SwitchColors(PixelParameter pixelParameter)
        {
            byte temp = Blue;

            if (pixelParameter.SwitchGreenAndBlue)
            {
                temp  = Blue;
                Blue  = Green;
                Green = temp;
                return;
            }

            if (pixelParameter.SwitchRedAndBlue)
            {
                temp = Blue;
                Blue = Red;
                Red  = temp;
                return;
            }

            if (pixelParameter.SwitchGreenAndRed)
            {
                temp  = Green;
                Green = Red;
                Red   = temp;
                return;
            }
        }
 public static void ChangePixelColor(PixelParameter pixelParam)
 {
     PixelColor[,] pixels = new PixelColor[CurrentState.pixelsBeforeColorEnhancing.GetLength(0), CurrentState.pixelsBeforeColorEnhancing.GetLength(1)];
     Array.Copy(CurrentState.pixelsBeforeColorEnhancing, pixels, pixels.Length);
     for (int i = 0; i < pixels.GetLength(0); i++)
     {
         for (int j = 0; j < pixels.GetLength(1); j++)
         {
             pixels[i, j].ChangeColors(pixelParam);
             pixels[i, j].SwitchColors(pixelParam);
         }
     }
     CurrentState.currentPixels = pixels;
     CurrentState.image.Source  = MyImageTools.WritePixelsToBitmap();
 }
Beispiel #3
0
 public void ChangeColors(PixelParameter pixelParam)
 {
     Blue  = GetColorValue((byte)pixelParam.Blue, Blue);
     Green = GetColorValue((byte)pixelParam.Green, Green);
     Red   = GetColorValue((byte)pixelParam.Red, Red);
 }