Browse Source

Added optimized ImageFrame implementation.

af/merge-core
dirk 9 years ago
committed by Dirk Lemstra
parent
commit
2816693f0b
  1. 6
      src/ImageSharp/Image.cs
  2. 46
      src/ImageSharp/ImageFrame.cs

6
src/ImageSharp/Image.cs

@ -61,5 +61,11 @@ namespace ImageSharp
{
return new PixelAccessor(this);
}
/// <inheritdoc />
internal override ImageFrame<Color, uint> ToFrame()
{
return new ImageFrame(this);
}
}
}

46
src/ImageSharp/ImageFrame.cs

@ -0,0 +1,46 @@
// <copyright file="Image.cs" company="James Jackson-South">
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp
{
using System.Diagnostics;
/// <summary>
/// An optimized frame for the <see cref="Image"/> class.
/// </summary>
[DebuggerDisplay("ImageFrame: {Width}x{Height}")]
public class ImageFrame : ImageFrame<Color, uint>
{
/// <summary>
/// Initializes a new instance of the <see cref="ImageFrame"/> class.
/// </summary>
public ImageFrame()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ImageFrame"/> class.
/// </summary>
/// <param name="image">
/// The image to create the frame from.
/// </param>
public ImageFrame(ImageBase<Color, uint> image)
: base(image)
{
}
/// <inheritdoc />
public override PixelAccessor<Color, uint> Lock()
{
return new PixelAccessor(this);
}
/// <inheritdoc />
internal override ImageFrame<Color, uint> ToFrame()
{
return new ImageFrame(this);
}
}
}
Loading…
Cancel
Save