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.IMatSource Interface Reference

Base contract for converting a media source into an owned, reusable FrameMat buffer. More...

Public Member Functions

Task InitializeAsync (CancellationToken cancellationToken=default)
 Initializes the source asynchronously and leaves playback in MatSourceState.Ready.
 
Task PauseAsync (CancellationToken cancellationToken=default)
 Pauses frame acquisition asynchronously. When already paused, completes immediately without error. When MatSourceState.Initializing, completes immediately without changing state.
 
Task PlayAsync (CancellationToken cancellationToken=default)
 Starts or resumes frame acquisition asynchronously. When already playing, completes immediately without error. When MatSourceState.Initializing, completes immediately without changing state.
 
Task 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.
 
Task StopAsync (CancellationToken cancellationToken=default)
 Stops frame acquisition asynchronously. When already in the ready (not playing) state, completes immediately without error. When MatSourceState.Initializing, completes immediately without changing state.
 
- Public Member Functions inherited from OpenCVForUnity.Extensions.SourceToMat.IMatMetaProperties
bool TryGetMeta (string key, out object value)
 Attempts to get a meta property value by key.
 
bool TrySetMeta (string key, object value)
 Attempts to set a meta property value by key.
 

Properties

SourceToMatColorFormat BaseColorFormat [get]
 Gets the native color format produced by the underlying grabber before output conversion.
 
bool DidUpdateThisFrame [get]
 Gets a value indicating whether FrameMat was updated during the most recent tick.
 
Mat FrameMat [get]
 Gets the owned reusable output buffer. Do not dispose this Mat.
 
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.
 
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.
 
int Width [get]
 Gets the current frame width in pixels.
 

Detailed Description

Base contract for converting a media source into an owned, reusable FrameMat buffer.

Single-threaded hosts: Product teardown must call IAsyncDisposable.DisposeAsync; do not use IDisposable.Dispose on browser/WebAssembly targets. IDisposable.Dispose remains for Editor and other multi-threaded hosts. There is no safe way to wait for incomplete async work on a single-threaded host from IDisposable.Dispose.

Member Function Documentation

◆ InitializeAsync()

Task OpenCVForUnity.Extensions.SourceToMat.IMatSource.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.

Implemented in OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.

◆ PauseAsync()

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

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.

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

◆ PlayAsync()

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

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.

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

◆ ReleaseAsync()

Task OpenCVForUnity.Extensions.SourceToMat.IMatSource.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.

Implemented in OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.

◆ StopAsync()

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

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.

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

Property Documentation

◆ BaseColorFormat

SourceToMatColorFormat OpenCVForUnity.Extensions.SourceToMat.IMatSource.BaseColorFormat
get

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

Implemented in OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.

◆ DidUpdateThisFrame

bool OpenCVForUnity.Extensions.SourceToMat.IMatSource.DidUpdateThisFrame
get

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

Implemented in OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.

◆ FrameMat

Mat OpenCVForUnity.Extensions.SourceToMat.IMatSource.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.

Implemented in OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.

◆ Height

int OpenCVForUnity.Extensions.SourceToMat.IMatSource.Height
get

Gets the current frame height in pixels.

Implemented in OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.

◆ InitTimeoutMs

int OpenCVForUnity.Extensions.SourceToMat.IMatSource.InitTimeoutMs
getset

Gets or sets the initialization wait timeout in milliseconds.

Implemented in OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.

◆ IsInitialized

bool OpenCVForUnity.Extensions.SourceToMat.IMatSource.IsInitialized
get

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

Implemented in OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.

◆ IsInitializing

bool OpenCVForUnity.Extensions.SourceToMat.IMatSource.IsInitializing
get

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

Implemented in OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.

◆ IsPaused

bool OpenCVForUnity.Extensions.SourceToMat.IMatSource.IsPaused
get

Gets a value indicating whether frame acquisition is paused.

Implemented in OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.

◆ IsPlaying

bool OpenCVForUnity.Extensions.SourceToMat.IMatSource.IsPlaying
get

Gets a value indicating whether frame acquisition is active.

Implemented in OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.

◆ OutputColorFormat

SourceToMatColorFormat OpenCVForUnity.Extensions.SourceToMat.IMatSource.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.

Implemented in OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.

◆ Width

int OpenCVForUnity.Extensions.SourceToMat.IMatSource.Width
get

Gets the current frame width in pixels.

Implemented in OpenCVForUnity.Extensions.SourceToMat.MatSourceBase.


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