Browse Source

fix comments

af/merge-core
Scott Williams 9 years ago
parent
commit
b0b9b02d1e
  1. 12
      src/ImageSharp/Common/Memory/BufferPointer{T}.cs

12
src/ImageSharp/Common/Memory/BufferPointer{T}.cs

@ -73,16 +73,16 @@ namespace ImageSharp
/// </summary> /// </summary>
public IntPtr PointerAtOffset { get; private set; } public IntPtr PointerAtOffset { get; private set; }
/// <summary> /// <summary>
/// Gets or sets the pixel at the specified position. /// Gets the element at the specified position.
/// </summary> /// </summary>
/// <param name="x">The x-coordinate of the pixel. Must be greater than or equal to zero and less than the width of the image.</param> /// <param name="index">The index from the start of this Pointer to the required element.</param>
/// <returns>The <see typeparam="TColor"/> at the specified position.</returns> /// <returns>The <see typeparam="T"/> at the specified position.</returns>
public T this[int x] public T this[int index]
{ {
get get
{ {
void* ptr = ((byte*)this.PointerAtOffset) + (x * Unsafe.SizeOf<T>()); byte* ptr = ((byte*)this.PointerAtOffset) + BufferPointer.SizeOf<T>(index);
return Unsafe.Read<T>(ptr); return Unsafe.Read<T>(ptr);
} }
} }

Loading…
Cancel
Save