Class CaptureImageEncoder
Namespace: Unity.Simulation
Syntax
public static class CaptureImageEncoder
Methods
Decode(Byte[], ref Int32, ref Int32, CaptureImageEncoder.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 | |
| Int32 | width | |
| Int32 | height | |
| CaptureImageEncoder.ImageFormat | imageFormat |
Returns
| Type | Description |
|---|---|
| Byte[] |
Encode(Array, Int32, Int32, GraphicsFormat, CaptureImageEncoder.ImageFormat, Boolean, Int32)
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 |
| Int32 | width | Texture/Image width |
| Int32 | 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 |
| Boolean | flipY | Boolean flag indicating if the image needs to be flipped |
| Int32 | additionalParam | Additional flags to be provided for image conversion (optional) |
Returns
| Type | Description |
|---|---|
| Array |
EncodeArray(Array, Int32, Int32, GraphicsFormat, CaptureImageEncoder.ImageFormat, Int32)
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. |
| Int32 | width | Image width. |
| Int32 | height | Image height. |
| GraphicsFormat | format | Graphics format used by the render texture. |
| CaptureImageEncoder.ImageFormat | imageFormat | Format for encoding the data. |
| Int32 | additionalParam | Additional flags to be passed for the encoding. |
Returns
| Type | Description |
|---|---|
| Array |
Exceptions
| Type | Condition |
|---|---|
| NotSupportedException |
EnforceFileExtension(String, CaptureImageEncoder.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. |