Class TextureData
Texture data container (used to keep data downloaded from the GPU).
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Graphics/Textures/TextureData.h
Syntax
public class TextureData : public ScriptingObject
Fields
Depth
Top level texture surface depth (in pixels).
Declaration
public int32 Depth = 0
Field Value
int32
|
Format
The texture data format.
Declaration
public PixelFormat Format = PixelFormat::Unknown
Field Value
PixelFormat
|
Height
Top level texture surface height (in pixels).
Declaration
public int32 Height = 0
Field Value
int32
|
Items
The items collection (depth slices or array slices).
Declaration
public Array<ArrayEntry, InlinedAllocation<6>> Items
Field Value
Array<ArrayEntry, InlinedAllocation<6>>
|
Width
Top level texture surface width (in pixels).
Declaration
public int32 Width = 0
Field Value
int32
|
Methods
Clear()
Clear allocated memory.
Declaration
public void Clear()
GetArraySize()
Gets amount of texture slices in the array.
Declaration
public int32 GetArraySize() const
Returns
int32
|
GetData(int32 arrayIndex, int32 mipLevel)
Gather texture data
Declaration
public TextureMipData* GetData(int32 arrayIndex, int32 mipLevel)
Parameters
int32
arrayIndex
Texture array index |
int32
mipLevel
Mip map index |
Returns
TextureMipData
Result data |
GetMipLevels()
Gets amount of mip maps in the texture.
Declaration
public int32 GetMipLevels() const
Returns
int32
|
GetPixels(Array<Color>& pixels, int32 mipIndex = 0, int32 arrayIndex = 0)
Gets the texture pixels as Color array.
Supported only for 'basic' texture formats (uncompressed, single plane).
Declaration
public bool GetPixels(Array<Color>& pixels, int32 mipIndex = 0, int32 arrayIndex = 0)
Parameters
Array<Color>
pixels
The result texture pixels array. |
int32
mipIndex
The mip index (zero-based). |
int32
arrayIndex
The array or depth slice index (zero-based). |
Returns
bool
True if failed, otherwise false. |
GetPixels(Array<Color32>& pixels, int32 mipIndex = 0, int32 arrayIndex = 0)
Gets the texture pixels as Color32 array.
Supported only for 'basic' texture formats (uncompressed, single plane).
Declaration
public bool GetPixels(Array<Color32>& pixels, int32 mipIndex = 0, int32 arrayIndex = 0)
Parameters
Array<Color32>
pixels
The result texture pixels array. |
int32
mipIndex
The mip index (zero-based). |
int32
arrayIndex
The array or depth slice index (zero-based). |
Returns
bool
True if failed, otherwise false. |