Characteristic Locus
Inheritance object PixelBufferBase > BufferIndexed4
Implements IPixelBuffer IDisposable
Inherited Members PixelBufferBase.Width PixelBufferBase.Height PixelBufferBase.BitDepth PixelBufferBase.ByteCount PixelBufferBase.Buffer PixelBufferBase.InitializeBuffer(bool) PixelBufferBase.Clear() PixelBufferBase.WriteBufferSlow(int, int, IPixelBuffer) PixelBufferBase.RotateAndConvert<T>(RotationType) PixelBufferBase.ScaleUp<T>(int) PixelBufferBase.ConvertPixelBuffer<T>() PixelBufferBase.GetColorDistance(Color, Color) PixelBufferBase.Dispose(bool) PixelBufferBase.Dispose() object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Foundation.Graphics.Buffers
Assembly MicroGraphics.dll

Syntax

public class BufferIndexed4 : PixelBufferBase, IPixelBuffer, IDisposable

Constructors

BufferIndexed4()

Create a new BufferIndexed4 object

Declaration
public BufferIndexed4()

BufferIndexed4(int, int)

Create a new BufferIndexed4 object

Declaration
public BufferIndexed4(int width, int height)

Parameters

Type Name Description
int width

The width in pixels

int height

The height in pixels

BufferIndexed4(int, int, byte[])

Create a new BufferIndexed4 object

Declaration
public BufferIndexed4(int width, int height, byte[] buffer)

Parameters

Type Name Description
int width

The width in pixels

int height

The height in pixels

byte[] buffer

The backing buffer

Fields

IndexedColors

The indexed colors as an 8 element array of Color values

Declaration
public readonly Color[] IndexedColors

Field Value

Type Description
Color[]

Properties

ColorMode

Color mode of the buffer

Declaration
public override ColorMode ColorMode { get; }

Property Value

Type Description
ColorMode

Overrides

Methods

Fill(Color)

Fill buffer with a color

Declaration
public override void Fill(Color color)

Parameters

Type Name Description
Color color

The fill color

Overrides

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

Fill with a color

Declaration
public override void Fill(int x, int y, int width, int height, Color color)

Parameters

Type Name Description
int x

X start position in pixels

int y

Y start position in pixels

int width

Width in pixels

int height

Height in pixels

Color color

The fill color

Overrides

GetColorIndexForPixel(int, int)

Get the pixel color index

Declaration
public byte GetColorIndexForPixel(int x, int y)

Parameters

Type Name Description
int x

The X pixel position

int y

The Y pixel position

Returns

Type Description
byte

The pixel color as a 4bpp gray value

GetPixel(int, int)

Get the pixel color

Declaration
public override Color GetPixel(int x, int y)

Parameters

Type Name Description
int x

The X pixel position

int y

The Y pixel position

Returns

Type Description
Color

The pixel color

Overrides

InvertPixel(int, int)

Invert the pixel

Declaration
public override void InvertPixel(int x, int y)

Parameters

Type Name Description
int x

x position of pixel

int y

y position of pixel

Overrides

SetPixel(int, int, Color)

Set the pixel color

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

Parameters

Type Name Description
int x

X pixel position

int y

Y pixel position

Color color

The pixel color

Overrides

SetPixel(int, int, int)

Set the pixel to a shade of gray

Declaration
public void SetPixel(int x, int y, int colorIndex)

Parameters

Type Name Description
int x

X pixel position

int y

Y pixel position

int colorIndex

The color index

WriteBuffer(int, int, IPixelBuffer)

Write a buffer to specific location to the current buffer

Declaration
public override void WriteBuffer(int x, int y, IPixelBuffer buffer)

Parameters

Type Name Description
int x

x origin

int y

y origin

IPixelBuffer buffer

buffer to write

Overrides