API
ocam2_sdk.c File Reference

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"
Include dependency graph for ocam2_sdk.c:

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. More...
 
const char * ocam2_modeStr (ocam2_mode mode)
 Return a description text for camera mode. More...
 
const char * ocam2_sdkVersion ()
 Return sdk version. More...
 
const char * ocam2_sdkBuild ()
 Return sdk build. More...
 
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. More...
 
ocam2_rc ocam2_init (ocam2_mode mode, const char *descrbFile, ocam2_id *id)
 Create a camera instance with the provided mode. More...
 
ocam2_rc ocam2_exit (ocam2_id id)
 Clear a camera instance. More...
 

Variables

int * g_descrblTab =NULL
 
static int g_nbElem =0
 
static int g_nbCamera =0
 
ocam2_camInfo g_camInfoTab [OCAM2_SDK_MAX_CAMERA]
 

Detailed Description

Main library file.

– FIRSTLIGHT –

Author
FIRSTLIGHT

Definition in file ocam2_sdk.c.

Function Documentation

◆ ocam2_descramble()

void ocam2_descramble ( ocam2_id  id,
unsigned int *  number,
short *  image,
const short *  imageRaw 
)

Create a camera instance with the provided mode.

Parameters
[in]idcamera identifier
[out]numberImage number
[out]imageDescrambled image
[in]imageRawRaw image
Returns
none

Definition at line 418 of file ocam2_sdk.c.

Referenced by MagAOX::app::ocam2KCtrl::loadImageIntoStream().

◆ ocam2_descramble_2_track()

static void ocam2_descramble_2_track ( unsigned int *__restrict__  number,
short *__restrict__  image,
const short *__restrict__  imageRaw 
)
static

Definition at line 368 of file ocam2_sdk.c.

Referenced by ocam2_init().

◆ ocam2_descramble_4_track()

static void ocam2_descramble_4_track ( unsigned int *__restrict__  number,
short *__restrict__  image,
const short *__restrict__  imageRaw 
)
static

Definition at line 380 of file ocam2_sdk.c.

Referenced by ocam2_init().

◆ ocam2_descramble_binning1x3()

static void ocam2_descramble_binning1x3 ( unsigned int *__restrict__  number,
short *__restrict__  image,
const short *__restrict__  imageRaw 
)
static

Definition at line 393 of file ocam2_sdk.c.

Referenced by ocam2_init().

◆ ocam2_descramble_binning1x4()

static void ocam2_descramble_binning1x4 ( unsigned int *__restrict__  number,
short *__restrict__  image,
const short *__restrict__  imageRaw 
)
static

Definition at line 405 of file ocam2_sdk.c.

Referenced by ocam2_init().

◆ ocam2_descramble_binning2x2()

static void ocam2_descramble_binning2x2 ( unsigned int *__restrict__  number,
short *__restrict__  image,
const short *__restrict__  imageRaw 
)
static

Definition at line 260 of file ocam2_sdk.c.

Referenced by ocam2_init().

◆ ocam2_descramble_binning3x3()

static void ocam2_descramble_binning3x3 ( unsigned int *__restrict__  number,
short *__restrict__  image,
const short *__restrict__  imageRaw 
)
static

Definition at line 272 of file ocam2_sdk.c.

Referenced by ocam2_init().

◆ ocam2_descramble_binning4x4()

static void ocam2_descramble_binning4x4 ( unsigned int *__restrict__  number,
short *__restrict__  image,
const short *__restrict__  imageRaw 
)
static

Definition at line 320 of file ocam2_sdk.c.

Referenced by ocam2_init().

◆ ocam2_descramble_cropping240x120()

static void ocam2_descramble_cropping240x120 ( unsigned int *__restrict__  number,
short *__restrict__  image,
const short *__restrict__  imageRaw 
)
static

Definition at line 230 of file ocam2_sdk.c.

Referenced by ocam2_init().

◆ ocam2_descramble_cropping240x128()

static void ocam2_descramble_cropping240x128 ( unsigned int *__restrict__  number,
short *__restrict__  image,
const short *__restrict__  imageRaw 
)
static

Definition at line 245 of file ocam2_sdk.c.

Referenced by ocam2_init().

◆ ocam2_descramble_normal()

static void ocam2_descramble_normal ( unsigned int *__restrict__  number,
short *__restrict__  image,
const short *__restrict__  imageRaw 
)
static

Definition at line 220 of file ocam2_sdk.c.

Referenced by ocam2_init().

◆ ocam2_exit()

ocam2_rc ocam2_exit ( ocam2_id  id)

Clear a camera instance.

Parameters
[in]idcamera identifier
Returns
Return OK or Error

Definition at line 490 of file ocam2_sdk.c.

Referenced by MagAOX::app::ocam2KCtrl::configureAcquisition().

◆ ocam2_fillDescrblTab()

static int ocam2_fillDescrblTab ( const char *  descrbFile)
static

Definition at line 147 of file ocam2_sdk.c.

Referenced by ocam2_init().

◆ ocam2_fnbElem()

static int ocam2_fnbElem ( char *  buff,
int  bsz,
char  c 
)
static

Definition at line 133 of file ocam2_sdk.c.

Referenced by ocam2_fillDescrblTab().

◆ ocam2_fsize()

int ocam2_fsize ( FILE *  fp)

Definition at line 122 of file ocam2_sdk.c.

Referenced by ocam2_fillDescrblTab().

◆ ocam2_getMode()

ocam2_mode ocam2_getMode ( ocam2_id  id)

Return the camera mode.

Parameters
[in]idcamera identifier
Returns
camera mode as ocam2_mode

Definition at line 69 of file ocam2_sdk.c.

Referenced by MagAOX::app::ocam2KCtrl::configureAcquisition().

◆ ocam2_init()

ocam2_rc ocam2_init ( ocam2_mode  mode,
const char *  descrbFile,
ocam2_id id 
)

Create a camera instance with the provided mode.

Parameters
[in]modecamera mode
[in]descrbFiledescrambling file to use
[out]idcamera identifier
Returns
Return OK or Error

Definition at line 431 of file ocam2_sdk.c.

Referenced by MagAOX::app::ocam2KCtrl::configureAcquisition().

◆ ocam2_isIdValid()

int ocam2_isIdValid ( ocam2_id  id)

Definition at line 60 of file ocam2_sdk.c.

Referenced by ocam2_descramble(), ocam2_exit(), and ocam2_getMode().

◆ ocam2_modeStr()

const char * ocam2_modeStr ( ocam2_mode  mode)

Return a description text for camera mode.

Parameters
[in]modecamera mode
Returns
camera mode description as a string

Definition at line 77 of file ocam2_sdk.c.

Referenced by MagAOX::app::ocam2KCtrl::configureAcquisition().

◆ ocam2_printf()

void ocam2_printf ( ocam2_printf_sev  severity,
const char *  format,
  ... 
)

Definition at line 44 of file ocam2_sdk.c.

Referenced by ocam2_fillDescrblTab().

◆ ocam2_sdkBuild()

const char * ocam2_sdkBuild ( )

Return sdk build.

Returns
sdk build as a string

Definition at line 117 of file ocam2_sdk.c.

◆ ocam2_sdkVersion()

const char * ocam2_sdkVersion ( )

Return sdk version.

Returns
sdk version as a string

Definition at line 111 of file ocam2_sdk.c.

Variable Documentation

◆ g_camInfoTab

Initial value:
=
{ {0, OCAM2_UNKNOWN,NULL},
{0, OCAM2_UNKNOWN,NULL},
{0, OCAM2_UNKNOWN,NULL},
{0, OCAM2_UNKNOWN,NULL},
{0, OCAM2_UNKNOWN,NULL},
{0, OCAM2_UNKNOWN,NULL},
{0, OCAM2_UNKNOWN,NULL},
{0, OCAM2_UNKNOWN,NULL},
{0, OCAM2_UNKNOWN,NULL},
{0, OCAM2_UNKNOWN,NULL}
}
@ OCAM2_UNKNOWN
Definition: ocam2_sdk.h:224

Definition at line 30 of file ocam2_sdk.c.

Referenced by ocam2_descramble(), ocam2_exit(), ocam2_getMode(), and ocam2_init().

◆ g_descrblTab

◆ g_nbCamera

int g_nbCamera =0
static

Definition at line 27 of file ocam2_sdk.c.

Referenced by ocam2_exit(), and ocam2_init().

◆ g_nbElem

int g_nbElem =0
static

Definition at line 26 of file ocam2_sdk.c.

Referenced by ocam2_fillDescrblTab().