Class IndexedImageFrame<TPixel>
A pixel-specific image frame where each pixel buffer value represents an index in a color palette.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp
Assembly: SixLabors.ImageSharp.dll
Syntax
public sealed class IndexedImageFrame<TPixel> : IDisposable where TPixel : struct, IPixel<TPixel>
Type Parameters
| Name | Description |
|---|---|
| TPixel | The pixel format. |
Properties
| Improve this Doc View SourceConfiguration
Gets the configuration which allows altering default behaviour or extending the library.
Declaration
public Configuration Configuration { get; }
Property Value
| Type | Description |
|---|---|
| Configuration |
Height
Gets the height of this IndexedImageFrame<TPixel>.
Declaration
public int Height { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Palette
Gets the color palette of this IndexedImageFrame<TPixel>.
Declaration
public ReadOnlyMemory<TPixel> Palette { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlyMemory<TPixel> |
Width
Gets the width of this IndexedImageFrame<TPixel>.
Declaration
public int Width { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Methods
| Improve this Doc View SourceDispose()
Declaration
public void Dispose()
GetPixelRowSpan(Int32)
Gets the representation of the pixels as a ReadOnlySpan<T> of contiguous memory
at row rowIndex beginning from the first pixel on that row.
Declaration
public ReadOnlySpan<byte> GetPixelRowSpan(int rowIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | rowIndex | The row index in the pixel buffer. |
Returns
| Type | Description |
|---|---|
| ReadOnlySpan<Byte> | The pixel row as a ReadOnlySpan<T>. |
GetWritablePixelRowSpanUnsafe(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.
Note: Values written to this span are not sanitized against the palette length. Care should be taken during assignment to prevent out-of-bounds errors.
Declaration
public Span<byte> GetWritablePixelRowSpanUnsafe(int rowIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | rowIndex | The row index in the pixel buffer. |
Returns
| Type | Description |
|---|---|
| Span<Byte> | The pixel row as a Span<T>. |