Browse Source

Rename ColorPixelAccessor to PixelAccessor

Keeps it consistant with the Image Image<TColor, TPacked> classes
af/merge-core
James Jackson-South 9 years ago
parent
commit
b5809228f9
  1. 6
      README.md
  2. 2
      src/ImageSharp/Image.cs
  3. 10
      src/ImageSharp/PixelAccessor.cs

6
README.md

@ -1,5 +1,5 @@
# <img src="build/icons/imagesharp-logo-64.png" width="32" height="32"/> ImageSharp
# <img src="build/icons/imagesharp-logo-64.png" width="48" height="48"/> ImageSharp
**ImageSharp** is a new cross-platform 2D graphics API designed to allow the processing of images without the use of `System.Drawing`.
@ -168,13 +168,13 @@ Setting individual pixel values is perfomed as follows:
```csharp
Image image = new Image(400, 400);
using (PixelAccessor<Color, uint> pixels = image.Lock())
using (PixelAccessor pixels = image.Lock())
{
pixels[200, 200] = Color.White;
}
```
For advanced usage the `Image<TColor, TPacked>` class is available allowing developers to implement their own color models in the same manner as Microsoft XNA Game Studio and MonoGame.
For advanced usage the `Image<TColor, TPacked>` and `PixelAccessor<TColor, TPacked>` classes are available allowing developers to implement their own color models in the same manner as Microsoft XNA Game Studio and MonoGame.
All in all this should allow image processing to be much more accessible to developers which has always been my goal from the start.

2
src/ImageSharp/Image.cs

@ -60,7 +60,7 @@ namespace ImageSharp
/// <inheritdoc />
public override PixelAccessor<Color, uint> Lock()
{
return new ColorPixelAccessor(this);
return new PixelAccessor(this);
}
}
}

10
src/ImageSharp/Colors/ColorPixelAccessor.cs → src/ImageSharp/PixelAccessor.cs

@ -1,4 +1,4 @@
// <copyright file="ColorPixelAccessor.cs" company="James Jackson-South">
// <copyright file="PixelAccessor.cs" company="James Jackson-South">
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
@ -11,13 +11,13 @@ namespace ImageSharp
/// <summary>
/// An optimized pixel accessor for the <see cref="Image"/> class.
/// </summary>
public sealed unsafe class ColorPixelAccessor : PixelAccessor<Color, uint>
public sealed unsafe class PixelAccessor : PixelAccessor<Color, uint>
{
/// <summary>
/// Initializes a new instance of the <see cref="ColorPixelAccessor"/> class.
/// Initializes a new instance of the <see cref="PixelAccessor"/> class.
/// </summary>
/// <param name="image">The image to provide pixel access for.</param>
public ColorPixelAccessor(ImageBase<Color, uint> image)
public PixelAccessor(ImageBase<Color, uint> image)
: base(image)
{
}
@ -106,4 +106,4 @@ namespace ImageSharp
}
}
}
}
}
Loading…
Cancel
Save