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 Namespace Reference

Namespaces

namespace  DerivedFrame
 
namespace  Grabbers
 
namespace  Options
 

Classes

struct  CameraDeviceInfo
 Describes a camera device entry for device enumeration. More...
 
struct  CameraResolution
 Describes a supported camera resolution mode. More...
 
class  CameraResolutionUtils
 Optional helpers for working with CameraResolution lists returned by camera sources. More...
 
class  FPSThrottle
 Throttles callbacks to a target frame rate, or invokes every tick when the target FPS is zero or negative. Used internally by image mat sources and video grabbers; not a primary public contract. More...
 
interface  ICameraFacingControllable
 Front or back camera facing selection for camera sources. More...
 
interface  ICameraMatSource
 Camera-specific capabilities for IMatSource. More...
 
interface  IFrameOrientationCorrector
 Applies source-specific orientation correction after IFrameGrabber.TryGrab. More...
 
interface  IImageFileMatSource
 Still-image-specific capabilities for IMatSource. More...
 
class  ImageFileMatSource
 Still-image MatSourceBase that implements IImageFileMatSource and IMatUpdateFPSControllable. More...
 
interface  IMatMetaProperties
 Optional meta properties for SourceToMat sources. Unsupported keys return false from try methods without throwing. More...
 
interface  IMatSource
 Base contract for converting a media source into an owned, reusable FrameMat buffer. More...
 
interface  IMatSourceDerivedFrames
 Optional derived frame outputs registered on a IMatSource implementation. More...
 
interface  IMatSourceEvents
 Lifecycle, frame, and error events raised by a IMatSource implementation. More...
 
interface  IMatSourceReinitializable
 Initialization and re-initialization with playback state restoration for a IMatSource implementation. More...
 
interface  IMatSourceTickable
 Per-tick frame acquisition for a IMatSource implementation. More...
 
interface  IMatTransformable
 User-controlled rotation and flip operations applied to the output IMatSource.FrameMat. More...
 
interface  IMatUpdateFPSControllable
 Controls how often the output IMatSource.FrameMat is updated while playing, for sources that have no native frame rate (for example still images or arbitrary texture readback). More...
 
class  InitTimeoutBudget
 Shared initialization timeout budget for Grabbers.IFrameGrabber.OpenAsync and first-frame wait. Time spent inside RunOutsideTimeoutAsync does not consume the budget (for example long-running host prompts such as OS permission dialogs). A timeout of zero or less means unlimited. More...
 
interface  ISourceToMatErrorSource
 Optional capability for components that report expected runtime failures through SourceToMatErrorCode. More...
 
interface  IVideoCaptureMatSource
 OpenCV VideoCapture-specific capabilities for file-based video sources. More...
 
interface  IVideoFileMatSource
 Video-file playback capabilities shared by file-based video sources. More...
 
class  MatSourceBase
 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...
 
class  SourceToMatException
 Thrown for SourceToMat contract violations (for example, use after IDisposable.Dispose, or invalid state transitions). Expected runtime failures are reported via SourceToMatErrorCode on the error event instead. More...
 
class  SourceToMatHostMarshaling
 Shared helpers for captured main-thread affinity and marshaling in host-integrated SourceToMat grabbers. More...
 
class  SourceToMatHostWait
 Host message-loop wait loop for SourceToMat grabber Open waits. More...
 
class  SourceToMatMetaKeys
 Engine-independent meta property keys for IMatMetaProperties. Engine-specific keys belong in the host integration layer. More...
 
class  SourceToMatOpenOptionsProjection
 Projects one-shot *OpenOptions DTO values onto matching Requested* source properties. More...
 
struct  SourceToMatSynchronizationContextScope
 Temporarily restores a captured SynchronizationContext for the current async flow. More...
 
class  SourceToMatUtils
 Static helpers for color-format conversion and Mat geometric transforms used by SourceToMat. More...
 
class  SourceToMatWait
 Shared wait loop for SourceToMat initialization and first-frame waits. More...
 
class  VideoCaptureMatSource
 OpenCV VideoCapture-backed MatSourceBase that implements IVideoCaptureMatSource. More...
 

Enumerations

enum  MatSourceState {
  Uninitialized = 0 ,
  Initializing ,
  Ready ,
  Playing ,
  Paused ,
  Destroyed
}
 Lifecycle state of an IMatSource implementation. More...
 
enum  PlaybackRestoreMode {
  Ready ,
  Playing ,
  Paused
}
 Target playback state to restore after an initialization or re-initialization cycle. More...
 
enum  SourceToMatColorFormat : int {
  GRAY = 0 ,
  RGB ,
  BGR ,
  RGBA ,
  BGRA
}
 Pixel channel layouts supported as input or output by SourceToMat sources. More...
 
enum  SourceToMatErrorCode : int {
  UNKNOWN = 0 ,
  CAMERA_DEVICE_NOT_EXIST ,
  CAMERA_PERMISSION_DENIED ,
  CAMERA_DEVICE_NOT_FOUND ,
  CAMERA_CANT_OPEN ,
  CAMERA_RESOLUTION_UNSUPPORTED ,
  CAMERA_START_FAILED ,
  VIDEO_FILE_NOT_EXIST ,
  VIDEO_FILE_CANT_OPEN ,
  FILE_PATH_NOT_RESOLVED ,
  IMAGE_FILE_NOT_EXIST ,
  IMAGE_FILE_CANT_OPEN ,
  IMAGE_FILE_INVALID ,
  HOST_VIDEO_ERROR ,
  HOST_VIDEO_PREPARE_FAILED ,
  HOST_VIDEO_UNAVAILABLE ,
  SOURCE_TEXTURE_IS_NULL ,
  SOURCE_TEXTURE_FORMAT_UNSUPPORTED ,
  GPU_READBACK_UNSUPPORTED ,
  GPU_READBACK_FAILED ,
  RENDER_TARGET_FORMAT_UNSUPPORTED ,
  RENDER_TARGET_CREATE_FAILED ,
  TIMEOUT ,
  OPERATION_CANCELED ,
  FRAME_GRAB_FAILED ,
  SOURCE_LOST
}
 Error codes reported by SourceToMat sources through the error event. Expected runtime failures use these codes instead of SourceToMatException. More...
 

Enumeration Type Documentation

◆ MatSourceState

Lifecycle state of an IMatSource implementation.

Enumerator
Uninitialized 

Idle state after the underlying grabber has been closed. Initialization in progress is represented by Initializing. Re-initialization is allowed from this state.

Initializing 

Initialize pipeline is in progress (including grabber open).

Ready 

Initialized and ready. Frame acquisition is stopped.

Playing 

Frame acquisition is active.

Paused 

Frame acquisition is paused.

Destroyed 

Disposed. No further operations are allowed.

◆ PlaybackRestoreMode

Target playback state to restore after an initialization or re-initialization cycle.

Enumerator
Ready 

Leave the source in MatSourceState.Ready after initialization (no playback restore).

Playing 

Start playback after initialization completes.

Paused 

Start playback and then pause after initialization completes.

◆ SourceToMatColorFormat

Pixel channel layouts supported as input or output by SourceToMat sources.

Enumerator
GRAY 
RGB 
BGR 
RGBA 
BGRA 

◆ SourceToMatErrorCode

Error codes reported by SourceToMat sources through the error event. Expected runtime failures use these codes instead of SourceToMatException.

Enumerator
UNKNOWN 

Unclassified failure. Use when no more specific code applies; details belong in the event message.

CAMERA_DEVICE_NOT_EXIST 

No camera devices are available.

CAMERA_PERMISSION_DENIED 

Camera access was denied by the platform (permission not granted).

CAMERA_DEVICE_NOT_FOUND 

The requested camera device name or index was not found in the device list.

CAMERA_CANT_OPEN 

A camera device exists but could not be opened (for example, the host capture API or OpenCV VideoCapture.open failed).

CAMERA_RESOLUTION_UNSUPPORTED 

The requested width, height, or frame rate is not supported by the selected camera device.

CAMERA_START_FAILED 

Camera capture was created but did not start delivering frames (other than init timeout).

VIDEO_FILE_NOT_EXIST 

The requested video file path does not resolve to an existing file.

VIDEO_FILE_CANT_OPEN 

The video file exists but could not be opened (for example, OpenCV VideoCapture.isOpened() is false).

FILE_PATH_NOT_RESOLVED 

The file path string is set but the full path could not be resolved by the host environment.

IMAGE_FILE_NOT_EXIST 

The requested image file path does not resolve to an existing file.

IMAGE_FILE_CANT_OPEN 

The image file exists but could not be read (for example, Imgcodecs.imread failed).

IMAGE_FILE_INVALID 

The image file exists but decoded to an empty or invalid matrix (corrupt or unsupported image data).

HOST_VIDEO_ERROR 

The host video player reported an error during prepare or playback.

HOST_VIDEO_PREPARE_FAILED 

Host video prepare did not complete successfully before initialization finished or timed out.

HOST_VIDEO_UNAVAILABLE 

A host video player required by the grabber could not be found or created.

SOURCE_TEXTURE_IS_NULL 

The source texture reference is null at initialization.

SOURCE_TEXTURE_FORMAT_UNSUPPORTED 

The source texture pixel format is not supported for GPU readback or conversion.

GPU_READBACK_UNSUPPORTED 

GPU readback is not supported on the current platform or device.

GPU_READBACK_FAILED 

A GPU readback operation failed during initialization or frame acquisition.

RENDER_TARGET_FORMAT_UNSUPPORTED 

The render target graphics format is not supported for the chosen readback path.

RENDER_TARGET_CREATE_FAILED 

A render target required for frame capture could not be created.

TIMEOUT 

Initialization did not complete within InitTimeoutMs.

OPERATION_CANCELED 

An async operation was canceled via System.Threading.CancellationToken.

FRAME_GRAB_FAILED 

Frame acquisition failed persistently while the source is playing. A single IFrameGrabber.TryGrab returning false (no new frame) is not this error.

SOURCE_LOST 

The capture source was lost during playback (for example, camera unplugged or handle invalidated).