OpenCV for Unity 3.0.4
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/5.0/index.html ) for the details of the argument of the method.
Loading...
Searching...
No Matches
OpenCVForUnity.Extensions.SourceToMat.MatSourceBase Class Reference

Concrete IMatSource that drives an injected IFrameGrabber and an optional IFrameOrientationCorrector. Owns _frameMat, a lazy _rotatedBuffer used only for user 90-degree rotation, and a lazy orientation scratch used only when orientation correction needs a swapped-size buffer and the output color format differs from the grabber. When user rotation is off, _rotatedBuffer is released. When the orientation scratch is not required, it is released. Grabber frames from IFrameGrabber.TryGrab are treated as read-only. Implements IMatTransformable only; IMatUpdateFPSControllable is implemented by derived sources such as ImageFileMatSource and by integration-layer mat sources that throttle texture readback. Also implements IMatSourceEvents, IMatSourceTickable, IMatSourceReinitializable, and IMatSourceDerivedFrames for host event subscription, per-tick acquisition, source-swap re-initialization, and derived frame registration. More...

Public Member Functions

 MatSourceBase (IFrameGrabber grabber, IFrameOrientationCorrector orientationCorrector=null)
 Initializes a new instance of the MatSourceBase class.
 
PlaybackRestoreMode CapturePlaybackRestoreMode ()
 Captures the current playback state as a PlaybackRestoreMode for re-initialization.
Returns
PlaybackRestoreMode.Playing when playing, PlaybackRestoreMode.Paused when paused, otherwise PlaybackRestoreMode.Ready.

 
void Dispose ()
 
async ValueTask DisposeAsync ()
 Asynchronously releases resources. Required on single-threaded hosts (for example browser/WebAssembly targets); do not use Dispose on those hosts.
 
Task InitializeAsync (CancellationToken cancellationToken=default)
 Initializes the source asynchronously and leaves playback in MatSourceState.Ready.
Parameters
cancellationTokenA token used to cancel the operation.
Returns
A task that completes when initialization finishes.

 
Task InitializeAsync (PlaybackRestoreMode playbackRestoreMode, CancellationToken cancellationToken=default)
 Initializes the source asynchronously and restores the requested playback state before IMatSourceEvents.OnInitialized is raised.
Parameters
playbackRestoreModePlayback state to apply after the grabber is ready.
cancellationTokenA token used to cancel the operation.
Returns
A task that completes when initialization finishes.

 
virtual Task PauseAsync (CancellationToken cancellationToken=default)
 
virtual Task PlayAsync (CancellationToken cancellationToken=default)
 
Task ReinitializeAsync (PlaybackRestoreMode playbackRestoreMode, CancellationToken cancellationToken=default)
 Releases the source when initialized, then initializes again with the requested playback restore mode.
Parameters
playbackRestoreModePlayback state to apply after the grabber is ready.
cancellationTokenA token used to cancel the operation.
Returns
A task that completes when re-initialization finishes.

 
Task ReleaseAsync (CancellationToken cancellationToken=default)
 
virtual Task StopAsync (CancellationToken cancellationToken=default)
 
void SyncDerivedFrameBuffersIfStale (IList< string > pendingLayoutChanges=null)
 Re-applies derived frame outputs whose buffers are stale relative to the current source layout or derived settings.
 
virtual void Tick (float deltaTime=0f)
 
bool TryGetMeta (string key, out object value)
 Attempts to get a meta property value by key.
Parameters
keyThe meta key.
valueWhen this method returns true, the retrieved value; otherwise the default value.
Returns
true when the key is supported and a value is available; otherwise false.

 
bool TrySetMeta (string key, object value)
 Attempts to set a meta property value by key.
Parameters
keyThe meta key.
valueThe value to set.
Returns
true when the key is supported and the value was applied; otherwise false.

 
- Public Member Functions inherited from OpenCVForUnity.Extensions.SourceToMat.IMatSource
- Public Member Functions inherited from OpenCVForUnity.Extensions.SourceToMat.IMatMetaProperties
- Public Member Functions inherited from OpenCVForUnity.Extensions.SourceToMat.IMatSourceTickable
- Public Member Functions inherited from OpenCVForUnity.Extensions.SourceToMat.IMatSourceReinitializable

Protected Member Functions

void ClearDidUpdateThisFrame ()
 Clears DidUpdateThisFrame for the current tick.
 
virtual SourceToMatColorFormat InferGrabberColorFormat (Mat workingMat)
 Resolves the grabber frame color format used for output conversion. Override in derived sources when channel order is known and differs from InferColorFormat.
 
void RaiseError (SourceToMatErrorCode errorCode, string message)
 Raises OnErrorOccurred with the specified error code and message.
 
void StopPlayingCore ()
 Stops playback without async overhead. Shared by StopAsync and derived Tick handlers.
 
virtual void SyncGrabberBeforeOpen ()
 Copies source-specific Requested* settings onto the injected grabber immediately before IFrameGrabber.OpenAsync. Derived file-based sources override this hook; the default is a no-op.
 

Properties

SourceToMatColorFormat BaseColorFormat [get]
 Gets the native color format produced by the underlying grabber before output conversion.
 
DerivedFrameCollection DerivedFrames [get]
 Gets the optional derived frame collection. When empty, tick processing matches the source layer only.
 
bool DidUpdateThisFrame [get]
 
bool FlipHorizontal [get, set]
 Gets or sets whether to flip the image horizontally.
 
bool FlipVertical [get, set]
 Gets or sets whether to flip the image vertically.
 
Mat FrameMat [get]
 
int Height [get]
 Gets the current frame height in pixels.
 
int InitTimeoutMs [get, set]
 Gets or sets the initialization wait timeout in milliseconds.
 
bool IsInitialized [get]
 Gets a value indicating whether the source has been initialized and is ready for playback control. Does not include MatSourceState.Initializing.
 
bool IsInitializing [get]
 Gets a value indicating whether initialization is in progress (MatSourceState.Initializing).
 
bool IsPaused [get]
 Gets a value indicating whether frame acquisition is paused.
 
bool IsPlaying [get]
 Gets a value indicating whether frame acquisition is active.
 
Task LifecycleTask [get]
 Gets a task that completes when the current lifecycle operation finishes. Queued operations run sequentially; this reflects the tail of that chain.
 
SourceToMatColorFormat OutputColorFormat [get, set]
 Gets or sets the output color format. When changed after initialization, the output FrameMat channel layout (Mat type) may change and implementations that raise IMatSourceEvents.OnFrameMatLayoutChanged do so after the new layout is committed.
 
bool Rotate90Degree [get, set]
 Gets or sets whether to rotate the image 90 degrees clockwise. When changed after initialization, the output IMatSource.FrameMat layout (width, height) changes and implementations that raise IMatSourceEvents.OnFrameMatLayoutChanged do so after the new layout is committed.
 
MatSourceState State [get]
 Gets the current lifecycle state.
 
int Width [get]
 Gets the current frame width in pixels.
 
- Properties inherited from OpenCVForUnity.Extensions.SourceToMat.IMatSource
- Properties inherited from OpenCVForUnity.Extensions.SourceToMat.IMatTransformable
- Properties inherited from OpenCVForUnity.Extensions.SourceToMat.IMatSourceDerivedFrames

Events

Action< string > OnDerivedFrameLayoutChanged
 
Action OnDisposed
 
Action< SourceToMatErrorCode, string > OnErrorOccurred
 
Action OnFrameMatLayoutChanged
 
Action OnFrameMatUpdated
 
Action OnInitialized
 
Action OnReleased
 
- Events inherited from OpenCVForUnity.Extensions.SourceToMat.IMatSourceEvents
Action< string > OnDerivedFrameLayoutChanged
 Occurs after initialization when a derived frame output layout (columns, rows, type) changes without removing the derived frame, on the thread that commits the layout change. Not raised on the first derived layout establishment during IMatSource.InitializeAsync. At invocation, the derived frame's FrameMat matches the committed output layout. Layout-affecting settings updates may commit immediately without waiting for the next IMatSourceTickable.Tick.
 
Action OnDisposed
 Occurs when IDisposable.Dispose or IAsyncDisposable.DisposeAsync completes and the source enters MatSourceState.Destroyed.
 
Action< SourceToMatErrorCode, string > OnErrorOccurred
 Occurs for expected runtime failures with a SourceToMatErrorCode and message, on the thread that detected the failure.
 
Action OnFrameMatLayoutChanged
 Occurs after initialization when the output IMatSource.FrameMat layout (cols, rows, type) changes without a full release cycle, on the thread that commits the layout change. Not raised on the first layout establishment during IMatSource.InitializeAsync. When derived frames are registered, their output buffers are synced to the new primary layout before this event is raised.
 
Action OnFrameMatUpdated
 Occurs at the end of IMatSourceTickable.Tick when IMatSource.DidUpdateThisFrame is true for that tick, after any registered derived frames are evaluated.
 
Action OnInitialized
 Occurs when an initialization cycle completes and playback state (Ready / Playing / Paused) is determined, on the thread that completes the underlying async operation.
 
Action OnReleased
 Occurs when IMatSource.ReleaseAsync completes and the source returns to MatSourceState.Uninitialized, on the thread that completes the underlying async operation.
 

Detailed Description

Concrete IMatSource that drives an injected IFrameGrabber and an optional IFrameOrientationCorrector. Owns _frameMat, a lazy _rotatedBuffer used only for user 90-degree rotation, and a lazy orientation scratch used only when orientation correction needs a swapped-size buffer and the output color format differs from the grabber. When user rotation is off, _rotatedBuffer is released. When the orientation scratch is not required, it is released. Grabber frames from IFrameGrabber.TryGrab are treated as read-only. Implements IMatTransformable only; IMatUpdateFPSControllable is implemented by derived sources such as ImageFileMatSource and by integration-layer mat sources that throttle texture readback. Also implements IMatSourceEvents, IMatSourceTickable, IMatSourceReinitializable, and IMatSourceDerivedFrames for host event subscription, per-tick acquisition, source-swap re-initialization, and derived frame registration.

Lifecycle events:

Async lifecycle handlers may run on a different thread than the caller when internal paths use ConfigureAwait(false). Do not use host main-thread-only APIs in the handler unless you know the completion thread; marshal if needed.

Constructor & Destructor Documentation

◆ MatSourceBase()

OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.MatSourceBase ( IFrameGrabber grabber,
IFrameOrientationCorrector orientationCorrector = null )

Initializes a new instance of the MatSourceBase class.

Parameters
grabberThe frame grabber that supplies raw frames.
orientationCorrectorOptional orientation corrector applied after IFrameGrabber.TryGrab. When null, frames pass through without orientation correction.

Member Function Documentation

◆ CapturePlaybackRestoreMode()

PlaybackRestoreMode OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.CapturePlaybackRestoreMode ( )

Captures the current playback state as a PlaybackRestoreMode for re-initialization.

Returns
PlaybackRestoreMode.Playing when playing, PlaybackRestoreMode.Paused when paused, otherwise PlaybackRestoreMode.Ready.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSourceReinitializable.

◆ ClearDidUpdateThisFrame()

void OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.ClearDidUpdateThisFrame ( )
protected

Clears DidUpdateThisFrame for the current tick.

◆ Dispose()

void OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.Dispose ( )

Single-threaded hosts: This method performs synchronous blocking waits, which can cause deadlocks or hangs on runtimes without a thread pool (for example browser/WebAssembly targets). On such hosts, product teardown must call DisposeAsync; do not use this method. There is no safe way to wait for incomplete async work on a single-threaded host from IDisposable.Dispose.

Cancels in-flight initialization, waits for LifecycleTask (including on timeout), then waits for IFrameGrabber.CloseAsync (including on timeout). Also disposes the grabber when it implements IDisposable so native / device resources are released even if close did not finish.

◆ DisposeAsync()

async ValueTask OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.DisposeAsync ( )

Asynchronously releases resources. Required on single-threaded hosts (for example browser/WebAssembly targets); do not use Dispose on those hosts.

Cancels in-flight initialization, waits for LifecycleTask (including on timeout), then waits for IFrameGrabber.CloseAsync (including on timeout). Also disposes the grabber when it implements IDisposable so native / device resources are released even if close did not finish.

Unlike ReleaseAsync, close is not awaited directly; a poll loop with Task.Yield lets the host SynchronizationContext pump while waiting. Do not use ConfigureAwait(false) on these waits so single-threaded hosts can resume on the captured host SynchronizationContext.

◆ InferGrabberColorFormat()

virtual SourceToMatColorFormat OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.InferGrabberColorFormat ( Mat workingMat)
protectedvirtual

Resolves the grabber frame color format used for output conversion. Override in derived sources when channel order is known and differs from InferColorFormat.

Parameters
workingMatThe frame returned by the grabber.
Returns
The source color format of workingMat .

Reimplemented in OpenCVForUnity.UnityIntegration.Helper.SourceToMat.AsyncGPUReadbackMatSource, OpenCVForUnity.UnityIntegration.Helper.SourceToMat.UnityVideoPlayerMatSource, and OpenCVForUnity.UnityIntegration.Helper.SourceToMat.WebCamTextureMatSource.

◆ InitializeAsync() [1/2]

Task OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.InitializeAsync ( CancellationToken cancellationToken = default)

Initializes the source asynchronously and leaves playback in MatSourceState.Ready.

Parameters
cancellationTokenA token used to cancel the operation.
Returns
A task that completes when initialization finishes.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSource.

◆ InitializeAsync() [2/2]

Task OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.InitializeAsync ( PlaybackRestoreMode playbackRestoreMode,
CancellationToken cancellationToken = default )

Initializes the source asynchronously and restores the requested playback state before IMatSourceEvents.OnInitialized is raised.

Parameters
playbackRestoreModePlayback state to apply after the grabber is ready.
cancellationTokenA token used to cancel the operation.
Returns
A task that completes when initialization finishes.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSourceReinitializable.

◆ PauseAsync()

virtual Task OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.PauseAsync ( CancellationToken cancellationToken = default)
virtual

Pauses frame acquisition asynchronously. When already paused, completes immediately without error. When MatSourceState.Initializing, completes immediately without changing state.

Parameters
cancellationTokenA token used to cancel the operation.
Returns
A task that completes when playback has been paused.

When State is MatSourceState.Initializing, completes immediately without changing state and logs a one-time warning per process.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSource.

Reimplemented in OpenCVForUnity.Extensions.SourceToMat.ImageFileMatSource, OpenCVForUnity.Extensions.SourceToMat.VideoCaptureMatSource, OpenCVForUnity.UnityIntegration.Helper.SourceToMat.AsyncGPUReadbackMatSource, OpenCVForUnity.UnityIntegration.Helper.SourceToMat.UnityVideoPlayerMatSource, and OpenCVForUnity.UnityIntegration.Helper.SourceToMat.WebCamTextureMatSource.

◆ PlayAsync()

virtual Task OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.PlayAsync ( CancellationToken cancellationToken = default)
virtual

Starts or resumes frame acquisition asynchronously. When already playing, completes immediately without error. When MatSourceState.Initializing, completes immediately without changing state.

Parameters
cancellationTokenA token used to cancel the operation.
Returns
A task that completes when playback has started.

When State is MatSourceState.Initializing, completes immediately without changing state and logs a one-time warning per process.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSource.

Reimplemented in OpenCVForUnity.Extensions.SourceToMat.ImageFileMatSource, OpenCVForUnity.Extensions.SourceToMat.VideoCaptureMatSource, OpenCVForUnity.UnityIntegration.Helper.SourceToMat.AsyncGPUReadbackMatSource, OpenCVForUnity.UnityIntegration.Helper.SourceToMat.UnityVideoPlayerMatSource, and OpenCVForUnity.UnityIntegration.Helper.SourceToMat.WebCamTextureMatSource.

◆ RaiseError()

void OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.RaiseError ( SourceToMatErrorCode errorCode,
string message )
protected

Raises OnErrorOccurred with the specified error code and message.

Parameters
errorCodeThe expected runtime error code.
messageA human-readable error message.

◆ ReinitializeAsync()

Task OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.ReinitializeAsync ( PlaybackRestoreMode playbackRestoreMode,
CancellationToken cancellationToken = default )

Releases the source when initialized, then initializes again with the requested playback restore mode.

Parameters
playbackRestoreModePlayback state to apply after the grabber is ready.
cancellationTokenA token used to cancel the operation.
Returns
A task that completes when re-initialization finishes.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSourceReinitializable.

◆ ReleaseAsync()

Task OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.ReleaseAsync ( CancellationToken cancellationToken = default)

Releases underlying resources and returns the source to an uninitialized state. When already uninitialized and the grabber is closed, completes immediately without error.

Parameters
cancellationTokenA token used to cancel the operation.
Returns
A task that completes when resources have been released.

When already MatSourceState.Uninitialized and the grabber is closed, completes immediately without error. When State is MatSourceState.Initializing, cancels in-flight initialization and still completes release (OnReleased).

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSource.

◆ StopAsync()

virtual Task OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.StopAsync ( CancellationToken cancellationToken = default)
virtual

Stops frame acquisition asynchronously. When already in the ready (not playing) state, completes immediately without error. When MatSourceState.Initializing, completes immediately without changing state.

Parameters
cancellationTokenA token used to cancel the operation.
Returns
A task that completes when playback has stopped.

When State is MatSourceState.Initializing, completes immediately without changing state and logs a one-time warning per process.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSource.

Reimplemented in OpenCVForUnity.Extensions.SourceToMat.ImageFileMatSource, OpenCVForUnity.Extensions.SourceToMat.VideoCaptureMatSource, OpenCVForUnity.UnityIntegration.Helper.SourceToMat.AsyncGPUReadbackMatSource, OpenCVForUnity.UnityIntegration.Helper.SourceToMat.UnityVideoPlayerMatSource, and OpenCVForUnity.UnityIntegration.Helper.SourceToMat.WebCamTextureMatSource.

◆ StopPlayingCore()

void OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.StopPlayingCore ( )
protected

Stops playback without async overhead. Shared by StopAsync and derived Tick handlers.

◆ SyncDerivedFrameBuffersIfStale()

void OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.SyncDerivedFrameBuffersIfStale ( IList< string > pendingLayoutChanges = null)

Re-applies derived frame outputs whose buffers are stale relative to the current source layout or derived settings.

Called automatically after primary layout re-establishment and after layout-affecting DerivedFrameCollection.AddOrUpdateSettings while this source is initialized. Does not depend on Tick or DidUpdateThisFrame, so DerivedFrameSettings.ProcessEveryNFrames skip slots cannot delay layout sync. When pendingLayoutChanges is non-null, changed derived frame names are appended instead of raising OnDerivedFrameLayoutChanged immediately.

Parameters
pendingLayoutChangesWhen non-null, collects derived frame names whose output layout changed instead of raising events.

◆ SyncGrabberBeforeOpen()

virtual void OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.SyncGrabberBeforeOpen ( )
protectedvirtual

◆ Tick()

virtual void OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.Tick ( float deltaTime = 0f)
virtual

Advances frame acquisition when the source is playing. Sets IMatSource.DidUpdateThisFrame only when a new frame is acquired.

Parameters
deltaTimeElapsed time since the previous tick, in seconds.

Sets DidUpdateThisFrame only when IFrameGrabber.TryGrab returns a new frame. When IFrameGrabber.TryGrab returns false, this tick is a no-op (not an error). Does not call IFrameOrientationCorrector.NotifyDisplayOrientationChanged; the host is responsible for that. Registered DerivedFrames are still evaluated when IFrameGrabber.TryGrab does not succeed so per-tick derived-frame flags such as IDerivedFrame.DidUpdateThisFrame stay in sync. Sources without a native frame rate (for example still images) may throttle Tick in a derived type that implements IMatUpdateFPSControllable.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSourceTickable.

Reimplemented in OpenCVForUnity.Extensions.SourceToMat.ImageFileMatSource, OpenCVForUnity.Extensions.SourceToMat.VideoCaptureMatSource, OpenCVForUnity.UnityIntegration.Helper.SourceToMat.AsyncGPUReadbackMatSource, and OpenCVForUnity.UnityIntegration.Helper.SourceToMat.UnityVideoPlayerMatSource.

◆ TryGetMeta()

bool OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.TryGetMeta ( string key,
out object value )

Attempts to get a meta property value by key.

Parameters
keyThe meta key.
valueWhen this method returns true, the retrieved value; otherwise the default value.
Returns
true when the key is supported and a value is available; otherwise false.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatMetaProperties.

◆ TrySetMeta()

bool OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.TrySetMeta ( string key,
object value )

Attempts to set a meta property value by key.

Parameters
keyThe meta key.
valueThe value to set.
Returns
true when the key is supported and the value was applied; otherwise false.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatMetaProperties.

Property Documentation

◆ BaseColorFormat

SourceToMatColorFormat OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.BaseColorFormat
get

Gets the native color format produced by the underlying grabber before output conversion.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSource.

◆ DerivedFrames

DerivedFrameCollection OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.DerivedFrames
get

Gets the optional derived frame collection. When empty, tick processing matches the source layer only.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSourceDerivedFrames.

◆ DidUpdateThisFrame

bool OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.DidUpdateThisFrame
get

Gets a value indicating whether FrameMat was updated during the most recent tick.

true only when IFrameGrabber.TryGrab succeeds during the most recent Tick. Failed grabs leave this false while FrameMat keeps the previous content.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSource.

◆ FlipHorizontal

bool OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.FlipHorizontal
getset

Gets or sets whether to flip the image horizontally.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatTransformable.

◆ FlipVertical

bool OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.FlipVertical
getset

Gets or sets whether to flip the image vertically.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatTransformable.

◆ FrameMat

Mat OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.FrameMat
get

Gets the owned reusable output buffer. Do not dispose this Mat.The returned Mat is reused every frame. Disposing it is unsupported. Implementations may log a warning and recreate the buffer on the next update when it was disposed accidentally. While MatSourceState.Initializing, uninitialized, or released, returns null.

When State is MatSourceState.Ready, returns a black placeholder buffer with the current output layout and transforms applied. When State is MatSourceState.Initializing, uninitialized, or released, returns null.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSource.

◆ Height

int OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.Height
get

Gets the current frame height in pixels.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSource.

◆ InitTimeoutMs

int OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.InitTimeoutMs
getset

Gets or sets the initialization wait timeout in milliseconds.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSource.

◆ IsInitialized

bool OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.IsInitialized
get

Gets a value indicating whether the source has been initialized and is ready for playback control. Does not include MatSourceState.Initializing.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSource.

◆ IsInitializing

bool OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.IsInitializing
get

Gets a value indicating whether initialization is in progress (MatSourceState.Initializing).

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSource.

◆ IsPaused

bool OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.IsPaused
get

Gets a value indicating whether frame acquisition is paused.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSource.

◆ IsPlaying

bool OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.IsPlaying
get

Gets a value indicating whether frame acquisition is active.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSource.

◆ LifecycleTask

Task OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.LifecycleTask
get

Gets a task that completes when the current lifecycle operation finishes. Queued operations run sequentially; this reflects the tail of that chain.

◆ OutputColorFormat

SourceToMatColorFormat OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.OutputColorFormat
getset

Gets or sets the output color format. When changed after initialization, the output FrameMat channel layout (Mat type) may change and implementations that raise IMatSourceEvents.OnFrameMatLayoutChanged do so after the new layout is committed.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSource.

◆ Rotate90Degree

bool OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.Rotate90Degree
getset

Gets or sets whether to rotate the image 90 degrees clockwise. When changed after initialization, the output IMatSource.FrameMat layout (width, height) changes and implementations that raise IMatSourceEvents.OnFrameMatLayoutChanged do so after the new layout is committed.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatTransformable.

◆ State

MatSourceState OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.State
get

Gets the current lifecycle state.

◆ Width

int OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.Width
get

Gets the current frame width in pixels.

Implements OpenCVForUnity.Extensions.SourceToMat.IMatSource.

Event Documentation

◆ OnDerivedFrameLayoutChanged

Action<string> OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.OnDerivedFrameLayoutChanged

◆ OnDisposed

Action OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.OnDisposed

◆ OnErrorOccurred

Action<SourceToMatErrorCode, string> OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.OnErrorOccurred

◆ OnFrameMatLayoutChanged

Action OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.OnFrameMatLayoutChanged

◆ OnFrameMatUpdated

Action OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.OnFrameMatUpdated

◆ OnInitialized

Action OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.OnInitialized

◆ OnReleased

Action OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.OnReleased


The documentation for this class was generated from the following file: