Table of Contents

Class TextureBitmapRgba32

Namespace
TileWorld.Engine.Render
Assembly
TileWorld.Engine.dll

Represents a backend-neutral RGBA bitmap that hosts can upload as a texture resource.

public sealed class TextureBitmapRgba32
Inheritance
TextureBitmapRgba32
Inherited Members

Constructors

TextureBitmapRgba32(int, int, ColorRgba32[])

Creates a bitmap from packed row-major pixel data.

public TextureBitmapRgba32(int width, int height, ColorRgba32[] pixels)

Parameters

width int

The bitmap width in pixels.

height int

The bitmap height in pixels.

pixels ColorRgba32[]

The packed row-major pixels.

Properties

Height

Gets the bitmap height in pixels.

public int Height { get; }

Property Value

int

Pixels

Gets the packed row-major pixels.

public ReadOnlySpan<ColorRgba32> Pixels { get; }

Property Value

ReadOnlySpan<ColorRgba32>

Width

Gets the bitmap width in pixels.

public int Width { get; }

Property Value

int

Methods

GetPixel(int, int)

Gets the color at a pixel position.

public ColorRgba32 GetPixel(int x, int y)

Parameters

x int

The horizontal pixel coordinate.

y int

The vertical pixel coordinate.

Returns

ColorRgba32

The pixel color.