public static YCbCrPixel[,] Merge(ImageBlock y, ImageBlock cb, ImageBlock cr) { var pixels = new YCbCrPixel[y.Width, y.Height]; for (var i = 0; i < y.Width; i++) { for (var j = 0; j < y.Height; j++) { pixels[i, j] = new YCbCrPixel(y.Data[i, j], cb.Data[i, j], cr.Data[i, j]); } } return(pixels); }
public static YCbCrPixel[,] toYCCMatrix(RGBPixel[,] source) { int rows = source.GetLength(0); int columns = source.GetLength(1); YCbCrPixel[,] result = new YCbCrPixel[rows, columns]; for (int i = 0; i < rows; i++) { for (int j = 0; j < columns; j++) { result[i, j] = source[i, j].ToYCC(); } } return(result); }