Show / Hide Table of Contents

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.

Inheritance
object
PixelTexture<T>
PixelTexture
BytePixelTexture
FloatPixelTexture
Implements
ITexture
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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 Source

PixelTexture(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 Source

Data

Gets the underlying pixel data.

Declaration
protected abstract ReadOnlySpan<T> Data { get; }
Property Value
Type Description
ReadOnlySpan<T>
| Edit this page View Source

DataPerPixel

Gets the amount of data-entries per pixel.

Declaration
protected int DataPerPixel { get; }
Property Value
Type Description
int
| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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>
| Edit this page View Source

Size

Gets the size of the texture

Declaration
public Size Size { get; }
Property Value
Type Description
Size
| Edit this page View Source

Stride

Gets the stride of the data.

Declaration
protected int Stride { get; }
Property Value
Type Description
int

Methods

| Edit this page View Source

GetColor(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.

Implements

ITexture
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX