Camera

Camera

This API allows you to control the configuration of attached USB UVC capable Cameras.

Methods

(async) getAbsoluteFocus() → {Promise.<Number>}

Get the current value of the focal distance for the cameras absolute-focus setting.

(async) getAbsoluteFocusDefault() → {Promise.<Number>}

Get the default value for the absolute focus setting for the camera.

(async) getAbsoluteFocusInfo() → {Promise.<module:Camera~CameraCapabilities>}

Query the camera for info about it's absolute-focus capabilities. This needs to be checked prior to make any calls as the camera may not support this feature.

(async) getAbsoluteFocusRange() → {Promise.<module:Camera~CameraRange>}

Get the supported range of the absolute focus setting for the camera.

(async) getAutoFocus() → {Promise.<Boolean>}

Query the state of the auto focus.

(async) getAutoFocusDefault() → {Promise.<Boolean>}

Query the default state of the auto focus feature.

(async) getAutoFocusInfo() → {Promise.<module:Camera~CameraCapabilities>}

Query the camera for info about it's auto-focus capabilities. This needs to be checked prior to make any calls as the camera may not support this feature.

Example
await Agent.onReadyAsync();
const result = await agent.Camera.getAutoFocusInfo();
console.log(result);

// Should print: { GET: true, SET: true, AUTO_ENABLED: false, AUTO_UPDATE: false, ASYNC: false, DISABLED: false }

(async) getBrightness() → {Promise.<Number>}

Get the camera brightness, you should validate the cameras capabilities before querying this function.

(async) getBrightnessDefault() → {Promise.<Number>}

Get the default brightness setting for the camera

(async) getBrightnessInfo() → {Promise.<module:Camera~CameraCapabilities>}

Query the camera for info about it's brightness capabilities. This needs to be checked prior to make any calls as the camera may not support this feature.

Example
await Agent.onReadyAsync();
const result = await agent.Camera.getBrightnessInfo();
console.log(result);

// Should print: { GET: true, SET: true, AUTO_ENABLED: false, AUTO_UPDATE: false, ASYNC: false, DISABLED: false }

(async) getBrightnessRange() → {Promise.<module:Camera~CameraRange>}

Get the min an max brightness values for the camera.

(async) getCameras()

Query for the attached UVC Capable cameras.

Example
await Agent.onReadyAsync();
const cameras = await Agent.Camera.getCameras();
console.log(`We found ${cameras.length} cameras.`);

(async) getPowerLineFrequency() → {Promise.<String>}

Get the Power Line Frequency setting.

(async) getPowerLineFrequencyDefault() → {Promise.<String>}

Query the camera for the default power line frequency setting.

(async) getPowerLineFrequencyInfo() → {Promise.<module:Camera~CameraCapabilities>}

Query the camera for info about its Power Line Frequency capabilities.

(async) setAbsoluteFocus(value) → {Promise.<undefined>}

Set the value of the absolute-focus. You should validate the camera supports this capability as well as what is the expected range prior to calling this function.

Parameters:
Name Type Description
value Number

The focal distance to set the absolute focus to.

(async) setAutoFocus(state) → {Promise.<undefined>}

Set the state of the auto focus feature.

Parameters:
Name Type Description
state Boolean

If the auto focus is enabled or disabled.

(async) setBrightness(value) → {Promise.<undefined>}

Set the camera brightness, you should validate the range and the cameras capabilities prior to using this function.

Parameters:
Name Type Description
value Number

The value of the brightness to set.

(async) setPowerLineFrequency(value) → {Promise.<undefined>}

Set the Power Line Frequency

Parameters:
Name Type Description
value CameraPowerLineFrequency

The power line frequency setting to use.

Example
await Agent.onReadyAsync();
const {PowerLineFrequency} = Agent.Camera;
await Agent.Camera.setPowerLineFrequency(PowerLineFrequency['50Hz']);