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