ScCamera.h
Go to the documentation of this file.
1
10#ifndef SC_CAMERA_H_
11#define SC_CAMERA_H_
12
13#include <Scandit/ScConfig.h>
14#include <Scandit/ScCommon.h>
16
18
31typedef struct ScOpaqueCamera ScCamera;
32
44typedef struct {
45 uint32_t min_width;
46 uint32_t max_width;
47 uint32_t step_width;
48 uint32_t min_height;
49 uint32_t max_height;
50 uint32_t step_height;
52
60typedef struct {
61 uint32_t numerator;
62 uint32_t denominator;
64
73SC_EXPORT
75
84SC_EXPORT
85float sc_framerate_get_fps(ScFramerate const *frame_rate);
86
97typedef struct {
98 ScFramerate min;
99 ScFramerate max;
100 ScFramerate step;
102
132typedef enum {
136 2
138
147SC_EXPORT
149
159SC_EXPORT
161
174SC_EXPORT
175ScCamera *sc_camera_new_from_path(char const *device_path, uint32_t buffer_count);
176
187SC_EXPORT
188void sc_camera_release(ScCamera const *camera);
189
198SC_EXPORT
199void sc_camera_retain(ScCamera const *camera);
200
210SC_EXPORT
212
220SC_EXPORT
222
232SC_EXPORT
234 ScImageLayout *layout_array,
235 uint32_t layout_array_length);
236
249SC_EXPORT
251
268SC_EXPORT
270
287SC_EXPORT
289
308SC_EXPORT
310 ScSize *resolution_array,
311 uint32_t resolution_array_length);
312
325SC_EXPORT
327 ScStepwiseResolution *resolutions);
328
347SC_EXPORT
349 ScSize resolution,
350 ScFramerate *framerate_array,
351 uint32_t framerate_array_length);
352
365SC_EXPORT
367 ScSize resolution,
368 ScStepwiseFramerate *framerates);
369
380SC_EXPORT
382
393SC_EXPORT
395
406SC_EXPORT
408
419SC_EXPORT
421
430SC_EXPORT
431uint8_t const *sc_camera_get_frame(ScCamera *camera, ScImageDescription *image_description);
432
442SC_EXPORT
444
454SC_EXPORT
456
467SC_EXPORT
468ScBool sc_camera_enqueue_frame_data(ScCamera *camera, uint8_t const *frame_data);
469
471
472#endif // SC_CAMERA_H_
uint32_t denominator
denominator of the framerate
Definition: ScCamera.h:62
uint32_t numerator
numerator of the frameraet
Definition: ScCamera.h:61
uint32_t min_height
minimum y dimension
Definition: ScCamera.h:48
uint32_t min_width
minimum x dimension
Definition: ScCamera.h:45
uint32_t step_height
y dimension step size
Definition: ScCamera.h:50
uint32_t max_height
maximum y dimension
Definition: ScCamera.h:49
uint32_t max_width
maximum x dimension
Definition: ScCamera.h:46
uint32_t step_width
x dimension step size
Definition: ScCamera.h:47
ScCameraMode
Describes the resolution mode of the camera.
Definition: ScCamera.h:132
@ SC_CAMERA_MODE_STEPWISE
the camera captures at a wide range of step-wise generated resolutions
Definition: ScCamera.h:135
@ SC_CAMERA_MODE_UNKNOWN
the camera resolution mode is not known
Definition: ScCamera.h:133
@ SC_CAMERA_MODE_DISCRETE
the camera captures at a finite set of discrete resolutions
Definition: ScCamera.h:134
float sc_framerate_get_frame_interval(ScFramerate const *frame_rate)
Returns the time between two frames in seconds.
float sc_framerate_get_fps(ScFramerate const *frame_rate)
Returns the number of frames per second.
Describes a framerate.
Definition: ScCamera.h:60
A step-wise description of a framerate.
Definition: ScCamera.h:97
A unsigned step-wise description of a size.
Definition: ScCamera.h:44
Common functions and data structures.
ScCameraFocusMode
Describes the focus mode of a camera.
Definition: ScCommon.h:242
A 2-dimensional unsigned size.
Definition: ScCommon.h:134
Common definitions used throughout the ScanditSDK API.
#define SC_EXTERN_C_BEGIN
Start of external C code.
Definition: ScConfig.h:19
#define SC_EXTERN_C_END
End of external C code.
Definition: ScConfig.h:28
int32_t ScBool
Boolean value, can be SC_TRUE or SC_FALSE.
Definition: ScConfig.h:167
Image description interface.
ScImageLayout
Specifies the format of the pixel data.
Definition: ScImageDescription.h:24
Opaque handle to a camera object.
ScCameraMode sc_camera_get_resolution_mode(ScCamera const *camera)
Query the resolution mode of the camera.
ScBool sc_camera_query_supported_framerates_stepwise(ScCamera const *camera, ScSize resolution, ScStepwiseFramerate *framerates)
Query supported step-wise framerates of the camera at a given resolution.
ScBool sc_camera_start_stream(ScCamera *camera)
Tells the camera to start capturing images.
ScBool sc_camera_query_supported_resolutions_stepwise(ScCamera const *camera, ScStepwiseResolution *resolutions)
Query supported step-wise resolutions of the camera.
ScSize sc_camera_get_resolution(ScCamera const *camera)
Returns the resolution of the camera in pixel (width, height).
ScCameraMode sc_camera_get_framerate_mode(ScCamera const *camera)
Query the framerate mode of the camera.
ScBool sc_camera_request_resolution(ScCamera *camera, ScSize resolution)
Tries to set the camera resolution.
int32_t sc_camera_query_supported_resolutions(ScCamera const *camera, ScSize *resolution_array, uint32_t resolution_array_length)
Query supported discrete resolutions of the camera.
ScBool sc_camera_set_focus_mode(ScCamera *camera, ScCameraFocusMode mode)
Tries to set the autofocus mode of the camera.
ScCamera * sc_camera_new_from_path(char const *device_path, uint32_t buffer_count)
Create a camera object from a device path.
ScCamera * sc_camera_new_with_buffer_count(uint32_t buffer_count)
Create a camera object with the requested number of frame buffers.
ScBool sc_camera_stop_stream(ScCamera *camera)
Tells the camera to stop capturing images.
ScBool sc_camera_request_framerate(ScCamera *camera, ScFramerate framerate)
Tries to set the camera framerate.
ScBool sc_camera_enqueue_frame_data(ScCamera *camera, uint8_t const *frame_data)
Requeues the buffer after the data has been used.
ScImageLayout sc_camera_get_image_layout(ScCamera const *camera)
int32_t sc_camera_query_supported_image_layouts(ScCamera const *camera, ScImageLayout *layout_array, uint32_t layout_array_length)
void sc_camera_retain(ScCamera const *camera)
Increase reference count of camera by one.
uint8_t const * sc_camera_get_frame(ScCamera *camera, ScImageDescription *image_description)
ScBool sc_camera_set_manual_auto_focus_distance(ScCamera *camera, int32_t distance)
Sets the autofocus distance manually. Only possible when the autofocusmode is OFF.
void sc_camera_release(ScCamera const *camera)
Decrease reference count of camera by one.
ScBool sc_camera_request_image_layout(ScCamera *camera, ScImageLayout layout)
Tries to set the camera layout for the buffers capture. Forces internal buffers reinitialization.
ScCamera * sc_camera_new(void)
Create a camera object using default values.
int32_t sc_camera_query_supported_framerates(ScCamera const *camera, ScSize resolution, ScFramerate *framerate_array, uint32_t framerate_array_length)
Query supported discrete framerates of the camera at a given resolution.
Describes dimensions as well as internal memory layout of an image buffer.