18 #if defined(_WIN32) || defined(_WIN64)
20 #define strtok_r strtok_s
48 static const char *severityStr[]={
"INFO",
"WARNING",
"ERROR"};
51 va_start(arguments, format);
53 fprintf(stderr,
"OCAM2SDK:%s: ", severityStr[severity]);
54 vfprintf(stderr, format, arguments);
79 static const char *ocam2_modeText[] =
81 "Standard Mode(240x240@2060Hz)",
82 "Cropping Mode(240x120@3680Hz)",
83 "Binning 2x2 Mode(120x120@3620Hz)",
84 "Binning 3x3 Mode(80x80@4950Hz)",
85 "Binning 4x4 Mode(60x60@5900Hz)",
86 "Cropping Mode(240x128@3500Hz)",
89 "Binning 1x3 Mode(240x80@4944Hz)",
90 "Binning 1x4 Mode(240x60@5962Hz)"};
104 return ocam2_modeText[mode];
113 return OCAMSDK_VERSION;
119 return OCAMSDK_BUILD;
127 fseek(fp, 0L, SEEK_END);
129 fseek(fp,current,SEEK_SET);
140 if (buff[i]==c) nb++;
160 if (NULL != (fp=fopen(descrbFile,
"rb")))
168 pfileContent=malloc(sz);
170 if (NULL != pfileContent)
172 if (1==fread(pfileContent, sz, 1, fp))
183 char delim[] =
",\n\r";
186 char *pfc=pfileContent;
191 arg = strtok_r(pfc, delim, &saveptr);
197 if (NULL!=pfc) pfc=NULL;
220 static void ocam2_descramble_normal(
unsigned int *__restrict__ number,
short *__restrict__ image,
const short *__restrict__ imageRaw)
234 for (i=0; i<
chunk; i++)
249 for (i=0; i<
chunk; i++)
264 for (i=0; i <
chunk; i++)
282 for (i=0; i <
chunk; i++)
331 for (i=0; i <
chunk; i++)
368 static void ocam2_descramble_2_track(
unsigned int *__restrict__ number,
short *__restrict__ image,
const short *__restrict__ imageRaw)
372 for (i=0; i <
chunk; i++)
380 static void ocam2_descramble_4_track(
unsigned int *__restrict__ number,
short *__restrict__ image,
const short *__restrict__ imageRaw)
384 for (i=0; i <
chunk; i++)
397 for (i = 0; i <
chunk; i++)
409 for (i = 0; i <
chunk; i++)
421 assert(NULL!=number);
423 assert(NULL!=imageRaw);
445 if ( (NULL == descrbFile) && (0==
g_nbCamera) )
GeneratorWrapper< std::vector< T > > chunk(size_t size, GeneratorWrapper< T > &&generator)
Private definition for libocam2sdk.
ocam2_descramble_func_t pfuncDescrbl
static void ocam2_descramble_2_track(unsigned int *__restrict__ number, short *__restrict__ image, const short *__restrict__ imageRaw)
const char * ocam2_sdkBuild()
Return sdk build.
ocam2_rc ocam2_init(ocam2_mode mode, const char *descrbFile, ocam2_id *id)
Create a camera instance with the provided mode.
ocam2_camInfo g_camInfoTab[OCAM2_SDK_MAX_CAMERA]
int ocam2_isIdValid(ocam2_id id)
static void ocam2_descramble_binning1x4(unsigned int *__restrict__ number, short *__restrict__ image, const short *__restrict__ imageRaw)
void ocam2_descramble(ocam2_id id, unsigned int *number, short *image, const short *imageRaw)
Create a camera instance with the provided mode.
const char * ocam2_sdkVersion()
Return sdk version.
static int ocam2_fillDescrblTab(const char *descrbFile)
const char * ocam2_modeStr(ocam2_mode mode)
Return a description text for camera mode.
int ocam2_fsize(FILE *fp)
static void ocam2_descramble_4_track(unsigned int *__restrict__ number, short *__restrict__ image, const short *__restrict__ imageRaw)
static void ocam2_descramble_binning3x3(unsigned int *__restrict__ number, short *__restrict__ image, const short *__restrict__ imageRaw)
void ocam2_printf(ocam2_printf_sev severity, const char *format,...)
static void ocam2_descramble_binning4x4(unsigned int *__restrict__ number, short *__restrict__ image, const short *__restrict__ imageRaw)
ocam2_rc ocam2_exit(ocam2_id id)
Clear a camera instance.
static int ocam2_fnbElem(char *buff, int bsz, char c)
static void ocam2_descramble_normal(unsigned int *__restrict__ number, short *__restrict__ image, const short *__restrict__ imageRaw)
static void ocam2_descramble_cropping240x128(unsigned int *__restrict__ number, short *__restrict__ image, const short *__restrict__ imageRaw)
static void ocam2_descramble_binning1x3(unsigned int *__restrict__ number, short *__restrict__ image, const short *__restrict__ imageRaw)
static void ocam2_descramble_cropping240x120(unsigned int *__restrict__ number, short *__restrict__ image, const short *__restrict__ imageRaw)
ocam2_mode ocam2_getMode(ocam2_id id)
Return the camera mode.
static void ocam2_descramble_binning2x2(unsigned int *__restrict__ number, short *__restrict__ image, const short *__restrict__ imageRaw)
The purpose of the libocam2sdk library is to provide an easy way to achieve ocam2 specific opération....
int ocam2_id
Library camera identifier.
#define OCAM2_BINNING3x3_OFFSET
#define OCAM2_AMPLI_PRESCAN
#define OCAM2_IMAGE_HEIGHT_CROPPING240x120
#define OCAM2_4_TRACK_OFFSET
#define OCAM2_PIXELS_IMAGE_NORMAL
#define OCAM2_PIXELS_IMAGE_BINNING3x3
#define OCAM2_IMAGE_HEIGHT_CROPPING240x128
#define OCAM2_NB_IDENTICAL_PIXELS_BINNING1x4
#define OCAM2_IMAGE_WIDTH_BINNING3x3
#define OCAM2_PIXELS_IMAGE_CROPPING240x120
ocam2_rc
Enum of ocam2 library return code.
#define OCAM2_NB_IDENTICAL_PIXELS_2_TRACK
#define OCAM2_IMAGE_WIDTH_CROPPING240x120
#define OCAM2_2_TRACK_OFFSET
enum workMode ocam2_mode
typedef of ocam2 camera mode
#define OCAM2_PIXELS_IMAGE_BINNING1x3
#define OCAM2_PIXELS_IMAGE_BINNING1x4
#define OCAM2_NB_IDENTICAL_PIXELS_BINNING1x3
#define OCAM2_IMAGE_NB_OFFSET
#define OCAM2_PIXELS_IMAGE_4_TRACK
#define OCAM2_IMAGE_WIDTH_CROPPING240x128
#define OCAM2_SDK_MAX_CAMERA
#define OCAM2_BINNING1x4_OFFSET
#define OCAM2_BINNING1x3_OFFSET
#define OCAM2_AMPLI_WIDTH
#define OCAM2_BINNING2x2_OFFSET
#define OCAM2_BINNING4x4_OFFSET
#define OCAM2_PIXELS_IMAGE_BINNING2x2
#define OCAM2_PIXELS_IMAGE_2_TRACK
#define OCAM2_PIXELS_IMAGE_CROPPING240x128
#define OCAM2_IMAGE_WIDTH_BINNING4x4
#define OCAM2_NB_IDENTICAL_PIXELS_4_TRACK
#define OCAM2_PIXELS_IMAGE_BINNING4x4
#define OCAM2_NB_IDENTICAL_PIXELS_BINNING2x2