Methods
captureBrightness() → {number}
Captures the brightness level from the video feed.
- Source:
Returns:
The brightness level.
- Type
- number
captureColor() → {Array}
Captures the color at the center of the video feed.
- Source:
Returns:
An array containing RGB values.
- Type
- Array
captureLightLevel() → {number}
Captures the light level from the video feed.
- Source:
Returns:
The brightness level.
- Type
- number
captureSoundLevel() → {number}
Captures the current sound level.
- Source:
Returns:
The current sound level.
- Type
- number
getAccelerationWithGravity() → {Object|null}
Retrieves the current acceleration data including gravity.
- Source:
Returns:
An object containing acceleration data or null if unavailable.
- Type
- Object | null
getGeolocation(position)
Callback function to handle successful geolocation retrieval.
Parameters:
Name | Type | Description |
---|---|---|
position |
Position | The position object containing latitude and longitude. |
- Source:
initializeCamera(selectCameraopt)
Initializes the camera with the specified orientation.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
selectCamera |
string |
<optional> |
"front" | The camera orientation, either "front" or "back". |
- Source:
requestGeolocation()
Requests the current geolocation of the device.
- Source:
setupCamera(selectCameraopt)
Sets up the camera with the specified orientation.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
selectCamera |
string |
<optional> |
"front" | The camera orientation, either "front" or "back". |
- Source:
setupColorSensor(selectCameraopt)
Sets up the color sensor using the camera.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
selectCamera |
string |
<optional> |
"front" | The camera orientation, either "front" or "back". |
- Source:
setupLightSensor(selectCameraopt)
Sets up the light sensor using the camera.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
selectCamera |
string |
<optional> |
"front" | The camera orientation, either "front" or "back". |
- Source:
setupMotionSensor()
Sets up motion sensors by checking for necessary permissions.
- Source:
setupSoundSensor()
Sets up the sound sensor.
- Source:
showGeolocationError(error)
Callback function to handle geolocation errors.
Parameters:
Name | Type | Description |
---|---|---|
error |
PositionError | The error object containing error code and message. |
- Source:
toggleCamera()
Toggles the camera between front and back.
- Source:
updateBrightness() → {number}
Updates the brightness level from the video feed.
- Source:
Returns:
The updated brightness level.
- Type
- number