コード例 #1
0
 public double[,] ToU()
 {
     double[,] u = new double[Width, Height];
     for (int i = 0; i < Width; i++)
     {
         for (int j = 0; j < Height; j++)
         {
             u[i, j] = ColorSpaceConversion.RgbToU(R[i, j], G[i, j], B[i, j]);
         }
     }
     return(u);
 }
コード例 #2
0
        public YuvData(RgbData rgb)
        {
            Y = new double[rgb.Width, rgb.Height];
            U = new double[rgb.Width, rgb.Height];
            V = new double[rgb.Width, rgb.Height];

            for (int i = 0; i < rgb.Width; i++)
            {
                for (int j = 0; j < rgb.Height; j++)
                {
                    Y[i, j] = ColorSpaceConversion.RgbToY(rgb.R[i, j], rgb.G[i, j], rgb.B[i, j]);//red green blue
                    U[i, j] = ColorSpaceConversion.RgbToU(rgb.R[i, j], rgb.G[i, j], rgb.B[i, j]);
                    V[i, j] = ColorSpaceConversion.RgbToV(rgb.R[i, j], rgb.G[i, j], rgb.B[i, j]);
                }
            }
        }