Class CaptureImageEncoder
Inherited Members
Namespace: Unity.Simulation
Assembly: Unity.Simulation.Capture.dll
Syntax
public static class CaptureImageEncoder
Methods
Decode(byte[], ref int, ref int, ImageFormat)
Declaration
[Obsolete("Decoding is no longer supported.")]
public static byte[] Decode(byte[] data, ref int width, ref int height, CaptureImageEncoder.ImageFormat imageFormat)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | data | |
| int | width | |
| int | height | |
| CaptureImageEncoder.ImageFormat | imageFormat |
Returns
| Type | Description |
|---|---|
| byte[] |
Encode(Array, int, int, GraphicsFormat, ImageFormat, bool, int)
Encode the data with provided image format.
Declaration
[Obsolete("Encode supporting flipY has been deprecated. Use EncodeArray instead.")]
public static Array Encode(Array data, int width, int height, GraphicsFormat format, CaptureImageEncoder.ImageFormat imageFormat, bool flipY = true, int additionalParam = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| Array | data | Array of data to be encoded |
| int | width | Texture/Image width |
| int | height | Texture/Image height |
| GraphicsFormat | format | Graphics Format used for the render texture |
| CaptureImageEncoder.ImageFormat | imageFormat | Format in which the data is to be encoded |
| bool | flipY | Boolean flag indicating if the image needs to be flipped |
| int | additionalParam | Additional flags to be provided for image conversion (optional) |
Returns
| Type | Description |
|---|---|
| Array |
EncodeArray(Array, int, int, GraphicsFormat, ImageFormat, int)
Encode the input data as per provided image format.
Declaration
public static Array EncodeArray(Array data, int width, int height, GraphicsFormat format, CaptureImageEncoder.ImageFormat imageFormat, int additionalParam = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| Array | data | An array of data to be encoded. |
| int | width | Image width. |
| int | height | Image height. |
| GraphicsFormat | format | Graphics format used by the render texture. |
| CaptureImageEncoder.ImageFormat | imageFormat | Format for encoding the data. |
| int | additionalParam | Additional flags to be passed for the encoding. |
Returns
| Type | Description |
|---|---|
| Array |
Exceptions
| Type | Condition |
|---|---|
| NotSupportedException |
EnforceFileExtension(string, ImageFormat)
Appends the provided file path with the imageFormat
Declaration
public static string EnforceFileExtension(string path, CaptureImageEncoder.ImageFormat imageFormat)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | Path to the file |
| CaptureImageEncoder.ImageFormat | imageFormat | Image format to be appended at the end of the file path |
Returns
| Type | Description |
|---|---|
| string | A string of filePath with extension. |