diff --git a/src/ImageSharp/Common/Memory/BufferPointer{T}.cs b/src/ImageSharp/Common/Memory/BufferPointer{T}.cs index 167731e369..0673efae06 100644 --- a/src/ImageSharp/Common/Memory/BufferPointer{T}.cs +++ b/src/ImageSharp/Common/Memory/BufferPointer{T}.cs @@ -73,16 +73,16 @@ namespace ImageSharp /// public IntPtr PointerAtOffset { get; private set; } - /// - /// Gets or sets the pixel at the specified position. + /// + /// Gets the element at the specified position. /// - /// The x-coordinate of the pixel. Must be greater than or equal to zero and less than the width of the image. - /// The at the specified position. - public T this[int x] + /// The index from the start of this Pointer to the required element. + /// The at the specified position. + public T this[int index] { get { - void* ptr = ((byte*)this.PointerAtOffset) + (x * Unsafe.SizeOf()); + byte* ptr = ((byte*)this.PointerAtOffset) + BufferPointer.SizeOf(index); return Unsafe.Read(ptr); } }