CameraController Class
Namespace: GHIElectronics.TinyCLR.Devices.Camera · Assembly: GHIElectronics.TinyCLR.Devices.Camera
Represents a DCMI / parallel camera interface. Configure timing via SetActiveSettings, Enable the capture engine, then call Capture(byte[], int) to read a frame into a buffer.
public class CameraController : IDisposable
Properties
Provider
public ICameraControllerProvider Provider { get; }
The low-level provider backing this controller.
Methods
GetDefault()
public static CameraController GetDefault()
Returns the default camera controller for this device.
Returns CameraController
FromName(string name)
public static CameraController FromName(string name)
Returns a camera controller identified by its native API name.
| Parameter | Type | Description |
|---|---|---|
name | string |
Returns CameraController
FromProvider(ICameraControllerProvider provider)
public static CameraController FromProvider(ICameraControllerProvider provider)
Creates a controller from a custom ICameraControllerProvider.
| Parameter | Type | Description |
|---|---|---|
provider | ICameraControllerProvider |
Returns CameraController
Dispose()
public void Dispose()
Releases the underlying provider.
SetActiveSettings(CaptureRate captureRate, bool horizontalSyncPolarity, bool verticalSyncPolarity, bool pixelClockPolarity, SynchronizationMode synchronizationMode, ExtendedDataMode extendedDataMode, uint sourceClock)
public void SetActiveSettings(CaptureRate captureRate, bool horizontalSyncPolarity, bool verticalSyncPolarity, bool pixelClockPolarity, SynchronizationMode synchronizationMode, ExtendedDataMode extendedDataMode, uint sourceClock)
Applies a complete set of DCMI timing/protocol settings.
| Parameter | Type | Description |
|---|---|---|
captureRate | CaptureRate | Per-frame capture rate. |
horizontalSyncPolarity | bool | HSYNC polarity (false = active low). |
verticalSyncPolarity | bool | VSYNC polarity (false = active low). |
pixelClockPolarity | bool | Pixel-clock polarity (false = falling-edge sample). |
synchronizationMode | SynchronizationMode | Hardware vs. embedded synchronization. |
extendedDataMode | ExtendedDataMode | Data bus width. |
sourceClock | uint | Source clock feeding the camera, in Hz. |
Capture(byte[] data, int timeoutMillisecond)
public int Capture(byte[] data, int timeoutMillisecond)
Captures one frame into the supplied buffer.
| Parameter | Type | Description |
|---|---|---|
data | byte[] | Destination buffer. Must be large enough for one frame at the configured resolution/format. |
timeoutMillisecond | int | Maximum time to wait for the frame, in milliseconds. |
Returns int — Number of bytes actually captured.
Capture(byte[] data, int offset, int count, int timeoutMillisecond)
public int Capture(byte[] data, int offset, int count, int timeoutMillisecond)
Captures one frame into a slice of the buffer.
| Parameter | Type | Description |
|---|---|---|
data | byte[] | |
offset | int | |
count | int | |
timeoutMillisecond | int |
Returns int
Enable()
public void Enable()
Powers on the capture engine.
Disable()
public void Disable()
Powers off the capture engine.