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 
17 #if defined(__cplusplus)
18 extern "C" {
19 #endif
20 
32 typedef struct ScOpaqueCamera ScCamera;
35 
47 typedef struct {
48  uint32_t min_width;
49  uint32_t max_width;
50  uint32_t step_width;
51  uint32_t min_height;
52  uint32_t max_height;
53  uint32_t step_height;
55 
63 typedef struct {
64  uint32_t numerator;
65  uint32_t denominator;
66 } ScFramerate;
67 
76 SC_EXPORT
77 float sc_framerate_get_frame_interval(ScFramerate const *frame_rate);
78 
87 SC_EXPORT
88 float sc_framerate_get_fps(ScFramerate const *frame_rate);
89 
100 typedef struct {
101  ScFramerate min;
102  ScFramerate max;
103  ScFramerate step;
105 
135 typedef enum {
139  2
140 } ScCameraMode;
141 
150 SC_EXPORT
151 ScCamera *sc_camera_new(void);
152 
162 SC_EXPORT
163 ScCamera *sc_camera_new_with_buffer_count(uint32_t buffer_count);
164 
177 SC_EXPORT
178 ScCamera *sc_camera_new_from_path(char const *device_path, uint32_t buffer_count);
179 
190 SC_EXPORT
191 void sc_camera_release(ScCamera *camera);
192 
201 SC_EXPORT
202 void sc_camera_retain(ScCamera *camera);
203 
213 SC_EXPORT
215 
223 SC_EXPORT
225 
242 SC_EXPORT
244 
261 SC_EXPORT
263 
282 SC_EXPORT
283 int32_t sc_camera_query_supported_resolutions(ScCamera const *camera,
284  ScSize *resolution_array,
285  uint32_t resolution_array_length);
286 
299 SC_EXPORT
301  ScStepwiseResolution *resolutions);
302 
321 SC_EXPORT
322 int32_t sc_camera_query_supported_framerates(ScCamera const *camera,
323  ScSize resolution,
324  ScFramerate *framerate_array,
325  uint32_t framerate_array_length);
326 
339 SC_EXPORT
341  ScSize resolution,
342  ScStepwiseFramerate *framerates);
343 
354 SC_EXPORT
356 
367 SC_EXPORT
369 
380 SC_EXPORT
382 
393 SC_EXPORT
394 ScBool sc_camera_set_manual_auto_focus_distance(ScCamera *camera, int32_t distance);
395 
404 SC_EXPORT
405 uint8_t const *sc_camera_get_frame(ScCamera *camera, ScImageDescription *image_description);
406 
416 SC_EXPORT
418 
428 SC_EXPORT
430 
441 SC_EXPORT
442 ScBool sc_camera_enqueue_frame_data(ScCamera *camera, uint8_t const *frame_data);
443 
444 #if defined(__cplusplus)
445 }
446 #endif
447 
448 #endif // SC_CAMERA_H_
uint32_t numerator
numerator of the frameraet
Definition: ScCamera.h:64
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:63
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:51
A step-wise description of a framerate.
Definition: ScCamera.h:100
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:135
uint32_t step_height
y dimension step size
Definition: ScCamera.h:53
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.
Opaque handle to a camera object.
uint32_t max_height
maximum y dimension
Definition: ScCamera.h:52
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:47
the camera captures at a wide range of step-wise generated resolutions
Definition: ScCamera.h:138
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_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:137
uint32_t min_width
minimum x dimension
Definition: ScCamera.h:48
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:65
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:50
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:136
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:49
int32_t ScBool
Boolean value, can be SC_TRUE or SC_FALSE.
Definition: ScConfig.h:127