Class ImageFrame<TPixel>
Represents a pixel-specific image frame containing all pixel data and ImageFrameMetadata. In case of animated formats like gif, it contains the single frame in a animation. In all other cases it is the only frame of the image.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp
Assembly: SixLabors.ImageSharp.dll
Syntax
public sealed class ImageFrame<TPixel> : ImageFrame, IDisposable where TPixel : struct, IPixel<TPixel>
Type Parameters
Name | Description |
---|---|
TPixel | The pixel format. |
Properties
| Improve this Doc View SourceItem[Int32, Int32]
Gets or sets the pixel at the specified position.
Declaration
public TPixel this[int x, int y] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | x | The x-coordinate of the pixel. Must be greater than or equal to zero and less than the width of the image. |
Int32 | y | The y-coordinate of the pixel. Must be greater than or equal to zero and less than the height of the image. |
Property Value
Type | Description |
---|---|
TPixel | The |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown when the provided (x,y) coordinates are outside the image boundary. |
Methods
| Improve this Doc View SourceDispose(Boolean)
Disposes the object and frees resources for the Garbage Collector.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing | Whether to dispose of managed and unmanaged objects. |
Overrides
| Improve this Doc View SourceGetPixelRowSpan(Int32)
Gets the representation of the pixels as a Span<T> of contiguous memory
at row rowIndex
beginning from the first pixel on that row.
Declaration
public Span<TPixel> GetPixelRowSpan(int rowIndex)
Parameters
Type | Name | Description |
---|---|---|
Int32 | rowIndex | The row. |
Returns
Type | Description |
---|---|
Span<TPixel> | The Span<T> |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown when row index is out of range. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
| Improve this Doc View SourceTryGetSinglePixelSpan(out Span<TPixel>)
Gets the representation of the pixels as a Span<T> in the source image's pixel format stored in row major order, if the backing buffer is contiguous.
Declaration
public bool TryGetSinglePixelSpan(out Span<TPixel> span)
Parameters
Type | Name | Description |
---|---|---|
Span<TPixel> | span | The Span<T>. |
Returns
Type | Description |
---|---|
Boolean | The Boolean. |