Characteristic Locus
Namespace Meadow.Foundation.Graphics.Buffers
Assembly Meadow.Foundation.dll

Syntax

public interface IPixelBuffer

Properties

BitDepth

The BitDepth of the chosen ColorMode.

Declaration
int BitDepth { get; }

Property Value

Type Description
System.Int32

Buffer

The byte array that holds all pixel data

Declaration
byte[] Buffer { get; }

Property Value

Type Description
System.Byte[]

ByteCount

The number of bytes in this pixel buffer

Declaration
int ByteCount { get; }

Property Value

Type Description
System.Int32

ColorMode

The ColorMode of the pixel buffer

Declaration
ColorType ColorMode { get; }

Property Value

Type Description
ColorType

Height

The height of the pixel buffer

Declaration
int Height { get; }

Property Value

Type Description
System.Int32

Width

The width of the pixel buffer

Declaration
int Width { get; }

Property Value

Type Description
System.Int32

Methods

Clear()

Clears the buffer (writes 0s to the byte array)

Declaration
void Clear()

Clear(Int32, Int32, Int32, Int32)

Clears a region of the buffer (writes 0s to the byte array)

Declaration
virtual void Clear(int originX, int originY, int width, int height)

Parameters

Type Name Description
System.Int32 originX

The X coord to start

System.Int32 originY

The Y coord to start

System.Int32 width

The width of the region to clear

System.Int32 height

The height of the region to clear

Fill(Color)

Fills the buffer with the provided color

Declaration
void Fill(Color color)

Parameters

Type Name Description
Color color

The color to fill

Fill(Int32, Int32, Int32, Int32, Color)

Fills part of the buffer with the provided color

Declaration
void Fill(int originX, int originY, int width, int height, Color color)

Parameters

Type Name Description
System.Int32 originX

The X coord to start filling

System.Int32 originY

The Y coord to start filling

System.Int32 width

The width to fill

System.Int32 height

The height to fill

Color color

The color to fill

GetPixel(Int32, Int32)

Get the color of a pixel - may be scaled based on buffer color depth

Declaration
Color GetPixel(int x, int y)

Parameters

Type Name Description
System.Int32 x

X coordinate of the pixel: 0,0 at top left

System.Int32 y

Y coordinate of the pixel: 0,0 at top left

Returns

Type Description
Color

InvertPixel(Int32, Int32)

Invert the color of a pixel at the provided location

Declaration
void InvertPixel(int x, int y)

Parameters

Type Name Description
System.Int32 x

The X coord to invert

System.Int32 y

The Y coord to invert

SetPixel(Int32, Int32, Color)

Set the color of the pixel at the provided coordinates

Declaration
void SetPixel(int x, int y, Color color)

Parameters

Type Name Description
System.Int32 x

X coordinate of the pixel: 0,0 at top left

System.Int32 y

Y coordinate of the pixel: 0,0 at top left

Color color

The pixel color

WriteBuffer(Int32, Int32, IPixelBuffer)

Writes another pixel buffer into this buffer.

Declaration
void WriteBuffer(int originX, int originY, IPixelBuffer buffer)

Parameters

Type Name Description
System.Int32 originX

The X origin to start writing

System.Int32 originY

The Y origin to start writing

IPixelBuffer buffer

The buffer to write into this buffer