Class MeshAccessor.Stream
Mesh data stream.
Inheritance
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
public sealed class Stream : ValueType
Properties
Count
Gets the count of the items in the stride.
Declaration
public int Count { get; }
Property Value
|
System.Int32
|
Data
Gets the raw data block.
Declaration
public Span<byte> Data { get; }
Property Value
|
System.Span<System.Byte>
|
Format
Gets the format of the data.
Declaration
public PixelFormat Format { get; }
Property Value
|
PixelFormat
|
IsValid
Returns true if stream is valid.
Declaration
public bool IsValid { get; }
Property Value
|
System.Boolean
|
Stride
Gets the stride (in bytes) of the data.
Declaration
public int Stride { get; }
Property Value
|
System.Int32
|
Methods
CopyTo(Span<Color>)
Copies the contents of this stream into a destination System.Span<>.
Declaration
public void CopyTo(Span<Color> dst)
Parameters
|
System.Span<Color>
dst
The destination System.Span<>. |
CopyTo(Span<Float2>)
Copies the contents of this stream into a destination System.Span<>.
Declaration
public void CopyTo(Span<Float2> dst)
Parameters
|
System.Span<Float2>
dst
The destination System.Span<>. |
CopyTo(Span<Float3>)
Copies the contents of this stream into a destination System.Span<>.
Declaration
public void CopyTo(Span<Float3> dst)
Parameters
|
System.Span<Float3>
dst
The destination System.Span<>. |
GetFloat(Int32)
Reads a float value from a given item.
Declaration
public float GetFloat(int index)
Parameters
|
System.Int32
index
Zero-based index of the item. |
Returns
|
System.Single
Loaded value. |
GetFloat2(Int32)
Reads a Float2 value from a given item.
Declaration
public Float2 GetFloat2(int index)
Parameters
|
System.Int32
index
Zero-based index of the item. |
Returns
|
Float2
Loaded value. |
GetFloat3(Int32)
Reads a Float3 value from a given item.
Declaration
public Float3 GetFloat3(int index)
Parameters
|
System.Int32
index
Zero-based index of the item. |
Returns
|
Float3
Loaded value. |
GetFloat4(Int32)
Reads a Float4 value from a given item.
Declaration
public Float4 GetFloat4(int index)
Parameters
|
System.Int32
index
Zero-based index of the item. |
Returns
|
Float4
Loaded value. |
GetInt(Int32)
Reads an integer value from a given item.
Declaration
public int GetInt(int index)
Parameters
|
System.Int32
index
Zero-based index of the item. |
Returns
|
System.Int32
Loaded value. |
IsLinear(PixelFormat)
Checks if the stream can use SetLinear(IntPtr) via a single memory copy.
Declaration
public bool IsLinear(PixelFormat expectedFormat)
Parameters
|
PixelFormat
expectedFormat
Source data format. |
Returns
|
System.Boolean
True if stream is linear and format matches expected input data. |
Set(Span<Color>)
Copies the contents of the input System.Span<> into the elements of this stream.
Declaration
public void Set(Span<Color> src)
Parameters
|
System.Span<Color>
src
The source System.Span<>. |
Set(Span<Float2>)
Copies the contents of the input System.Span<> into the elements of this stream.
Declaration
public void Set(Span<Float2> src)
Parameters
|
System.Span<Float2>
src
The source System.Span<>. |
Set(Span<Float3>)
Copies the contents of the input System.Span<> into the elements of this stream.
Declaration
public void Set(Span<Float3> src)
Parameters
|
System.Span<Float3>
src
The source System.Span<>. |
SetFloat(Int32, Single)
Writes a float value to a given item.
Declaration
public void SetFloat(int index, float value)
Parameters
|
System.Int32
index
Zero-based index of the item. |
|
System.Single
value
Value to assign. |
SetFloat2(Int32, Float2)
Writes a Float2 value to a given item.
Declaration
public void SetFloat2(int index, Float2 value)
Parameters
|
System.Int32
index
Zero-based index of the item. |
|
Float2
value
Value to assign. |
SetFloat3(Int32, Float3)
Writes a Float3 value to a given item.
Declaration
public void SetFloat3(int index, Float3 value)
Parameters
|
System.Int32
index
Zero-based index of the item. |
|
Float3
value
Value to assign. |
SetFloat4(Int32, Float4)
Writes a Float4 value to a given item.
Declaration
public void SetFloat4(int index, Float4 value)
Parameters
|
System.Int32
index
Zero-based index of the item. |
|
Float4
value
Value to assign. |
SetInt(Int32, Int32)
Writes an integer value to a given item.
Declaration
public void SetInt(int index, int value)
Parameters
|
System.Int32
index
Zero-based index of the item. |
|
System.Int32
value
Value to assign. |
SetLinear(IntPtr)
Copies a linear block of data into the stream. Assumes IsLinear(PixelFormat) returned true for the format of the input data.
Declaration
public void SetLinear(IntPtr data)
Parameters
|
System.IntPtr
data
Pointer to the source data. |
Remarks
Check input data and stream type with IsLinear before calling.