ScCommon.h File Reference

Go to the source code of this file.

Data Structures

struct  ScPoint
 
struct  ScQuadrilateral
 
struct  ScPointF
 
struct  ScSize
 
struct  ScSizeF
 
struct  ScRectangleF
 
struct  ScError
 
struct  ScImageBuffer
 

Enumerations

enum  ScCameraFocusMode { SC_CAMERA_FOCUS_MODE_UNKNOWN = 0, SC_CAMERA_FOCUS_MODE_FIXED = 1, SC_CAMERA_FOCUS_MODE_AUTO = 2, SC_CAMERA_FOCUS_MODE_MANUAL = 4 }
 
enum  ScErrorType {
  SC_NO_ERROR = 0, SC_ERROR_UNKNOWN = 1, SC_ERROR_NOT_IMPLEMENTED = 2, SC_ERROR_INVALID_INPUT = 3,
  SC_ERROR_INTERNAL_ERROR = 4
}
 
enum  ScInformationKey { SC_INFORMATION_KEY_SOFTWARE_LICENSES }
 

Functions

void sc_free (void *pointer)
 
void sc_error_free (ScError *error)
 
const char * sc_get_information_string (ScInformationKey key)
 
void sc_image_buffer_free (ScImageBuffer *image)
 

Detailed Description

Common functions and data structures.


Data Structure Documentation

◆ ScSize

struct ScSize

A 2-dimensional unsigned size.

Since
4.6.0
Examples:
CommandLineBarcodeScannerCameraSample.c, and CommandLineMatrixScanCameraSample.c.
Data Fields
uint32_t width x dimension
uint32_t height y dimension

◆ ScSizeF

struct ScSizeF

A 2-dimensional size with floating point precision.

Since
4.6.0
Data Fields
float width x dimension
float height y dimension

◆ ScError

struct ScError

Structure for holding error information.

Since
4.11.0
Data Fields
const char * message error message. Set to NULL in case there is no error
uint32_t code error code, 0 if there is no error, a positive value otherwise.

◆ ScImageBuffer

struct ScImageBuffer

A 2-dimensional bitmap/image.

Since
5.8
Data Fields
ScImageDescription * description
uint8_t * data

Enumeration Type Documentation

◆ ScCameraFocusMode

Describes the focus mode of a camera.

Since
4.6.0
Enumerator
SC_CAMERA_FOCUS_MODE_UNKNOWN 

the focus capabilities are not known

SC_CAMERA_FOCUS_MODE_FIXED 

the camera cannot change its focus

SC_CAMERA_FOCUS_MODE_AUTO 

the camera automatically adjusts the focus to create a sharp image

SC_CAMERA_FOCUS_MODE_MANUAL 

the camera is controlled by the user

◆ ScErrorType

Enumeration of different error types.

Since
5.8

◆ ScInformationKey

Enumeration of different information strings.

Values of this enumeration are passed to sc_get_information_string to retrieve specific information.

Since
4.16.1

Function Documentation

◆ sc_free()

void sc_free ( void *  pointer)

Deallocates the memory allocation pointed to by pointer.

Parameters
pointerThe pointer to be deallocated. In case pointer is a null pointer, no operation is performed.

◆ sc_error_free()

void sc_error_free ( ScError error)

free's any memory associated with the error

Upon exit, the data fields are set to 0.

Parameters
errorthe error to free.
Since
4.11.0

◆ sc_get_information_string()

const char* sc_get_information_string ( ScInformationKey  key)

Get information string.

Parameters
keyinformation identifier
Returns
The string associated with the given key, null if no string is associated with the key. The returned key is constant and must not be freed by the caller.
Since
4.16.1

◆ sc_image_buffer_free()

void sc_image_buffer_free ( ScImageBuffer image)

Frees the data contained in the image.

Effectively calls sc_image_description_release on the description and frees the memory contained in data. When passed a NULL pointer, this call has no effect.

Parameters
imageImage to free. Can be null.
Since
5.8