Class Texture2D
Immutable opaque image. Pixels are top-to-bottom ARGB; UV (0,0) is the bottom-left corner.
Inherited Members
Namespace: Simple3D.Core
Assembly: Simple3D.Core.dll
Syntax
public sealed class Texture2D
Constructors
| Edit this page View SourceTexture2D(int, int, IEnumerable<uint>, TextureFilter, TextureAddressMode)
Copies exactly width * height opaque pixels. Sizes, pixels and sampler settings are validated.
Declaration
public Texture2D(int width, int height, IEnumerable<uint> pixels, TextureFilter filter = TextureFilter.Nearest, TextureAddressMode addressMode = TextureAddressMode.Clamp)
Parameters
| Type | Name | Description |
|---|---|---|
| int | width | |
| int | height | |
| IEnumerable<uint> | pixels | |
| TextureFilter | filter | |
| TextureAddressMode | addressMode |
Fields
| Edit this page View SourceMaximumDimension
Maximum width or height accepted for an image.
Declaration
public const int MaximumDimension = 4096
Field Value
| Type | Description |
|---|---|
| int |
Properties
| Edit this page View SourceAddressMode
Addressing shared by both axes.
Declaration
public TextureAddressMode AddressMode { get; }
Property Value
| Type | Description |
|---|---|
| TextureAddressMode |
Filter
Sampling filter.
Declaration
public TextureFilter Filter { get; }
Property Value
| Type | Description |
|---|---|
| TextureFilter |
Height
Image height in pixels.
Declaration
public int Height { get; }
Property Value
| Type | Description |
|---|---|
| int |
Pixels
Copied row-major pixels packed as 0xFFRRGGBB.
Declaration
public IReadOnlyList<uint> Pixels { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<uint> |
Width
Image width in pixels.
Declaration
public int Width { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
| Edit this page View SourceSample(float, float)
Samples an opaque color at finite UV coordinates.
Declaration
public uint Sample(float u, float v)
Parameters
| Type | Name | Description |
|---|---|---|
| float | u | |
| float | v |
Returns
| Type | Description |
|---|---|
| uint |