Main library file. More...
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <assert.h>
#include "ocam2_sdk.h"
#include "ocam2_pvt.h"
Go to the source code of this file.
Functions | |
void | ocam2_printf (ocam2_printf_sev severity, const char *format,...) |
int | ocam2_isIdValid (ocam2_id id) |
ocam2_mode | ocam2_getMode (ocam2_id id) |
Return the camera mode. | |
const char * | ocam2_modeStr (ocam2_mode mode) |
Return a description text for camera mode. | |
const char * | ocam2_sdkVersion () |
Return sdk version. | |
const char * | ocam2_sdkBuild () |
Return sdk build. | |
int | ocam2_fsize (FILE *fp) |
static int | ocam2_fnbElem (char *buff, int bsz, char c) |
static int | ocam2_fillDescrblTab (const char *descrbFile) |
static void | ocam2_descramble_normal (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) |
static void | ocam2_descramble_cropping240x128 (unsigned int *__restrict__ number, short *__restrict__ image, const short *__restrict__ imageRaw) |
static void | ocam2_descramble_binning2x2 (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) |
static void | ocam2_descramble_binning4x4 (unsigned int *__restrict__ number, short *__restrict__ image, const short *__restrict__ imageRaw) |
static void | ocam2_descramble_2_track (unsigned int *__restrict__ number, short *__restrict__ image, const short *__restrict__ imageRaw) |
static void | ocam2_descramble_4_track (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_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. | |
ocam2_rc | ocam2_init (ocam2_mode mode, const char *descrbFile, ocam2_id *id) |
Create a camera instance with the provided mode. | |
ocam2_rc | ocam2_exit (ocam2_id id) |
Clear a camera instance. | |
Variables | |
int * | g_descrblTab =NULL |
static int | g_nbElem =0 |
static int | g_nbCamera =0 |
ocam2_camInfo | g_camInfoTab [OCAM2_SDK_MAX_CAMERA] |
void ocam2_descramble | ( | ocam2_id | id, |
unsigned int * | number, | ||
short * | image, | ||
const short * | imageRaw | ||
) |
Create a camera instance with the provided mode.
[in] | id | camera identifier |
[out] | number | Image number |
[out] | image | Descrambled image |
[in] | imageRaw | Raw image |
Definition at line 418 of file ocam2_sdk.c.
References g_camInfoTab, g_descrblTab, ocam2_isIdValid(), OCAM2_UNKNOWN, and ocam2_camInfo::pfuncDescrbl.
Referenced by MagAOX::app::ocam2KCtrl::loadImageIntoStream().
|
static |
Definition at line 368 of file ocam2_sdk.c.
References g_descrblTab, OCAM2_2_TRACK_OFFSET, OCAM2_IMAGE_NB_OFFSET, OCAM2_NB_IDENTICAL_PIXELS_2_TRACK, and OCAM2_PIXELS_IMAGE_2_TRACK.
Referenced by ocam2_init().
|
static |
Definition at line 380 of file ocam2_sdk.c.
References g_descrblTab, OCAM2_4_TRACK_OFFSET, OCAM2_IMAGE_NB_OFFSET, OCAM2_NB_IDENTICAL_PIXELS_4_TRACK, and OCAM2_PIXELS_IMAGE_4_TRACK.
Referenced by ocam2_init().
|
static |
Definition at line 393 of file ocam2_sdk.c.
References g_descrblTab, OCAM2_BINNING1x3_OFFSET, OCAM2_IMAGE_NB_OFFSET, OCAM2_NB_IDENTICAL_PIXELS_BINNING1x3, and OCAM2_PIXELS_IMAGE_BINNING1x3.
Referenced by ocam2_init().
|
static |
Definition at line 405 of file ocam2_sdk.c.
References g_descrblTab, OCAM2_BINNING1x4_OFFSET, OCAM2_IMAGE_NB_OFFSET, OCAM2_NB_IDENTICAL_PIXELS_BINNING1x4, and OCAM2_PIXELS_IMAGE_BINNING1x4.
Referenced by ocam2_init().
|
static |
Definition at line 260 of file ocam2_sdk.c.
References g_descrblTab, OCAM2_BINNING2x2_OFFSET, OCAM2_IMAGE_NB_OFFSET, OCAM2_NB_IDENTICAL_PIXELS_BINNING2x2, and OCAM2_PIXELS_IMAGE_BINNING2x2.
Referenced by ocam2_init().
|
static |
Definition at line 272 of file ocam2_sdk.c.
References g_descrblTab, OCAM2_AMPLI_PRESCAN, OCAM2_AMPLI_WIDTH, OCAM2_BINNING3x3_OFFSET, OCAM2_IMAGE_NB_OFFSET, OCAM2_IMAGE_WIDTH_BINNING3x3, and OCAM2_PIXELS_IMAGE_BINNING3x3.
Referenced by ocam2_init().
|
static |
Definition at line 320 of file ocam2_sdk.c.
References g_descrblTab, OCAM2_AMPLI_PRESCAN, OCAM2_AMPLI_WIDTH, OCAM2_BINNING4x4_OFFSET, OCAM2_IMAGE_NB_OFFSET, OCAM2_IMAGE_WIDTH_BINNING4x4, and OCAM2_PIXELS_IMAGE_BINNING4x4.
Referenced by ocam2_init().
|
static |
Definition at line 230 of file ocam2_sdk.c.
References g_descrblTab, OCAM2_AMPLI_WIDTH, OCAM2_IMAGE_HEIGHT_CROPPING240x120, OCAM2_IMAGE_NB_OFFSET, OCAM2_IMAGE_WIDTH_CROPPING240x120, OCAM2_PIXELS_IMAGE_CROPPING240x120, and OCAM2_PIXELS_IMAGE_NORMAL.
Referenced by ocam2_init().
|
static |
Definition at line 245 of file ocam2_sdk.c.
References g_descrblTab, OCAM2_AMPLI_WIDTH, OCAM2_IMAGE_HEIGHT_CROPPING240x128, OCAM2_IMAGE_NB_OFFSET, OCAM2_IMAGE_WIDTH_CROPPING240x128, OCAM2_PIXELS_IMAGE_CROPPING240x128, and OCAM2_PIXELS_IMAGE_NORMAL.
Referenced by ocam2_init().
|
static |
Definition at line 220 of file ocam2_sdk.c.
References g_descrblTab, OCAM2_IMAGE_NB_OFFSET, and OCAM2_PIXELS_IMAGE_NORMAL.
Referenced by ocam2_init().
Clear a camera instance.
[in] | id | camera identifier |
Definition at line 490 of file ocam2_sdk.c.
References g_camInfoTab, g_descrblTab, g_nbCamera, ocam2_camInfo::mode, OCAM2_ERROR, ocam2_isIdValid(), OCAM2_OK, OCAM2_UNKNOWN, and ocam2_camInfo::pfuncDescrbl.
Referenced by MagAOX::app::ocam2KCtrl::configureAcquisition().
|
static |
Definition at line 147 of file ocam2_sdk.c.
References g_descrblTab, g_nbElem, ocam2_fnbElem(), ocam2_fsize(), OCAM2_PIXELS_IMAGE_NORMAL, ocam2_printf(), OCAM2_SEV_ERROR, and OCAM2_SEV_WARNING.
Referenced by ocam2_init().
|
static |
Definition at line 133 of file ocam2_sdk.c.
Referenced by ocam2_fillDescrblTab().
int ocam2_fsize | ( | FILE * | fp | ) |
Definition at line 122 of file ocam2_sdk.c.
Referenced by ocam2_fillDescrblTab().
ocam2_mode ocam2_getMode | ( | ocam2_id | id | ) |
Return the camera mode.
[in] | id | camera identifier |
Definition at line 69 of file ocam2_sdk.c.
References g_camInfoTab, ocam2_camInfo::mode, and ocam2_isIdValid().
Referenced by MagAOX::app::ocam2KCtrl::configureAcquisition().
ocam2_rc ocam2_init | ( | ocam2_mode | mode, |
const char * | descrbFile, | ||
ocam2_id * | id | ||
) |
Create a camera instance with the provided mode.
[in] | mode | camera mode |
[in] | descrbFile | descrambling file to use |
[out] | id | camera identifier |
Definition at line 431 of file ocam2_sdk.c.
References g_camInfoTab, g_nbCamera, ocam2_camInfo::mode, OCAM2_2_TRACK, OCAM2_4_TRACK, OCAM2_BINNING1x3, OCAM2_BINNING1x4, OCAM2_BINNING2x2, OCAM2_BINNING3x3, OCAM2_BINNING4x4, OCAM2_CROPPING240x120, OCAM2_CROPPING240x128, ocam2_descramble_2_track(), ocam2_descramble_4_track(), ocam2_descramble_binning1x3(), ocam2_descramble_binning1x4(), ocam2_descramble_binning2x2(), ocam2_descramble_binning3x3(), ocam2_descramble_binning4x4(), ocam2_descramble_cropping240x120(), ocam2_descramble_cropping240x128(), ocam2_descramble_normal(), OCAM2_ERROR, ocam2_fillDescrblTab(), OCAM2_NORMAL, OCAM2_OK, OCAM2_SDK_MAX_CAMERA, and ocam2_camInfo::pfuncDescrbl.
Referenced by MagAOX::app::ocam2KCtrl::configureAcquisition().
int ocam2_isIdValid | ( | ocam2_id | id | ) |
Definition at line 60 of file ocam2_sdk.c.
References OCAM2_SDK_MAX_CAMERA.
Referenced by ocam2_descramble(), ocam2_exit(), and ocam2_getMode().
const char * ocam2_modeStr | ( | ocam2_mode | mode | ) |
Return a description text for camera mode.
[in] | mode | camera mode |
Definition at line 77 of file ocam2_sdk.c.
References OCAM2_BINNING1x3, OCAM2_BINNING1x4, OCAM2_BINNING2x2, OCAM2_BINNING3x3, OCAM2_BINNING4x4, OCAM2_CROPPING240x120, OCAM2_CROPPING240x128, OCAM2_NORMAL, and OCAM2_UNKNOWN.
Referenced by MagAOX::app::ocam2KCtrl::configureAcquisition().
void ocam2_printf | ( | ocam2_printf_sev | severity, |
const char * | format, | ||
... | |||
) |
Definition at line 44 of file ocam2_sdk.c.
References OCAM2_SEV_ERROR, OCAM2_SEV_INFO, and OCAM2_SEV_WARNING.
Referenced by ocam2_fillDescrblTab().
const char * ocam2_sdkBuild | ( | ) |
const char * ocam2_sdkVersion | ( | ) |
ocam2_camInfo g_camInfoTab[OCAM2_SDK_MAX_CAMERA] |
Definition at line 30 of file ocam2_sdk.c.
Referenced by ocam2_descramble(), ocam2_exit(), ocam2_getMode(), and ocam2_init().
int* g_descrblTab =NULL |
Definition at line 25 of file ocam2_sdk.c.
Referenced by ocam2_descramble(), ocam2_descramble_2_track(), ocam2_descramble_4_track(), ocam2_descramble_binning1x3(), ocam2_descramble_binning1x4(), ocam2_descramble_binning2x2(), ocam2_descramble_binning3x3(), ocam2_descramble_binning4x4(), ocam2_descramble_cropping240x120(), ocam2_descramble_cropping240x128(), ocam2_descramble_normal(), ocam2_exit(), and ocam2_fillDescrblTab().
|
static |
Definition at line 27 of file ocam2_sdk.c.
Referenced by ocam2_exit(), and ocam2_init().
|
static |
Definition at line 26 of file ocam2_sdk.c.
Referenced by ocam2_fillDescrblTab().