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 
30 typedef struct ScOpaqueCamera ScCamera;
33 
45 typedef struct {
46  uint32_t min_width;
47  uint32_t max_width;
48  uint32_t step_width;
49  uint32_t min_height;
50  uint32_t max_height;
51  uint32_t step_height;
53 
61 typedef struct {
62  uint32_t numerator;
63  uint32_t denominator;
64 } ScFramerate;
65 
74 SC_EXPORT
75 float sc_framerate_get_frame_interval(ScFramerate const *frame_rate);
76 
85 SC_EXPORT
86 float sc_framerate_get_fps(ScFramerate const *frame_rate);
87 
98 typedef struct {
99  ScFramerate min;
100  ScFramerate max;
101  ScFramerate step;
103 
133 typedef enum {
137  2
138 } ScCameraMode;
139 
148 SC_EXPORT
149 ScCamera *sc_camera_new(void);
150 
160 SC_EXPORT
161 ScCamera *sc_camera_new_with_buffer_count(uint32_t buffer_count);
162 
175 SC_EXPORT
176 ScCamera *sc_camera_new_from_path(char const *device_path, uint32_t buffer_count);
177 
188 SC_EXPORT
189 void sc_camera_release(ScCamera *camera);
190 
199 SC_EXPORT
200 void sc_camera_retain(ScCamera *camera);
201 
211 SC_EXPORT
213 
221 SC_EXPORT
223 
240 SC_EXPORT
242 
259 SC_EXPORT
261 
280 SC_EXPORT
281 int32_t sc_camera_query_supported_resolutions(ScCamera const *camera,
282  ScSize *resolution_array,
283  uint32_t resolution_array_length);
284 
297 SC_EXPORT
299  ScStepwiseResolution *resolutions);
300 
319 SC_EXPORT
320 int32_t sc_camera_query_supported_framerates(ScCamera const *camera,
321  ScSize resolution,
322  ScFramerate *framerate_array,
323  uint32_t framerate_array_length);
324 
337 SC_EXPORT
339  ScSize resolution,
340  ScStepwiseFramerate *framerates);
341 
352 SC_EXPORT
354 
365 SC_EXPORT
367 
378 SC_EXPORT
380 
391 SC_EXPORT
392 ScBool sc_camera_set_manual_auto_focus_distance(ScCamera *camera, int32_t distance);
393 
402 SC_EXPORT
403 uint8_t const *sc_camera_get_frame(ScCamera *camera, ScImageDescription *image_description);
404 
414 SC_EXPORT
416 
426 SC_EXPORT
428 
439 SC_EXPORT
440 ScBool sc_camera_enqueue_frame_data(ScCamera *camera, uint8_t const *frame_data);
441 
443 
444 #endif // SC_CAMERA_H_
uint32_t numerator
numerator of the frameraet
Definition: ScCamera.h:62
ScBool sc_camera_enqueue_frame_data(ScCamera *camera, uint8_t const *frame_data)
Requeues the buffer after the data has been used.
float sc_framerate_get_fps(ScFramerate const *frame_rate)
Returns the number of frames per second.
Describes a framerate.
Definition: ScCamera.h:61
ScBool sc_camera_request_resolution(ScCamera *camera, ScSize resolution)
Tries to set the camera resolution.
uint32_t min_height
minimum y dimension
Definition: ScCamera.h:49
A step-wise description of a framerate.
Definition: ScCamera.h:98
uint8_t const * sc_camera_get_frame(ScCamera *camera, ScImageDescription *image_description)
ScBool sc_camera_stop_stream(ScCamera *camera)
Tells the camera to stop capturing images.
ScCamera * sc_camera_new_from_path(char const *device_path, uint32_t buffer_count)
Create a camera object from a device path.
ScImageLayout sc_camera_get_image_layout(ScCamera const *camera)
ScCameraMode
Describes the resolution mode of the camera.
Definition: ScCamera.h:133
uint32_t step_height
y dimension step size
Definition: ScCamera.h:51
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.
ScSize sc_camera_get_resolution(ScCamera const *camera)
Returns the resolution of the camera in pixel (width, height).
ScBool sc_camera_request_framerate(ScCamera *camera, ScFramerate framerate)
Tries to set the camera framerate.
ScCamera * sc_camera_new_with_buffer_count(uint32_t buffer_count)
Create a camera object with the requested number of frame buffers.
ScCameraMode sc_camera_get_resolution_mode(ScCamera const *camera)
Query the resolution mode of the camera.
#define SC_EXTERN_C_BEGIN
Start of external C code.
Definition: ScConfig.h:19
Opaque handle to a camera object.
uint32_t max_height
maximum y dimension
Definition: ScCamera.h:50
ScImageLayout
Specifies the format of the pixel data.
Definition: ScImageDescription.h:24
ScCamera * sc_camera_new(void)
Create a camera object using default values.
Describes dimensions as well as internal memory layout of an image buffer.
A unsigned step-wise description of a size.
Definition: ScCamera.h:45
the camera captures at a wide range of step-wise generated resolutions
Definition: ScCamera.h:136
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.
#define SC_EXTERN_C_END
End of external C code.
Definition: ScConfig.h:28
void sc_camera_retain(ScCamera *camera)
Increase reference count of camera by one.
ScBool sc_camera_set_focus_mode(ScCamera *camera, ScCameraFocusMode mode)
Tries to set the autofocus mode of the camera.
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.
the camera captures at a finite set of discrete resolutions
Definition: ScCamera.h:135
uint32_t min_width
minimum x dimension
Definition: ScCamera.h:46
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.
ScCameraMode sc_camera_get_framerate_mode(ScCamera const *camera)
Query the framerate mode of the camera.
void sc_camera_release(ScCamera *camera)
Decrease reference count of camera by one.
uint32_t denominator
denominator of the framerate
Definition: ScCamera.h:63
Common definitions used throughout the ScanditSDK API.
Common functions and data structures.
ScBool sc_camera_start_stream(ScCamera *camera)
Tells the camera to start capturing images.
A 2-dimensional unsigned size.
Definition: ScCommon.h:134
uint32_t step_width
x dimension step size
Definition: ScCamera.h:48
float sc_framerate_get_frame_interval(ScFramerate const *frame_rate)
Returns the time between two frames in seconds.
the camera resolution mode is not known
Definition: ScCamera.h:134
ScBool sc_camera_query_supported_resolutions_stepwise(ScCamera const *camera, ScStepwiseResolution *resolutions)
Query supported step-wise resolutions of the camera.
ScCameraFocusMode
Describes the focus mode of a camera.
Definition: ScCommon.h:242
Image description interface.
uint32_t max_width
maximum x dimension
Definition: ScCamera.h:47
int32_t ScBool
Boolean value, can be SC_TRUE or SC_FALSE.
Definition: ScConfig.h:158