Skip to main content

Class SkiaPixelBuffer

Represents a pixel buffer that uses SkiaSharp for rendering.

Assembly: Meadow.Silk.dll
View Source
Declaration
public class SkiaPixelBuffer : IPixelBuffer

Implements:
Meadow.Peripherals.Displays.IPixelBuffer

Properties

SKBitmap

Gets the underlying SkiaSharp bitmap.

View Source
Declaration
public SKBitmap SKBitmap { get; }

Width

Gets the width of the pixel buffer.

View Source
Declaration
public int Width { get; }

Height

Gets the height of the pixel buffer.

View Source
Declaration
public int Height { get; }

ColorMode

Gets the color mode of the pixel buffer.

View Source
Declaration
public ColorMode ColorMode { get; }

BitDepth

Gets the bit depth of the pixel buffer.

View Source
Declaration
public int BitDepth { get; }

ByteCount

Gets the byte count of the pixel buffer.

View Source
Declaration
public int ByteCount { get; }

Buffer

Gets the buffer containing pixel data.

View Source
Declaration
public byte[] Buffer { get; }

Methods

Clear()

Clears the pixel buffer, filling it with black.

View Source
Declaration
public void Clear()

Fill(Color)

Fills the entire pixel buffer with the specified color.

View Source
Declaration
public void Fill(Color color)
Parameters
TypeNameDescription
Meadow.ColorcolorThe color to fill the pixel buffer with.

Fill(int, int, int, int, Color)

Fills a specified region of the pixel buffer with the specified color.

View Source
Declaration
public void Fill(int originX, int originY, int width, int height, Color color)
Parameters
TypeNameDescription
System.Int32originXThe x-coordinate of the region's origin.
System.Int32originYThe y-coordinate of the region's origin.
System.Int32widthThe width of the region.
System.Int32heightThe height of the region.
Meadow.ColorcolorThe color to fill the region with.

GetPixel(int, int)

Gets the color of the pixel at the specified coordinates.

View Source
Declaration
public Color GetPixel(int x, int y)
Returns

Meadow.Color: The color of the pixel at the specified coordinates.

Parameters
TypeNameDescription
System.Int32xThe x-coordinate of the pixel.
System.Int32yThe y-coordinate of the pixel.

InvertPixel(int, int)

Inverts the color of the pixel at the specified coordinates.

View Source
Declaration
public void InvertPixel(int x, int y)
Parameters
TypeNameDescription
System.Int32xThe x-coordinate of the pixel.
System.Int32yThe y-coordinate of the pixel.

SetPixel(int, int, Color)

Sets the color of the pixel at the specified coordinates.

View Source
Declaration
public void SetPixel(int x, int y, Color color)
Parameters
TypeNameDescription
System.Int32xThe x-coordinate of the pixel.
System.Int32yThe y-coordinate of the pixel.
Meadow.ColorcolorThe color to set the pixel to.

WriteBuffer(int, int, IPixelBuffer)

Writes the pixel data from another pixel buffer into this buffer at the specified origin.

View Source
Declaration
public void WriteBuffer(int originX, int originY, IPixelBuffer buffer)
Parameters
TypeNameDescription
System.Int32originXThe x-coordinate of the origin.
System.Int32originYThe y-coordinate of the origin.
Meadow.Peripherals.Displays.IPixelBufferbufferThe pixel buffer to copy data from.

WritePartialBuffer(int, int, int, int, IPixelBuffer)

Writes the pixel data from another pixel buffer into this buffer at the specified location Assumes both buffers are the same dimensions

View Source
Declaration
public void WritePartialBuffer(int left, int top, int right, int bottom, IPixelBuffer buffer)
Parameters
TypeNameDescription
System.Int32left
System.Int32top
System.Int32right
System.Int32bottom
Meadow.Peripherals.Displays.IPixelBufferbufferThe pixel buffer to copy data from

Implements

  • Meadow.Peripherals.Displays.IPixelBuffer