docs.unity3d.com
  • Manual
  • Scripting API
  • Changelog
  • License
Show / Hide Table of Contents
    • AddCollectorMenuAttribute
    • CameraGrab_Editor
    • CaptureCollector
    • JpegEncoder
    • JpegEncoder.Flags
    • JpegEncoder.PixelFormat
    • JpegEncoder.SubSample
    • PngEncoder
    • PngEncoder.ColorType
    • PngEncoder.PngParam
  • Unity.Simulation
    • AggregatedSample
    • AggregationEvent
    • ArrayCast
    • ArrayUtilities
    • AsyncRequest
    • AsyncRequest.ExecutionContext
    • AsyncRequest.Result
    • AsyncRequest.State
    • AsyncRequest<T>
    • BaseDataConsumer<T>
    • BaseDataConsumer<T>.Uploadable
    • BaseLogger
    • BatchReadback
    • CameraGrab
    • CaptureCamera
    • CaptureCamera.CaptureState
    • CaptureCamera.Channel
    • CaptureCamera.ReadbackCompletionDelegate
    • CaptureCamera.RequestCompletionDelegate
    • CaptureGPUBuffer
    • CaptureImageEncoder
    • CaptureImageEncoder.ImageFormat
    • CaptureOptions
    • CaptureRenderTexture
    • Category
    • ChannelGrab
    • ChunkedStream
    • CollectorBase
    • CollectorBase.ConsumeCollectorReport
    • CollectorElement
    • CollectorsBaseEditor
    • CollectorsList
    • ContentType
    • ContinuousEvents
    • ContinuousEvents.EventCollectionDelegate
    • ContinuousEvents.EventDispatchDelegate
    • CoreProfilerUtils
    • CounterEvent
    • CounterEventData
    • DXChunkedStream
    • DXFile
    • DXFormat
    • DXManager
    • DXTimeLogger
    • DataCapturePaths
    • DepthGrab
    • DirectoryNameComponent
    • Dispatcher
    • EventBase
    • ExecUtility
    • ExitPlaymode
    • ExtensionNameComponent
    • FileNameComponent
    • FileProducer
    • ForceFlip
    • Format
    • FrameCountCondition
    • FrameLimit
    • FrameNumberNameComponent
    • GeneralUtilities
    • GraphicsUtilities
    • ICondition
    • IDataProduced
    • IGlobalProfilerDataDispatcher
    • IgnoreCollectorAttribute
    • LabelNameComponent
    • LambdaJob
    • LambdaJob.DelegateType
    • Log
    • Log.Level
    • Logger
    • LoggerSuffixOption
    • Manager
    • Manager.NotificationDelegate
    • Manager.TickDelegate
    • NameComponent
    • NameGenerator
    • Options
    • PackageImportTests
    • PathUtility
    • PerfStatsManager
    • PlayerResolution
    • PlayerResolutionSettings
    • ProfilerManager
    • ProfilerProperties
    • ProfilerReport
    • ProfilerSamplingEvent
    • ReadbackRequest
    • RenderPassCallbackDelegate
    • RenderingPipelineType
    • ReportingUtils
    • SRPSupport
    • Sample
    • SampleProfilerCollector
    • ScreenCapture
    • SequenceNameComponent
    • SequencedPathName
    • SimSecondsCondition
    • SimulationProfiler
    • SimulationProfilerBase
    • SimulationProfilerEditor
    • TestUtility
    • ThreadUtility
    • TimeLimit
    • TimeLogger
    • TimeScale
    • TimeScaleEditor
    • TimeUtility
    • Timer
    • TimerSource
    • TimestampNameComponent
    • URPCallbackPass
    • URPCaptureRendererFeature
    • UnityVersion
    • WallSecondsCondition

Class CaptureImageEncoder

Inheritance
object
CaptureImageEncoder
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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.

In This Article
Back to top
Copyright © 2026 Unity Technologies — Trademarks and terms of use
  • Legal
  • Privacy Policy
  • Cookie Policy
  • Do Not Sell or Share My Personal Information