Deprecation warning
Please note that this is outdated documentation for an older release of the Scandit Barcode Scanner SDK.
We are deprecating the 5.x API on all platforms (except Linux). Release 5.19 in April 2021 will be our final. Applications running 5.x will continue to work, and we will continue to release critical bug fixes and security patches only, for one year. We encourage you to migrate to 6.x and take advantage of our latest / advanced features and improved performance.
You'll find the updated documentation at: Data Capture SDK Documentation for Android
Detailed Description
Opaque handle to a camera object.
Currently this camera interface is only available on Linux platforms with Video4Linux2 (v4l2) camera drivers. On other platforms, a dummy object is returned that does not do anything. On mobile platforms like Andoid and iOS the platform's native camera interface should be used.
- Since
- 4.6.0
- Examples:
- ScanditNativeBarcodeScannerCameraDemo.c.
Member Function Documentation
ScCamera * sc_camera_new | ( | void | ) |
Create a camera object using default values.
- Returns
- a newly allocated camera or null on error
- Since
- 4.6.0
- Examples:
- ScanditNativeBarcodeScannerCameraDemo.c.
ScCamera * sc_camera_new_with_buffer_count | ( | uint32_t | buffer_count | ) |
Create a camera object with the requested number of frame buffers.
- Parameters
-
buffer_count number of buffers used by the camera
- Returns
- a newly allocated camera or null on error
- Since
- 4.6.0
ScCamera * sc_camera_new_from_path | ( | const char * | device_path, |
uint32_t | buffer_count | ||
) |
Create a camera object from a device path.
Setting too many frame buffers can make the allocation fail.
- Parameters
-
device_path path to the camera device, e.g. /dev/video0 buffer_count number of frame buffers to use.
- Returns
- a newly allocated camera or null on error
- Since
- 4.6.0
void sc_camera_release | ( | ScCamera * | camera | ) |
Decrease reference count of camera by one.
When the reference count drops to zero, the camera is deallocated.
- Parameters
-
camera A valid camera object. May be null
- Since
- 4.6.0
- Examples:
- ScanditNativeBarcodeScannerCameraDemo.c.
void sc_camera_retain | ( | ScCamera * | camera | ) |
Increase reference count of camera by one.
- Parameters
-
camera A valid camera object. Must not be null
- Since
- 4.6.0
Returns the resolution of the camera in pixel (width, height).
- Parameters
-
camera A valid camera object. Must not be null
- Returns
- The resolution settings of the camera
- Since
- 4.6.0
ScImageLayout sc_camera_get_image_layout | ( | const ScCamera * | camera | ) |
- Parameters
-
camera A valid camera object. Must not be null.
- Returns
- the layout used by the camera
- Since
- 4.6.0
ScCameraMode sc_camera_get_resolution_mode | ( | const ScCamera * | camera | ) |
Query the resolution mode of the camera.
This function returns the supported resolution mode of this camera. Depending on the resolution mode, either sc_camera_query_supported_resolutions(), or sc_camera_query_supported_resolutions_stepwise() must be used to query available resolutions. See ScCameraMode for a description of possible return values.
- Parameters
-
camera A valid camera object. Must not be null.
- Returns
- the resolution mode used by the camera.
- See also
- ScCameraMode for an explanation of the different resolution modes.
- Since
- 4.7.0
- Examples:
- ScanditNativeBarcodeScannerCameraDemo.c.
ScCameraMode sc_camera_get_framerate_mode | ( | const ScCamera * | camera | ) |
Query the framerate mode of the camera.
This function returns the supported framerate mode of this camera. Depending on the framerate mode, either sc_camera_query_supported_framerates(), or sc_camera_query_supported_framerates_stepwise() must be used to query available framerates. See ScCameraMode for a description of possible return values.
- Parameters
-
camera A valid camera object. Must not be null.
- Returns
- the resolution mode used by the camera.
- See also
- ScCameraMode for an explanation of the different resolution modes.
- Since
- 4.7.0
int32_t sc_camera_query_supported_resolutions | ( | const ScCamera * | camera, |
ScSize * | resolution_array, | ||
uint32_t | resolution_array_length | ||
) |
Query supported discrete resolutions of the camera.
Use this function on camera objects whose resolution mode is SC_CAMERA_MODE_DISCRETE. For camera objects with SC_CAMERA_MODE_STEPWISE, use sc_camera_query_supported_resolutions_stepwise().
- Parameters
-
camera A valid camera object. Must not be null. resolution_array Pre-allocated array of resolution objects into which the resolutions are written. resolution_array_length Number of objects in the pre-allocated resolution array.
- Returns
- The number of resolution objects that were written to the resolution array. 0 is returned if the camera resolution mode is not SC_CAMERA_MODE_DISCRETE.
- See also
- ScCameraMode for the difference between discrete and step-wise resolution mode
- Since
- 4.6.0
- Examples:
- ScanditNativeBarcodeScannerCameraDemo.c.
ScBool sc_camera_query_supported_resolutions_stepwise | ( | const ScCamera * | camera, |
ScStepwiseResolution * | resolutions | ||
) |
Query supported step-wise resolutions of the camera.
- Parameters
-
camera A valid camera object. Must not be null. resolutions pointer to a ScStepwiseResolution struct in which the result will be written
- Returns
- true on success and false if the camera resolution mode is not SC_CAMERA_MODE_STEPWISE.
- See also
- ScCameraMode for the difference between discrete and step-wise resolution mode.
- Since
- 4.7.0
- Examples:
- ScanditNativeBarcodeScannerCameraDemo.c.
int32_t sc_camera_query_supported_framerates | ( | const ScCamera * | camera, |
ScSize | resolution, | ||
ScFramerate * | framerate_array, | ||
uint32_t | framerate_array_length | ||
) |
Query supported discrete framerates of the camera at a given resolution.
Use this function on camera objects whose resolution mode is SC_CAMERA_MODE_DISCRETE. For camera objects with SC_CAMERA_MODE_STEPWISE, use sc_camera_query_supported_framerates_stepwise()
- Parameters
-
camera A valid camera object. Must not be null. resolution The resolution at which we want to know the the supported framerates. framerate_array Pre-allocated array of framerate objects into which the framerates are written. framerate_array_length Number of objects in the pre-allocated resolution array.
- Returns
- The n umber of framrate objects that were written in the framerate array. 0 is returned if the camera framerate mode is not SC_CAMERA_MODE_DISCRETE
- See also
- ScCameraMode for the differences between discrete and step-wise framerate mode
- Since
- 4.7.0
ScBool sc_camera_query_supported_framerates_stepwise | ( | const ScCamera * | camera, |
ScSize | resolution, | ||
ScStepwiseFramerate * | framerates | ||
) |
Query supported step-wise framerates of the camera at a given resolution.
- Parameters
-
camera A valid camera object. Must not be null. resolution The resolution at which we want to know the supported framerates. framerates Pointer to a ScStepwiseFramerate struct in which the result will be written
- Returns
- true on success and false if the camera resolution mode is not SC_CAMERA_MODE_STEPWISE
- Since
- 4.7.0
Tries to set the camera resolution.
- Parameters
-
camera A valid camera object. Must not be null resolution A resolution object. Must not be null
- Returns
- true on success and false on failure
- Since
- 4.6.0
- Examples:
- ScanditNativeBarcodeScannerCameraDemo.c.
ScBool sc_camera_set_focus_mode | ( | ScCamera * | camera, |
ScCameraFocusMode | mode | ||
) |
Tries to set the autofocus mode of the camera.
- Parameters
-
camera A valid camera object. Must not be null mode desired focus mode
- Returns
- true on success and false on failure
- Since
- 4.6.0
Sets the autofocus distance manually. Only possible when the autofocusmode is OFF.
- Parameters
-
camera A valid camera object. Must not be null distance device specific focus distance value
- Returns
- true on success and false on failure
- Since
- 4.6.0
const uint8_t * sc_camera_get_frame | ( | ScCamera * | camera, |
ScImageDescription * | image_description | ||
) |
- Parameters
-
camera A valid camera object. Must not be null image_description image description of the returned frame data. Can be null to ignore the output.
- Returns
- the latest frame data that the camera captured or null on error.
- Since
- 4.6.0
- Examples:
- ScanditNativeBarcodeScannerCameraDemo.c.
Tells the camera to start capturing images.
- Parameters
-
camera A valid camera object. Must not be null
- Returns
- true on success and false on failure
- Since
- 4.6.0
- Examples:
- ScanditNativeBarcodeScannerCameraDemo.c.
Tells the camera to stop capturing images.
- Parameters
-
camera A valid camera object. Must not be null
- Returns
- true on success and false on failure
- Since
- 4.6.0
Requeues the buffer after the data has been used.
- Parameters
-
camera A valid camera object. Must not be null frame_data Image data pointer from this camera. Must not be null
- Returns
- true on success and false on failure
- Since
- 4.6.0
- Examples:
- ScanditNativeBarcodeScannerCameraDemo.c.
The documentation for this struct was generated from the following file: