

Public Class ICubeApi

    Public Const IC_SUCCESS As Integer = 0
    Public Const IC_ERROR As Integer = 1

    Public Const IC_IF_NOT_OPEN As Integer = -1
    Public Const IC_WRONG_PARAM As Integer = -2
    Public Const IC_OUT_OF_MEMORY As Integer = -3
    Public Const IC_ALREADY_DONE As Integer = -4
    Public Const IC_WRONG_CLOCK_VAL As Integer = -5
    Public Const IC_COM_LIB_INIT As Integer = -6
    Public Const IC_NOT_IF_STARTED As Integer = -7
    Public Const IC_WRONG_ROI_ID As Integer = -8
    Public Const IC_IF_NOT_ENABLED As Integer = -9
    Public Const IC_COLOR_CAM_ONLY As Integer = -10
    Public Const IC_DRIVER_VERSION As Integer = -11
    Public Const IC_D3D_INIT As Integer = -12
    Public Const IC_BAD_POINTER As Integer = -13
    Public Const IC_ERROR_FILE_SIZE As Integer = -14
    Public Const IC_RECONNECTION_ACTIVE As Integer = -15
    Public Const IC_USB_REQUEST_FAIL As Integer = -16
    Public Const IC_RESOURCE_IN_USE As Integer = -17
    Public Const IC_DEVICE_GONE As Integer = -18
    Public Const IC_DLL_MISMATCH As Integer = -19
    Public Const IC_WRONG_FW_VERSION As Integer = -20
    Public Const IC_NO_RGB_CALLBACK As Integer = -21
    Public Const IC_NO_USB30_CAMERA As Integer = -22
    Public Const IC_ERR_FIX_RELATION As Integer = -23
    Public Const IC_CRC_CONFIG_DATA As Integer = -24
    Public Const IC_CONFIG_DATA As Integer = -25
    Public Const IC_ERR_START_PNP As Integer = -26
    Public Const IC_INVALID_CAM_TYPE As Integer = -27
    Public Const IC_NOT_IF_STREAMING As Integer = -28
    Public Const IC_USB_STARTUP As Integer = -29

    ' Video Mode definitions
    ' (used with: ICubeSDK_SetMode,ICubeSDK_GetMode)

    Public Const MODE_320x240 As Integer = 0
    Public Const MODE_640x480 As Integer = 1
    Public Const MODE_752x480 As Integer = 2
    Public Const MODE_800x600 As Integer = 3
    Public Const MODE_1024x768 As Integer = 4
    Public Const MODE_1280x1024 As Integer = 5
    Public Const MODE_1600x1200 As Integer = 6
    Public Const MODE_2048x1536 As Integer = 7
    Public Const MODE_2592x1944 As Integer = 8
    Public Const MODE_3840x2748 As Integer = 9
    Public Const MODE_1920x1200 As Integer = 10

    ' BinSkip definitions
    ' (used with: ICubeSDK_SetBinSkip,ICubeSDK_GetBinSkip,ICubeSDK_GetBinSkipList)

    Public Const MODE_SKIP As Integer = 0
    Public Const MODE_BIN As Integer = 1
    Public Const BIN_SKIP_OFF As Integer = 0
    Public Const BIN_SKIP_2ND_PIXEL As Integer = 1
    Public Const BIN_SKIP_4TH_PIXEL As Integer = 2

    ' Parameter definitions 
    ' (used with: ICubeSDK_SetCamParameter,ICubeSDK_GetCamParameter,
    ' ICubeSDK_GetCamParameterRange,ICubeSDK_GetParamAuto,ICubeSDK_SetParamAuto,
    ' ICubeSDK_SetParamAutoDef,ICubeSDK_SetParamOnePush)


    ' Measure field definitions
    ' (used with REG_MEASURE_FIELD_AE)

    Public Const MEASUREFIELD_100 As Integer = 2       ' 100% (full frame)
    Public Const MEASUREFIELD_60 As Integer = 1        ' 60%
    Public Const MEASUREFIELD_30 As Integer = 0        ' 30%

    ' Shutter definitions
    ' (used with REG_SHUTTER)

    Public Const SHUTTER_ROLLING As Integer = 0
    Public Const SHUTTER_GLOBAL_RESET As Integer = 1
    Public Const SHUTTER_GLOBAL As Integer = 2

    ' Parameter ON||OFF definitions
    Public Const OFF As Integer = 0
    Public Const ON_ As Integer = 1

    ' Trigger invert definitions
    ' (used with REG_TRIGGER_INVERT)

    Public Const FALLING_EDGE As Integer = 0
    Public Const RISING_EDGE As Integer = 1

    ' Software trigger mode definitions
    ' (used with REG_SW_TRIG_MODE)

    Public Const DELAYED_TRIGGER_RETURN As Integer = 0   ' camera checks for frame arrival (default),
    ' ICubeSDK_SetTrigger(..,TRIG_SW_DO) returns this status
    Public Const IMMEDIATE_TRIGGER_RETURN As Integer = 1 ' no camera check

    ' Data transmission definitions
    ' (used with REG_DATA_TRANSMISSION)

    Public Const IS_8BIT As Integer = 0             ' (default)  
    Public Const IS_16BIT As Integer = 1

    ' Bayer Conversion definitions
    ' (used with REG_BAYER_CONVERSION)

    Public Const DE_BAYER_3x3 As Integer = 0
    Public Const DE_BAYER_5x5 As Integer = 1        ' (default)           

    ' Gamma definitions
    ' (used with REG_GAMMA_MODE)

    Public Const GAMMA_MODE_DEFAULT As Integer = 2  ' (default)   
    Public Const GAMMA_MODE_sRGB As Integer = 1
    Public Const GAMMA_MODE_ITU709 As Integer = 0   ' (HDTV)


    ' Graphic definitions 
    ' (used with REG_GRAPHIC_MODE)

    Public Const DISPLAY_GDI As Integer = 0
    Public Const DISPLAY_D3D As Integer = 1


    ' Camera parameters definitions

    Public Const REG_BRIGHTNESS As Integer = 1
    Public Const REG_CONTRAST As Integer = 2
    Public Const REG_GAMMA As Integer = 3
    Public Const REG_FLIPPED_V As Integer = 4          ' (ON||OFF)
    Public Const REG_FLIPPED_H As Integer = 5          ' (ON||OFF)
    Public Const REG_WHITE_BALANCE As Integer = 6      ' (one push)
    Public Const REG_EXPOSURE_TIME As Integer = 7
    Public Const REG_EXPOSURE_TARGET As Integer = 8    ' sets the target-value for the auto exposure algorithm 
    Public Const REG_RED As Integer = 9
    Public Const REG_GREEN As Integer = 10
    Public Const REG_BLUE As Integer = 11
    Public Const REG_BLACKLEVEL As Integer = 12
    Public Const REG_GAIN As Integer = 13
    Public Const REG_COLOR As Integer = 14             '(ON||OFF) read: color || bw model
    Public Const REG_PLL As Integer = 15
    Public Const REG_STROBE_LENGHT As Integer = 16
    Public Const REG_STROBE_DELAY As Integer = 17
    Public Const REG_TRIGGER_DELAY As Integer = 18
    Public Const REG_SATURATION As Integer = 19        ' only for color models (if REG_COLOR_ENHANCE is ON)
    Public Const REG_COLOR_ENHANCE As Integer = 20     ' obsolet
    Public Const REG_TRIGGER_INVERT As Integer = 21    ' (FALLING_EDGE (default) || RISING_EDGE)
    Public Const REG_RECONNECTIONS As Integer = 22     ' get the value of usb reconnections
    Public Const REG_MEASURE_FIELD_AE As Integer = 23  ' measure field for auto exposure
    Public Const REG_AVI_STATE As Integer = 24         ' get the avi stream save status (ON||OFF)
    Public Const REG_FOCUS As Integer = 25
    Public Const REG_SHUTTER As Integer = 26
    Public Const REG_ROI_ID As Integer = 27            ' (4133CU/BU,4203CU/BU)
    Public Const REG_ROI_CYCLE As Integer = 28         ' (4133CU/BU,4203CU/BU) number of repetitions of the particular roi

    Public Const REG_DEFECT_COR As Integer = 43        ' (4133CU/BU,4203CU/BU) DefectPixelCorrection (ON||OFF); OFF(default)
    Public Const REG_SW_TRIG_MODE As Integer = 94
    Public Const REG_ROI_FPGA_ONE_FRAME As Integer = 96 ' (fpga board only) pseudo frame format (ON||OFF)	
    Public Const REG_CALLBACK_BR_FRAMES As Integer = 97 ' Broken frames also triggering the callback function (ON||OFF); OFF(default)
    Public Const REG_FGPA_VBLANKING As Integer = 98    ' (fpga board only) output Frame blanking
    Public Const REG_FGPA_HBLANKING As Integer = 99    ' (fpga board only) output Frame blanking
    Public Const REG_FGPA_CLK_DIVIDER As Integer = 100 ' (fpga board only) output clock divider (ON||OFF)
    Public Const REG_FGPA_ON_BOARD As Integer = 101    ' check if camera has fpga board (ON||OFF)

    Public Const REG_SET_GPIO As Integer = 102          ' bit masked: XXXX X J3-7 J3-6 J3-5
    Public Const REG_GET_GPIO As Integer = 103          ' bit masked: XXXX X J3-7 J3-6 J3-5
    Public Const REG_SET_GPIO_MODE As Integer = 104     ' (0==Input || 1==Output),bit masked: XXXX X J3-7 J3-6 J3-5

    Public Const REG_MASK_ROI_ID As Integer = 105       ' roi_id masked in buffersize of callback 

    Public Const REG_RED_OFFSET As Integer = 106        ' only for color models; RGB offset value
    Public Const REG_GREEN_OFFSET As Integer = 107      ' only for color models
    Public Const REG_BLUE_OFFSET As Integer = 108       ' only for color models

    Public Const REG_HUE As Integer = 109               ' only for color models; write: only when REG_COLOR_PROCCESSING enabled, read: always
    Public Const REG_COLOR_CORRECTION As Integer = 110  ' (ON||OFF) ColorCorrection matrix; OFF (default)
    Public Const REG_GAMMA_ENABLE As Integer = 111      ' (ON||OFF) en/disable gamma module to save CPU load; ON (default)
    Public Const REG_GAMMA_MODE As Integer = 112        ' only for color models ; write: only when REG_GAMMA_ENABLE enabled, read: always
    Public Const REG_INVERT_PIXEL As Integer = 113      ' (ON||OFF)  bw cams only
    Public Const REG_TNR As Integer = 115               ' (ON||OFF)  only for color models, temporal noise reduction
    Public Const REG_BAYER_CONVERSION As Integer = 116  ' only for color models; choose different debayering
    Public Const REG_COLOR_PROCESSING As Integer = 117  ' (ON||OFF) en/disable color proc module module to save CPU load;  ON (default)	
    Public Const REG_USB_SPEED As Integer = 118         ' 0: usb port is high speed, 1: usb port is super speed capable (useful for super speed camera)
    Public Const REG_DEVICE_SPEED As Integer = 119      ' 0: camera is high speed, 1: camera is super speed capable
    Public Const REG_DATA_TRANSMISSION As Integer = 120 ' 0: 8 bit per pixel, 1: 16 bit per pixel in raw mode
    Public Const REG_SIGNIFICANT_BITS As Integer = 125  ' number of significant bits in pixel 
    Public Const REG_GRAPHIC_MODE As Integer = 126      ' GDI (default)|| D3D 
    Public Const REG_EDGE_ENHANCEMENT As Integer = 128  ' (ON||OFF) edge enhancement; OFF (default)
    Public Const REG_EDGE_ENHANCEMENT_GAIN As Integer = 129 ' 0-128 (default 64)
    Public Const REG_SENSOR_STROBE As Integer = 132     ' (4133CU/BU,4203CU/BU) sensor strobe (ON||OFF); OFF(default)

    Public Const REG_TRIG_TIMEOUT As Integer = 138      ' (super speed cameras) default: 20000 msec
    Public Const REG_PIPE_TIMEOUT_MODE As Integer = 139 ' (super speed cameras) overwrite default configuration
    Public Const REG_RESET_CAMERA As Integer = 140      ' reset the camera
    Public Const REG_DISCONNECTIONS As Integer = 141    ' get the value of camera disconnections
    Public Const REG_XACT_RECOVER_MODE As Integer = 142 ' (superspeed camera only) recover transaction errors
    Public Const REG_RESET_TO_DEFAULT As Integer = 143  ' reset all camera parameters to default values

    Public Const REG_SW_TRIG_WD_MODE As Integer = 146   ' (ON||OFF); ON(default)
    Public Const REG_AQU_FRAMERATE As Integer = 147     ' (2234CU/BU) get/set the framerate
    Public Const REG_SENSOR_STROBE_DELAY As Integer = 148 ' (4133CU/BU,4203CU/BU) only	
    Public Const REG_SENSOR_OVERLAPPED As Integer = 149 ' (4133CU/BU,4203CU/BU) only 
    Public Const REG_TRIG_DELAY_DIVIDER As Integer = 150 ' (4133CU/BU,4203CU/BU) 

    ' Parameter definitions
    ' (used with: ICubeSDK_GetCamParameterRange)

    Structure PARAM_PROPERTY
        Dim bEnabled As Integer
        Dim bAuto As Integer
        Dim bOnePush As Integer
        Dim nDef As Integer
        Dim nMin As Integer
        Dim nMax As Integer
    End Structure

    Public Const DEFAULT_GAMMA As Integer = 64

    ' Parameter definitions (float value)
    ' (used with: ICubeSDK_GetExposureRange)
    ' values in [msec]

    Structure PARAM_PROPERTY_f
        Dim bEnabled As Integer
        Dim bAuto As Integer
        Dim bOnePush As Integer
        Dim nDef As Single
        Dim nMin As Single
        Dim nMax As Single
    End Structure

    ' Roi definitions
    ' (used with: REG_ROI_ID)

    ' ROI ID: (4133CU/BU)
    ' SIMR: Single Integration Multiple Roi  (4133CU/BU only)
    ' 1, 2 or 4 areas of interest to be acquired within the same integrated image
    ' MIMR: Multible Integration Multiple Roi (4133CU/BU only)
    ' 
    Public Const ROI_ID_1_2 As Integer = 0        ' SIMR (4133CU/BU only)
    Public Const ROI_ID_1_1 As Integer = 1        ' default mode for all models (1st roi)
    Public Const ROI_ID_2 As Integer = 2          ' MIMR additonal (4133CU/BU only)
    Public Const ROI_ID_3 As Integer = 3
    Public Const ROI_ID_4 As Integer = 4

    ' ROI ID: (all cameras with fpga board)
    '
    Public Const ROI_ID_0 As Integer = 0        ' fpga input size
    Public Const ROI_ID_1 As Integer = 1        ' fpga output size roi 1
    Public Const ROI_ID_2_ As Integer = 2
    Public Const ROI_ID_3_ As Integer = 3
    Public Const ROI_ID_4_ As Integer = 4
    Public Const ROI_ID_5 As Integer = 5

' ROI ID: (all cameras without fpga board,except 4133CU/BU)
    ' only one roi available (roi1)

    ' (used with: ICubeSDK_SetResolution, ICubeSDK_GetResolution)

    Structure ROI_PROPERTY
        Dim bEnabled As Integer
        Dim nXRes As Integer
        Dim nYRes As Integer
        Dim nXPos As Integer
        Dim nYPos As Integer
    End Structure

    ' Due to usb packet size, the Region of interest size has limitations.
    ' The horizontal and vertical Roi-size must be dividable by 4. 

    Public Const ROI_STEP_SIZE As Integer = 4

    ' (11000CU/BU only)
    ' Due to sensor limitations, 
    ' the horizontal and vertical Roi-size must be dividable by 8. 

    Public Const ROI_STEP_SIZE_11000 As Integer = 8

    ' (used with: ICubeSDK_GetCamParameterRange)

    Structure ROI_RANGE_PROPERTY
        Dim nXMin As Integer
        Dim nXMax As Integer
        Dim nYMin As Integer
        Dim nYMax As Integer
    End Structure

    ' Trigger definitions
    ' (used with: ICubeSDK_SetTrigger, ICubeSDK_GetTrigger)

    Public Const TRIG_SW_START As Integer = 0      ' start software trigger
    Public Const TRIG_SW_DO As Integer = 1         ' do a software trigger pulse
    Public Const TRIG_HW_START As Integer = 2      ' start hardware trigger
    Public Const TRIG_STOP As Integer = 3          ' stop software || hardware trigger
    Public Const TRIG_SW_START_2 As Integer = 4    ' GRR mode (1500CU/BU,1300CU,NET3_11000BU/CU)
    Public Const TRIG_HW_START_2 As Integer = 5    ' GRR mode (1500CU/BU,1300CU,NET3_11000BU/CU)

    ' Versions definitions
    ' (used with: ICubeSDK_GetVersion)

    Public Const DLL_VERSION As Integer = 0             ' (NET_USB_CMO.dll)
    Public Const API_VERSION As Integer = 1             ' (ICubeSDK.dll.dll)

    ' Callback definitions
    ' (used with: ICubeSDK_SetCallback)

    Public Const CALLBACK_RAW As Integer = 0            ' 8bit/pixel data is received
    ' (if the camera is a color model data == raw bayer)
    Public Const CALLBACK_RGB As Integer = 1            ' 24bit/pixel data is received

    ' DisplayMode definitions
    ' (used with: ICubeSDK_SetDisplayMode)

    Public Const DISPLAY_NORMAL As Integer = 0         ' frame is previewed in original size (default)
    Public Const DISPLAY_FIT_TO_WINDOW As Integer = 1  ' frame is previewed in resized mode (window size) 
    Public Const DISPLAY_RECT As Integer = 2           ' frame is previewed in resized mode (rect size)

    Structure DISP_PROPERTY
        Dim left As Integer
        Dim top As Integer
        Dim right As Integer
        Dim bottom As Integer
    End Structure

    ' AVI stream definitions
    ' (used with: ICubeSDK_SaveAvi)

    Public Const AVI_DIB As Integer = 0    'currently, only this avi mode is supported


    ' Name length definitions
    ' (used with: ICubeSDK_GetName,ICubeSDK_GetSerialNum,ICubeSDK_GetVersion,ICubeSDK_GetFWVersion)

    Public Const NETCAM_NAME_LENGTH As Integer = 14     ' length of the name string
    Public Const NETCAM_SERIAL_LENGTH As Integer = 10   ' length of the serial number string
    Public Const NETCAM_VERSION_LENGTH As Integer = 9   ' length of the version string

    ' IsOpen definitions
    ' (used with: ICubeSDK_IsOpen)

    Public Const IS_CLOSED As Integer = 0
    Public Const IS_OPEN As Integer = 1

    ' IsStarted definitions
    ' (used with: ICubeSDK_IsStarted)

    Public Const IS_STOPPED As Integer = 0
    Public Const IS_STARTED As Integer = 1

    ' event definitions
    ' (used with: ICubeSDK_SetCallbackEx)

    Public Const EVENT_NEW_FRAME As Integer = 0
    Public Const EVENT_DEV_DISCONNECTED As Integer = 1      ' a camera is disconnected	
    Public Const EVENT_DEV_RECONNECTED As Integer = 2       ' a camera is reconnected		
    Public Const EVENT_USB_TRANSFER_FAILED As Integer = 3   ' a usb transaction error occured during streaming

    ' pipe timeout mode definitions
    ' (used with: REG_PIPE_TIMEOUT_MODE)

    Public Const MODE_TIMEOUT_NONE As Integer = 0
    Public Const MODE_TIMEOUT_ALL As Integer = 1
    Public Const MODE_TIMEOUT_PART As Integer = 2

    ' parameter set definitions
    '(used with: ICubeSDK_CamParameterSet())

    Public Const PARAMETER_LOAD_TO_FILE As Integer = 0      ' load from camera to .ini-file
    Public Const PARAMETER_LOAD_FROM_FILE As Integer = 1    ' load from .ini-file to camera 

    '''''''''''''''''''''''''''''''''''''''''
    ''
    ''          Camera control functions
    ''
    ''''''''''''''''''''''''''''''''''''''''

    Public Declare Function ICubeSDK_Init Lib "ICubeSDK" () As Integer

    Public Declare Function ICubeSDK_Open Lib "ICubeSDK" (ByVal nCamIndex As Integer) As Integer

    Public Declare Function ICubeSDK_Close Lib "ICubeSDK" (ByVal nCamIndex As Integer) As Integer

    Public Declare Function ICubeSDK_IsOpen Lib "ICubeSDK" (ByVal nCamIndex As Integer) As Integer

    Public Declare Function ICubeSDK_IsOpenEx Lib "ICubeSDK" (ByVal nCamIndex As Integer) As Integer

    Public Declare Function ICubeSDK_SetCallback Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal nMode As Integer, _
                          ByVal pCallbackFunc As MyCallback, ByRef pCBContext As Integer) As Integer

    Public Declare Function ICubeSDK_SetCallbackEx Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal nMode As Integer, _
                       ByVal pCallbackFunc As MyCallbackEx, ByRef pCBContext As Integer) As Integer

    Public Declare Function ICubeSDK_Start Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal ImgHandle As Integer, ByVal Preview As Integer, ByVal Callback As Integer) As Integer
    'Public Declare Function ICubeSDK_Start Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal ImgHandle As IntPtr, ByVal Preview As Integer, ByVal Callback As Integer) As Integer

    Public Declare Function ICubeSDK_IsStarted Lib "ICubeSDK" (ByVal nCamIndex As Integer) As Integer

    Public Declare Function ICubeSDK_Stop Lib "ICubeSDK" (ByVal nCamIndex As Integer) As Integer

    Public Declare Function ICubeSDK_GetName Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal Name As String) As Integer

    Public Declare Function ICubeSDK_GetBrokenFrames Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByRef pnFrames As Integer) As Integer

    Public Declare Function ICubeSDK_GetGoodFrames Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByRef pnFrames As Integer) As Integer

    Public Declare Function ICubeSDK_GetSize Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByRef pnXRes As Integer, ByRef pnYRes As Integer) As Integer

    Public Declare Function ICubeSDK_SetDisplayMode Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal nMode As Integer, ByVal roiprop As DISP_PROPERTY) As Integer

    '''''''''''''''''''''''''''''''''''''''''
    ''
    ''          Version functions
    ''
    ''''''''''''''''''''''''''''''''''''''''

    Public Declare Sub ICubeSDK_GetVersion Lib "ICubeSDK" (ByVal nType As Integer, ByVal pVersion As String)

    Public Declare Function ICubeSDK_GetFWVersion Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal pVersion As String) As Integer

    Public Declare Function ICubeSDK_GetSerialNum Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal pVersion As String) As Integer

    '''''''''''''''''''''''''''''''''''''''''
    ''
    ''          ROI functions
    ''
    ''''''''''''''''''''''''''''''''''''''''


    Public Declare Function ICubeSDK_SetResolution Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByRef roiprop As ROI_PROPERTY) As Integer

    Public Declare Function ICubeSDK_GetResolution Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByRef roiprop As ROI_PROPERTY) As Integer

    Public Declare Function ICubeSDK_GetResolutionRange Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByRef roiprop As ROI_RANGE_PROPERTY) As Integer

    Public Declare Function ICubeSDK_SetResolutionParam Lib "ICubeSDK" (ByVal nCamIndex As Long, ByVal ImgHandle As Long, ByVal Preview As Long, ByVal Callback As Long) As Long

    '''''''''''''''''''''''''''''''''''''''''
    ''
    ''          Mode functions
    ''
    ''''''''''''''''''''''''''''''''''''''''


    Public Declare Function ICubeSDK_SetMode Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal nMode As Integer) As Integer

    Public Declare Function ICubeSDK_GetMode Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByRef nMode As Integer) As Integer

    Public Declare Function ICubeSDK_GetModeList Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByRef pLength As Integer, _
                            ByVal pList As Integer()) As Integer

    '''''''''''''''''''''''''''''''''''''''''
    ''
    ''          Bin Skip functions
    ''
    ''''''''''''''''''''''''''''''''''''''''

    Public Declare Function ICubeSDK_SetBinSkip Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal nParameter As Integer, ByVal nMode As Integer) As Integer

    Public Declare Function ICubeSDK_GetBinSkip Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByRef nParameter As Integer, ByVal nMode As Integer) As Integer

    Public Declare Function ICubeSDK_GetBinSkipList Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal nMode As Integer, ByRef pLength As Integer, _
                            ByVal pList As Integer()) As Integer

    '''''''''''''''''''''''''''''''''''''''''
    ''
    ''          Save functions
    ''
    ''''''''''''''''''''''''''''''''''''''''

    Public Declare Function ICubeSDK_SaveToFile Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal Name As String) As Integer
    Public Declare Function ICubeSDK_SaveAvi Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal Name As String, ByVal nMode As Integer, ByVal nTimeInSecs As Integer) As Integer

    '''''''''''''''''''''''''''''''''''''''''
    ''
    ''          Trigger functions
    ''
    ''''''''''''''''''''''''''''''''''''''''

    Public Declare Function ICubeSDK_SetTrigger Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal nMode As Integer) As Integer

    Public Declare Function ICubeSDK_GetTrigger Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByRef nMode As Integer) As Integer

    '''''''''''''''''''''''''''''''''''''''''
    ''
    ''          Parameter functions
    ''
    ''''''''''''''''''''''''''''''''''''''''

    Public Declare Function ICubeSDK_SetCamParameter Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal Type As Integer, ByVal Value As Integer) As Integer

    Public Declare Function ICubeSDK_GetCamParameter Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal Type As Integer, ByRef Value As Long) As Integer

    Public Declare Function ICubeSDK_GetCamParameterRange Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal Type As Integer, ByRef paramprop As PARAM_PROPERTY) As Integer

    Public Declare Function ICubeSDK_CamParameterSet Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal nCmd As Integer, ByVal Name As String) As Integer

    '''''''''''''''''''''''''''''''''''''''''
    ''
    ''          Exposure functions 
    ''          This functions can be used alternativly to parameter functions
    ''          for manipulating exposure only. Parameter Value is in milli-seconds.
    ''          Be aware that every change of clock
    ''          and width will lead to different exposure values
    ''
    ''''''''''''''''''''''''''''''''''''''''

    Public Declare Function ICubeSDK_SetExposure Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal Value As Single) As Integer

    Public Declare Function ICubeSDK_GetExposure Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByRef Value As Single) As Integer

    Public Declare Function ICubeSDK_GetExposureRange Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByRef paramprop As PARAM_PROPERTY_f) As Integer

    '''''''''''''''''''''''''''''''''''''''''
    ''
    ''       for Parameter functions and Exposure functions
    ''
    ''''''''''''''''''''''''''''''''''''''''

    Public Declare Function ICubeSDK_GetParamAuto Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal Type As Integer, ByRef bAuto As Integer) As Integer

    Public Declare Function ICubeSDK_SetParamAuto Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal Type As Integer, ByVal bAuto As Integer) As Integer

    Public Declare Function ICubeSDK_SetParamOnePush Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal Type As Integer) As Integer

    Public Declare Function ICubeSDK_SetParamAutoDef Lib "ICubeSDK" (ByVal nCamIndex As Integer, ByVal Type As Integer) As Integer



End Class


