// Copyright (c) Six Labors. // Licensed under the Six Labors Split License. using SixLabors.ImageSharp.PixelFormats; namespace SixLabors.ImageSharp.Drawing.Processing { internal static class DrawingHelpers { /// /// Convert a to a of the given pixel type. /// /// The type of pixel format. /// The color matrix. public static DenseMatrix ToPixelMatrix(this DenseMatrix colorMatrix) where TPixel : unmanaged, IPixel { DenseMatrix result = new(colorMatrix.Columns, colorMatrix.Rows); Color.ToPixel(colorMatrix.Span, result.Span); return result; } } }