Class TextureData
Texture data container (used to keep data downloaded from the GPU).
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public class TextureData : Object
Constructors
TextureData()
Properties
ArraySize
Gets amount of texture slices in the array.
Declaration
[Unmanaged]
public int ArraySize { get; }
Property Value
System.Int32
|
Depth
Top level texture surface depth (in pixels).
Declaration
[Unmanaged]
public int Depth { get; }
Property Value
System.Int32
|
Format
The texture data format.
Declaration
[Unmanaged]
public PixelFormat Format { get; }
Property Value
PixelFormat
|
Height
Top level texture surface height (in pixels).
Declaration
[Unmanaged]
public int Height { get; }
Property Value
System.Int32
|
MipLevels
Gets amount of mip maps in the texture.
Declaration
[Unmanaged]
public int MipLevels { get; }
Property Value
System.Int32
|
Width
Top level texture surface width (in pixels).
Declaration
[Unmanaged]
public int Width { get; }
Property Value
System.Int32
|
Methods
Clear()
Clear allocated memory.
Declaration
[Unmanaged]
public void Clear()
GetPixels(out Color[], Int32, Int32)
Gets the texture pixels as Color array.
Declaration
[Unmanaged]
public bool GetPixels(out Color[] pixels, int mipIndex = 0, int arrayIndex = 0)
Parameters
Color[]
pixels
The result texture pixels array. |
System.Int32
mipIndex
The mip index (zero-based). |
System.Int32
arrayIndex
The array or depth slice index (zero-based). |
Returns
System.Boolean
True if failed, otherwise false. |
Remarks
Supported only for 'basic' texture formats (uncompressed, single plane).
GetPixels(out Color32[], Int32, Int32)
Gets the texture pixels as Color32 array.
Declaration
[Unmanaged]
public bool GetPixels(out Color32[] pixels, int mipIndex = 0, int arrayIndex = 0)
Parameters
Color32[]
pixels
The result texture pixels array. |
System.Int32
mipIndex
The mip index (zero-based). |
System.Int32
arrayIndex
The array or depth slice index (zero-based). |
Returns
System.Boolean
True if failed, otherwise false. |
Remarks
Supported only for 'basic' texture formats (uncompressed, single plane).