|
|
|
@ -17,6 +17,8 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
public partial class PixelOperations<TPixel> |
|
|
|
where TPixel : unmanaged, IPixel<TPixel> |
|
|
|
{ |
|
|
|
private static readonly Lazy<PixelTypeInfo> LazyInfo = new Lazy<PixelTypeInfo>(() => PixelTypeInfo.Create<TPixel>(), true); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the global <see cref="PixelOperations{TPixel}"/> instance for the pixel type <typeparamref name="TPixel"/>
|
|
|
|
/// </summary>
|
|
|
|
@ -26,7 +28,7 @@ namespace SixLabors.ImageSharp.PixelFormats |
|
|
|
/// Gets the pixel type info for the given <typeparamref name="TPixel"/>.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The <see cref="PixelTypeInfo"/>.</returns>
|
|
|
|
public virtual PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<TPixel>(); |
|
|
|
public virtual PixelTypeInfo GetPixelTypeInfo() => LazyInfo.Value; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Bulk version of <see cref="IPixel.FromVector4"/> converting 'sourceVectors.Length' pixels into 'destinationColors'.
|
|
|
|
|