mirror of https://github.com/SixLabors/ImageSharp
22 changed files with 417 additions and 522 deletions
@ -0,0 +1,31 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
using SixLabors.Memory; |
|||
|
|||
namespace SixLabors.ImageSharp |
|||
{ |
|||
/// <content>
|
|||
/// Contains internal extensions for <see cref="Image{TPixel}"/>
|
|||
/// </content>
|
|||
public static partial class ImageExtensions |
|||
{ |
|||
/// <summary>
|
|||
/// Locks the image providing access to the pixels.
|
|||
/// <remarks>
|
|||
/// It is imperative that the accessor is correctly disposed off after use.
|
|||
/// </remarks>
|
|||
/// </summary>
|
|||
/// <typeparam name="TPixel">The type of the pixel.</typeparam>
|
|||
/// <param name="image">The image.</param>
|
|||
/// <returns>
|
|||
/// The <see cref="Buffer2D{TPixel}" />
|
|||
/// </returns>
|
|||
internal static Buffer2D<TPixel> GetRootFramePixelBuffer<TPixel>(this Image<TPixel> image) |
|||
where TPixel : struct, IPixel<TPixel> |
|||
{ |
|||
return image.Frames.RootFrame.PixelBuffer; |
|||
} |
|||
} |
|||
} |
|||
@ -1,48 +0,0 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using SixLabors.ImageSharp.Advanced; |
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
|
|||
namespace SixLabors.ImageSharp |
|||
{ |
|||
/// <summary>
|
|||
/// Helper methods fro acccess pixel accessors
|
|||
/// </summary>
|
|||
internal static class PixelAccessorExtensions |
|||
{ |
|||
/// <summary>
|
|||
/// Locks the image providing access to the pixels.
|
|||
/// <remarks>
|
|||
/// It is imperative that the accessor is correctly disposed off after use.
|
|||
/// </remarks>
|
|||
/// </summary>
|
|||
/// <typeparam name="TPixel">The type of the pixel.</typeparam>
|
|||
/// <param name="frame">The frame.</param>
|
|||
/// <returns>
|
|||
/// The <see cref="PixelAccessor{TPixel}" />
|
|||
/// </returns>
|
|||
internal static PixelAccessor<TPixel> Lock<TPixel>(this IPixelSource<TPixel> frame) |
|||
where TPixel : struct, IPixel<TPixel> |
|||
{ |
|||
return new PixelAccessor<TPixel>(frame); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Locks the image providing access to the pixels.
|
|||
/// <remarks>
|
|||
/// It is imperative that the accessor is correctly disposed off after use.
|
|||
/// </remarks>
|
|||
/// </summary>
|
|||
/// <typeparam name="TPixel">The type of the pixel.</typeparam>
|
|||
/// <param name="image">The image.</param>
|
|||
/// <returns>
|
|||
/// The <see cref="PixelAccessor{TPixel}" />
|
|||
/// </returns>
|
|||
internal static PixelAccessor<TPixel> Lock<TPixel>(this Image<TPixel> image) |
|||
where TPixel : struct, IPixel<TPixel> |
|||
{ |
|||
return image.Frames.RootFrame.Lock(); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue