// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; namespace SixLabors.ImageSharp.Processing { internal static class DrawingHelpers { /// /// Convert a to a of the given pixel type. /// public static DenseMatrix ToPixelMatrix(this DenseMatrix colorMatrix, Configuration configuration) where TPixel : struct, IPixel { var result = new DenseMatrix(colorMatrix.Columns, colorMatrix.Rows); Color.ToPixel(configuration, colorMatrix.Span, result.Span); return result; } } }