Class BufferIndexed4
Represents a 4bpp pixel buffer with indexed colors
Assembly: MicroGraphics.dll
View Source
public class BufferIndexed4 : PixelBufferBase, IPixelBuffer, IDisposable
Inheritance: System.Object
-> Meadow.Foundation.Graphics.Buffers.PixelBufferBase
Implements:
Meadow.Foundation.Graphics.Buffers.IPixelBuffer, System.IDisposable
Properties
ColorMode
Color mode of the buffer
View Source
public override ColorMode ColorMode { get; }
Fields
IndexedColors
The indexed colors as an 8 element array of Color values
View Source
public readonly Color[] IndexedColors
Methods
Fill(Color)
Fill buffer with a color
View Source
public override void Fill(Color color)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Color | color | The fill color |
Fill(int, int, int, int, Color)
Fill with a color
View Source
public override void Fill(int x, int y, int width, int height, Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | X start position in pixels |
System.Int32 | y | Y start position in pixels |
System.Int32 | width | Width in pixels |
System.Int32 | height | Height in pixels |
Meadow.Color | color | The fill color |
GetPixel(int, int)
Get the pixel color
View Source
public override Color GetPixel(int x, int y)
Returns
Meadow.Color
: The pixel color
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The X pixel position |
System.Int32 | y | The Y pixel position |
SetPixel(int, int, Color)
Set the pixel color
View Source
public override void SetPixel(int x, int y, Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | X pixel position |
System.Int32 | y | Y pixel position |
Meadow.Color | color | The pixel color |
SetPixel(int, int, int)
Set the pixel to a shade of gray
View Source
public void SetPixel(int x, int y, int colorIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | X pixel position |
System.Int32 | y | Y pixel position |
System.Int32 | colorIndex | The color index |
InvertPixel(int, int)
Invert the pixel
View Source
public override void InvertPixel(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | x position of pixel |
System.Int32 | y | y position of pixel |
WriteBuffer(int, int, IPixelBuffer)
Write a buffer to specific location to the current buffer
View Source
public override void WriteBuffer(int x, int y, IPixelBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | x origin |
System.Int32 | y | y origin |
Meadow.Foundation.Graphics.Buffers.IPixelBuffer | buffer | buffer to write |
GetColorIndexForPixel(int, int)
Get the pixel color index
View Source
public byte GetColorIndexForPixel(int x, int y)
Returns
System.Byte
: The pixel color as a 4bpp gray value
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The X pixel position |
System.Int32 | y | The Y pixel position |
Implements
- Meadow.Foundation.Graphics.Buffers.IPixelBuffer
System.IDisposable