Table of Contents

Class TileRgba8888

Normalizes a decoded tile texture into tightly packed RGBA8888. Main thread only (Texture2D API). Never allocates on the managed heap: the source pixels are read through GetRawTextureData<byte> (a NativeArray view over the texture's own memory, not a copy) and written into a caller-provided buffer the caller owns and pools.

public static class TileRgba8888
Inheritance
object
TileRgba8888

Methods

TryRead(Texture2D, byte[])

Reads decoded's pixels into dest as RGBA8888, widthheight4 bytes from offset 0. Returns false, leaving dest untouched, when the texture's format is not one Texture2D.LoadImage produces on this engine (RGBA32, ARGB32, RGB24, BGRA32 - the same set RawTileBlob.ExpectedBytes accepts); the caller must reject the tile rather than guess a channel order. Throws ArgumentException when dest is smaller than widthheight4.

public static bool TryRead(Texture2D decoded, byte[] dest)

Parameters

decoded Texture2D
dest byte[]

Returns

bool