コード例 #1
0
        private static double[,,] processImage(double[,,] arrayImage, Action <ColorCustom> pixelAction)
        {
            double[,,] res = (double[, , ])arrayImage.Clone();

            int width  = arrayImage.GetLength(2),
                height = arrayImage.GetLength(1);

            ColorCustom c = new ColorCustom();

            for (int h = 0; h < height; h++)
            {
                for (int w = 0; w < width; w++)
                {
                    c.r = res[0, h, w];
                    c.g = res[1, h, w];
                    c.b = res[2, h, w];


                    pixelAction(c);

                    res[0, h, w] = c.r;
                    res[1, h, w] = c.g;
                    res[2, h, w] = c.b;
                }
            }

            return(res);
        }
コード例 #2
0
        public static ColorCustom GetRandomColor()
        {
            ColorCustom color = new ColorCustom();

            color.r = random.Next(256);
            color.g = random.Next(256);
            color.b = random.Next(256);

            return(color);
        }