Class IndexedImageFrame<TPixel>
- Namespace
- SixLabors.ImageSharp
- Assembly
- SixLabors.ImageSharp.dll
A pixel-specific image frame where each pixel buffer value represents an index in a color palette.
public sealed class IndexedImageFrame<TPixel> : IDisposable where TPixel : unmanaged, IPixel<TPixel>
Type Parameters
TPixel
The pixel format.
- Inheritance
-
IndexedImageFrame<TPixel>
- Implements
- Inherited Members
Properties
Configuration
Gets the configuration which allows altering default behaviour or extending the library.
public Configuration Configuration { get; }
Property Value
Height
Gets the height of this IndexedImageFrame<TPixel>.
public int Height { get; }
Property Value
Palette
Gets the color palette of this IndexedImageFrame<TPixel>.
public ReadOnlyMemory<TPixel> Palette { get; }
Property Value
- ReadOnlyMemory<TPixel>
Width
Gets the width of this IndexedImageFrame<TPixel>.
public int Width { get; }
Property Value
Methods
DangerousGetRowSpan(int)
Gets the representation of the pixels as a ReadOnlySpan<T> of contiguous memory
at row rowIndex
beginning from the first pixel on that row.
public ReadOnlySpan<byte> DangerousGetRowSpan(int rowIndex)
Parameters
rowIndex
intThe row index in the pixel buffer.
Returns
- ReadOnlySpan<byte>
The pixel row as a ReadOnlySpan<T>.
Dispose()
public void Dispose()
GetWritablePixelRowSpanUnsafe(int)
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.
public Span<byte> GetWritablePixelRowSpanUnsafe(int rowIndex)
Parameters
rowIndex
intThe row index in the pixel buffer.