SixelPixelAccess
Namespace: Hex1b.Surfaces
Assembly: Hex1b.dll
Provides read-only access to sixel pixel data at a specific cell position.
public readonly struct SixelPixelAccessProperties
IsValid
Gets whether this accessor has valid pixel data.
Returns: Boolean
public bool IsValid { get; }PixelHeight
Gets the height of this cell's pixel region.
Returns: Int32
public int PixelHeight { get; }PixelWidth
Gets the width of this cell's pixel region.
Returns: Int32
public int PixelWidth { get; }Methods
GetAverageColor()
Gets the average color of all pixels in this cell.
Returns: Rgba32
The average color.
public Rgba32 GetAverageColor()GetDominantColor()
Gets the dominant color of pixels in this cell.
Returns: Rgba32
The most common non-transparent color.
public Rgba32 GetDominantColor()GetPixel(int, int)
Gets the pixel at the specified position within this cell.
Parameters:
x(Int32): X position within the cell (0 to PixelWidth-1).y(Int32): Y position within the cell (0 to PixelHeight-1).
Returns: Rgba32
The pixel color, or transparent if out of bounds.
public Rgba32 GetPixel(int x, int y)HasVisiblePixels()
Checks if any pixel in this cell is non-transparent.
Returns: Boolean
public bool HasVisiblePixels()ToPixelBuffer()
Creates a copy of the pixel data for this cell region.
Returns: SixelPixelBuffer
A new pixel buffer containing just this cell's pixels.
public SixelPixelBuffer? ToPixelBuffer()WithBrightness(float)
Creates a modified copy of the pixel data with brightness adjusted.
Parameters:
factor(Single): Brightness factor (1.0 = no change, 0.5 = half brightness, 2.0 = double).
Returns: SixelPixelBuffer
A new pixel buffer with brightness adjusted.
public SixelPixelBuffer? WithBrightness(float factor)WithTint(Rgba32, float)
Creates a modified copy of the pixel data with a color tint applied.
Parameters:
Returns: SixelPixelBuffer
A new pixel buffer with the tint applied.
public SixelPixelBuffer? WithTint(Rgba32 tintColor, float opacity)Remarks
This type is used by computed cells to query pixel data from sixels in layers below. The pixel access is relative to the cell position, allowing effects like tinting or brightness adjustment based on the underlying sixel content.
The sixel data is decoded lazily on first access.