Class BytePixelTexture
Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
Implements
Inherited Members
Namespace: RGB.NET.Presets.Textures
Assembly: RGB.NET.Presets.dll
Syntax
public sealed class BytePixelTexture : PixelTexture<byte>, ITexture
Constructors
| Edit this page View SourceBytePixelTexture(int, int, byte[], ISampler<byte>, ColorFormat)
Initializes a new instance of the BytePixelTexture class.
Declaration
public BytePixelTexture(int with, int height, byte[] data, ISampler<byte> sampler, ColorFormat colorFormat = ColorFormat.RGB)
Parameters
Type | Name | Description |
---|---|---|
int | with | The width of the texture. |
int | height | The height of the texture. |
byte[] | data | The pixel-data of the texture. |
ISampler<byte> | sampler | The sampler used to get the color of a region. |
ColorFormat | colorFormat | The color format the data is in. (default: RGB) |
BytePixelTexture(int, int, byte[], ColorFormat)
Initializes a new instance of the BytePixelTexture class. A AverageColorSampler is used.
Declaration
public BytePixelTexture(int with, int height, byte[] data, ColorFormat colorFormat = ColorFormat.RGB)
Parameters
Type | Name | Description |
---|---|---|
int | with | The width of the texture. |
int | height | The height of the texture. |
byte[] | data | The pixel-data of the texture. |
ColorFormat | colorFormat | The color format the data is in. (default: RGB) |
Properties
| Edit this page View SourceColorFormat
Gets the color format the data is in.
Declaration
public ColorFormat ColorFormat { get; }
Property Value
Type | Description |
---|---|
ColorFormat |
Data
Gets the underlying pixel data.
Declaration
protected override ReadOnlySpan<byte> Data { get; }
Property Value
Type | Description |
---|---|
ReadOnlySpan<byte> |
Overrides
Methods
| Edit this page View SourceGetColor(in ReadOnlySpan<byte>)
Converts the pixel-data to a color.
Declaration
protected override Color GetColor(in ReadOnlySpan<byte> pixel)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<byte> | pixel | The pixel-data to convert. |
Returns
Type | Description |
---|---|
Color | The color represented by the specified pixel-data. |