public RGBModel[,] convertToRGB(CIEModel[,] matrix) { RGBModel[,] RGBImage = new RGBModel[imageModel.getWidth(), imageModel.getHeight()]; for (int x = 0; x < imageModel.getWidth(); x++) { for (int y = 0; y < imageModel.getHeight(); y++) { // Get the color of a pixel within myBitmap. RGBImage[x, y] = CIEController.XYZtoRGB(matrix[x, y].X, matrix[x, y].Y, matrix[x, y].Z); } } return(RGBImage); }
public CIEModel[,] setCIEImage(Bitmap image) { CIEModel[,] CIEImage = new CIEModel[image.Width, image.Height]; for (int x = 0; x < image.Width; x++) { for (int y = 0; y < image.Height; y++) { // Get the color of a pixel within myBitmap. Color pixelColor = image.GetPixel(x, y); int r = (int)pixelColor.R; int g = (int)pixelColor.G; int b = (int)pixelColor.B; CIEImage[x, y] = CIEController.RGBtoXYZ(r, g, b); } } return(CIEImage); }