Class SkiaPixelBuffer
Represents a pixel buffer that uses SkiaSharp for rendering.
Assembly: Meadow.Silk.dll
View Source
public class SkiaPixelBuffer : IPixelBuffer
Implements:
Meadow.Peripherals.Displays.IPixelBuffer
Properties
SKBitmap
Gets the underlying SkiaSharp bitmap.
View Source
public SKBitmap SKBitmap { get; }
Width
Gets the width of the pixel buffer.
View Source
public int Width { get; }
Height
Gets the height of the pixel buffer.
View Source
public int Height { get; }
ColorMode
Gets the color mode of the pixel buffer.
View Source
public ColorMode ColorMode { get; }
BitDepth
Gets the bit depth of the pixel buffer.
View Source
public int BitDepth { get; }
ByteCount
Gets the byte count of the pixel buffer.
View Source
public int ByteCount { get; }
Buffer
Gets the buffer containing pixel data.
View Source
public byte[] Buffer { get; }
Methods
Clear()
Clears the pixel buffer, filling it with black.
View Source
public void Clear()
Fill(Color)
Fills the entire pixel buffer with the specified color.
View Source
public void Fill(Color color)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Color | color | The 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
public void Fill(int originX, int originY, int width, int height, Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | originX | The x-coordinate of the region's origin. |
System.Int32 | originY | The y-coordinate of the region's origin. |
System.Int32 | width | The width of the region. |
System.Int32 | height | The height of the region. |
Meadow.Color | color | The color to fill the region with. |
GetPixel(int, int)
Gets the color of the pixel at the specified coordinates.
View Source
public Color GetPixel(int x, int y)
Returns
Meadow.Color
: The color of the pixel at the specified coordinates.
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The x-coordinate of the pixel. |
System.Int32 | y | The y-coordinate of the pixel. |
InvertPixel(int, int)
Inverts the color of the pixel at the specified coordinates.
View Source
public void InvertPixel(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The x-coordinate of the pixel. |
System.Int32 | y | The y-coordinate of the pixel. |
SetPixel(int, int, Color)
Sets the color of the pixel at the specified coordinates.
View Source
public void SetPixel(int x, int y, Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The x-coordinate of the pixel. |
System.Int32 | y | The y-coordinate of the pixel. |
Meadow.Color | color | The 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
public void WriteBuffer(int originX, int originY, IPixelBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | originX | The x-coordinate of the origin. |
System.Int32 | originY | The y-coordinate of the origin. |
Meadow.Peripherals.Displays.IPixelBuffer | buffer | The 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
public void WritePartialBuffer(int left, int top, int right, int bottom, IPixelBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | left | |
System.Int32 | top | |
System.Int32 | right | |
System.Int32 | bottom | |
Meadow.Peripherals.Displays.IPixelBuffer | buffer | The pixel buffer to copy data from |
Implements
Meadow.Peripherals.Displays.IPixelBuffer