Class PixelTexture<T>
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.Core
Assembly: RGB.NET.Core.dll
Syntax
public abstract class PixelTexture<T> : ITexture where T : unmanaged
Type Parameters
Name | Description |
---|---|
T | The type of the pixels. |
Constructors
| Edit this page View SourcePixelTexture(int, int, int, ISampler<T>, int)
Initializes a new instance of the PixelTexture<T> class.
Declaration
public PixelTexture(int with, int height, int dataPerPixel, ISampler<T> sampler, int stride = -1)
Parameters
Type | Name | Description |
---|---|---|
int | with | The width of the texture. |
int | height | The height of the texture. |
int | dataPerPixel | The amount of data-entries per pixel. |
ISampler<T> | sampler | The sampler used to get the color of a region. |
int | stride | The stride of the data or -1 if the width should be used. |
Properties
| Edit this page View SourceData
Gets the underlying pixel data.
Declaration
protected abstract ReadOnlySpan<T> Data { get; }
Property Value
Type | Description |
---|---|
ReadOnlySpan<T> |
DataPerPixel
Gets the amount of data-entries per pixel.
Declaration
protected int DataPerPixel { get; }
Property Value
Type | Description |
---|---|
int |
this[Point]
Gets the color at the specified location.
Declaration
public virtual Color this[in Point point] { get; }
Parameters
Type | Name | Description |
---|---|---|
Point | point | The location to get the color from. |
Property Value
Type | Description |
---|---|
Color | The color at the specified location. |
this[Rectangle]
Gets the sampled color inside the specified rectangle.
Declaration
public virtual Color this[in Rectangle rectangle] { get; }
Parameters
Type | Name | Description |
---|---|---|
Rectangle | rectangle | The rectangle to get the color from. |
Property Value
Type | Description |
---|---|
Color | The sampled color. |
this[int, int, int, int]
Gets the sampled color inside the specified region.
Declaration
public virtual Color this[int x, int y, int width, int height] { get; }
Parameters
Type | Name | Description |
---|---|---|
int | x | The x-location of the region. |
int | y | The y-location of the region. |
int | width | The with of the region. |
int | height | The height of the region. |
Property Value
Type | Description |
---|---|
Color | The sampled color. |
Sampler
Gets or sets the sampler used to get the color of a region.
Declaration
public ISampler<T> Sampler { get; set; }
Property Value
Type | Description |
---|---|
ISampler<T> |
Size
Gets the size of the texture
Declaration
public Size Size { get; }
Property Value
Type | Description |
---|---|
Size |
Stride
Gets the stride of the data.
Declaration
protected int Stride { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceGetColor(in ReadOnlySpan<T>)
Converts the pixel-data to a color.
Declaration
protected abstract Color GetColor(in ReadOnlySpan<T> pixel)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<T> | pixel | The pixel-data to convert. |
Returns
Type | Description |
---|---|
Color | The color represented by the specified pixel-data. |