|
|
|
@ -23,6 +23,18 @@ namespace SixLabors.ImageSharp.Advanced |
|
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
|
=> GetConfiguration((IConfigurable)source); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the <see cref="Memory{T}"/> storing the whole pixel buffer in row major order.
|
|
|
|
/// </summary>
|
|
|
|
/// <typeparam name="TPixel">The Pixel format.</typeparam>
|
|
|
|
/// <param name="source">The source <see cref="ImageFrame{TPixel}"/></param>
|
|
|
|
/// <returns>The <see cref="Memory{T}"/></returns>
|
|
|
|
public static Memory<TPixel> GetPixelMemory<TPixel>(this ImageFrame<TPixel> source) |
|
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
|
{ |
|
|
|
return source.PixelBuffer.Buffer.Memory; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Returns a reference to the 0th element of the Pixel buffer,
|
|
|
|
/// allowing direct manipulation of pixel data through unsafe operations.
|
|
|
|
|