Class TofArColorManager
Manage the connection with TofAr Color component
Has the following functions
- Manage connection with Color camera
- Get Color data
- Texture2D conversion of Color data
- Notice on (data) stream starting event
- Notice on (data) stream ending event
- Notice on arrival of frame
- Playback of recording file
Inheritance
Inherited Members
Namespace: TofAr.V0.Color
Assembly: TofArColorAssembly.dll
Syntax
public class TofArColorManager : Singleton<TofArColorManager>, IStreamStoppable, IDisposable, IStreamHolder, IDependedManager
Fields
autoStart
If true, Color data stream will automatically start when the application is started
Declaration
public bool autoStart
Field Value
Type |
---|
System.Boolean |
SetDefaultStreamDelay
Event for when default streaming delay is set
Declaration
public TofArColorManager.SetDefaultStreamDelayEventHandler SetDefaultStreamDelay
Field Value
Type |
---|
TofArColorManager.SetDefaultStreamDelayEventHandler |
Properties
ColorData
Color data
Declaration
public ColorData ColorData { get; }
Property Value
Type |
---|
ColorData |
ColorTexture
Texture2D with Color data converted
When using Color data formats below, visible data will not be stored since Unity does not support the formats.
- YUV420
- BGR
Declaration
public Texture2D ColorTexture { get; }
Property Value
Type |
---|
UnityEngine.Texture2D |
DesiredFrameRate
Desired FPS. Changes are reflected on next stream start.
Declaration
public float DesiredFrameRate { get; set; }
Property Value
Type |
---|
System.Single |
FrameRate
Actual FPS
Declaration
public float FrameRate { get; }
Property Value
Type |
---|
System.Single |
IsColorStarting
Status of stream starting
Declaration
public bool IsColorStarting { get; }
Property Value
Type |
---|
System.Boolean |
IsPlaying
True if recording file is being played
Declaration
public bool IsPlaying { get; }
Property Value
Type |
---|
System.Boolean |
IsProcessTexture
If true, execute Texture2D conversion of data
Declaration
[Obsolete("IsProcessTexture is deprecated, please use ProcessTexture instead")]
public bool IsProcessTexture { get; }
Property Value
Type |
---|
System.Boolean |
IsStreamActive
If true, it is streaming
Declaration
public bool IsStreamActive { get; }
Property Value
Type |
---|
System.Boolean |
ProcessTexture
If true, execute Texture2D conversion of data
Declaration
public bool ProcessTexture { get; }
Property Value
Type |
---|
System.Boolean |
Stream
Stream
Declaration
public Stream Stream { get; }
Property Value
Type |
---|
SensCord.Stream |
StreamDelay
Number of frames to delay frame sending
Declaration
public int StreamDelay { get; set; }
Property Value
Type |
---|
System.Int32 |
StreamPlay
Playback stream
Declaration
public Stream StreamPlay { get; }
Property Value
Type |
---|
SensCord.Stream |
Version
Component version No.
Declaration
public string Version { get; }
Property Value
Type |
---|
System.String |
Methods
AddManagerDependency(IDependManager)
Add dependent manager
Declaration
public void AddManagerDependency(IDependManager dependManager)
Parameters
Type | Name | Description |
---|---|---|
IDependManager | dependManager | Dependent manager |
Dispose()
Object disposal
Declaration
public void Dispose()
GetProperty<T>()
Get component property
Declaration
public T GetProperty<T>()
where T : class, IBaseProperty, new()
Returns
Type | Description |
---|---|
T | Property class |
Type Parameters
Name | Description |
---|---|
T | IBaseProperty inherited class |
GetProperty<T>(T)
Get property of Component. Input parameter value may be designated.
Declaration
public T GetProperty<T>(T value)
where T : class, IBaseProperty
Parameters
Type | Name | Description |
---|---|---|
T | value | Input parameter |
Returns
Type | Description |
---|---|
T | Property class |
Type Parameters
Name | Description |
---|---|
T | IBaseProperty inherited class |
GetProperty<T>(T, Int32)
Set the size of the serialization buffer and get component properties. Input parameter value may be designated.
Declaration
public T GetProperty<T>(T value, int bufferSize)
where T : class, IBaseProperty
Parameters
Type | Name | Description |
---|---|---|
T | value | Input parameter |
System.Int32 | bufferSize | Serialization buffer size |
Returns
Type | Description |
---|---|
T | Property class |
Type Parameters
Name | Description |
---|---|
T | IBaseProperty inherited class |
GetPropertyList()
Get property list
Declaration
public string[] GetPropertyList()
Returns
Type | Description |
---|---|
System.String[] | Property list |
RegisterColorPreProcessing(IPreProcessColorData)
Register Color data preprocessing
Declaration
public void RegisterColorPreProcessing(IPreProcessColorData preProcessColor)
Parameters
Type | Name | Description |
---|---|---|
IPreProcessColorData | preProcessColor | Data process class |
RemoveManagerDependency(IDependManager)
Remove dependent manager
Declaration
public void RemoveManagerDependency(IDependManager dependManager)
Parameters
Type | Name | Description |
---|---|---|
IDependManager | dependManager | Dependent manager |
SetProperty(FormatConvertProperty)
Set component property
Declaration
public void SetProperty(FormatConvertProperty value)
Parameters
Type | Name | Description |
---|---|---|
FormatConvertProperty | value | Input parameter |
SetProperty<T>(T)
Set component property
Declaration
public void SetProperty<T>(T value)
where T : class, IBaseProperty
Parameters
Type | Name | Description |
---|---|---|
T | value | Input parameter |
Type Parameters
Name | Description |
---|---|
T | IBaseProperty inherited class |
SetStreamDelayToDefault(IExternalColorStream)
Configure stream delay settings from config file
Declaration
public void SetStreamDelayToDefault(IExternalColorStream externalSource = null)
Parameters
Type | Name | Description |
---|---|---|
IExternalColorStream | externalSource |
StartPlayback(String)
Start playback of the recording file from the specified path
Declaration
public void StartPlayback(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Directory path of recording file to playback |
StartStream(Boolean)
Start streaming
Declaration
public void StartStream(bool isProcessTexture = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isProcessTexture | isProcessTexture is process of Texture2D conversion executed for camera data |
StartStream(ResolutionProperty, Boolean)
Start streaming
Declaration
public void StartStream(ResolutionProperty configuration, bool isProcessTexture = true)
Parameters
Type | Name | Description |
---|---|---|
ResolutionProperty | configuration | Resolution used for streaming |
System.Boolean | isProcessTexture | If true, performs Texture2D conversion on camera data |
StartStream(ResolutionProperty, List<IColorMetadataProperty>, Boolean)
Start streaming
Declaration
public void StartStream(ResolutionProperty configuration, List<IColorMetadataProperty> metadataProperties, bool isProcessTexture = true)
Parameters
Type | Name | Description |
---|---|---|
ResolutionProperty | configuration | Resolution used for streaming |
System.Collections.Generic.List<TofAr.V0.Color.IColorMetadataProperty> | metadataProperties | Meta data used for streaming |
System.Boolean | isProcessTexture | If true, performs Texture2D conversion on camera data |
StopPlayback()
Stop playback of recording file
Declaration
public void StopPlayback()
StopStream()
Stop streaming
Declaration
public void StopStream()
StopStream(Boolean)
Stop streaming
Declaration
public void StopStream(bool isRestart = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isRestart | If true, stops stream and instantly restarts it, if false, stops without restarting |
UnregisterColorPreProcessing(IPreProcessColorData)
Unregister Color data preprocessing
Declaration
public void UnregisterColorPreProcessing(IPreProcessColorData preProcessColor)
Parameters
Type | Name | Description |
---|---|---|
IPreProcessColorData | preProcessColor | Data process class |
Events
OnApplicationPausing
Application pausing
Declaration
public static event TofArColorManager.ApplicationPausingEventHandler OnApplicationPausing
Event Type
Type | Description |
---|---|
TofArColorManager.ApplicationPausingEventHandler |
OnApplicationResuming
Application resuming
Declaration
public static event TofArColorManager.ApplicationResumingEventHandler OnApplicationResuming
Event Type
Type | Description |
---|---|
TofArColorManager.ApplicationResumingEventHandler |
OnAvailableResolutionsChanged
Event for when resolution changes
Declaration
public static event TofArColorManager.AvailableResolutionsChanged OnAvailableResolutionsChanged
Event Type
Type | Description |
---|---|
TofArColorManager.AvailableResolutionsChanged |
OnFrameArrived
Notice on arrival of new frame
Declaration
public static event TofArColorManager.FrameArrivedEventHandler OnFrameArrived
Event Type
Type | Description |
---|---|
TofArColorManager.FrameArrivedEventHandler |
OnStreamStarted
Notice on starting of streaming
Declaration
public static event TofArColorManager.StreamStartedEventHandler OnStreamStarted
Event Type
Type | Description |
---|---|
TofArColorManager.StreamStartedEventHandler |
OnStreamStopped
Notice on ending of streaming
Declaration
public static event TofArColorManager.StreamStoppedEventHandler OnStreamStopped
Event Type
Type | Description |
---|---|
TofArColorManager.StreamStoppedEventHandler |