Attribute VB_Name = "PimMegaApi"
'/***************************************************************************************************************
' * COPYRIGHT  2003 PixeLINK CORPORATION.  ALL RIGHTS RESERVED.                                                *
' *                                                                                                             *
' * Copyright Notice and Disclaimer of Liability:                                                               *
' *                                                                                                             *
' *                                                                                                             *
' * PixeLINK Corporation is henceforth referred to as PixeLINK or PixeLINK Corporation.                         *
' * Purchaser henceforth refers to the original purchaser(s) of the equipment, and/or any legitimate user(s).   *
' *                                                                                                             *
' * PixeLINK hereby explicitly prohibits any form of reproduction (with the express strict exception for backup *
' * and archival purposes, which are allowed as stipulated within the License Agreement for PixeLINK Corporation*
' * Software), modification, and/or distribution of this software and/or its associated documentation unless    *
' * explicitly specified in a written agreement signed by both parties.                                         *
' *                                                                                                             *
' * To the extent permitted by law, PixeLINK disclaims all other warranties or conditions of any kind, either   *
' * express or implied, including but not limited to all warranties or conditions of merchantability and        *
' * fitness for a particular purpose and those arising by statute or otherwise in law or from a course of       *
' * dealing or usage of trade. Other written or oral statements by PixeLINK, its representatives, or others do  *
' * not constitute warranties or conditions of PixeLINK.                                                        *
' *                                                                                                             *
' * PixeLINK makes no guarantees or representations, including but not limited to: the use of, or the result(s) *
' * of the use of: the software and associated documentation in terms of corness, accuracy, reliability,        *
' * being current, or otherwise. The Purchaser hereby agree to rely on the software, associated hardware and    *
' * documentation and results stemming from the use thereof solely at their own risk.                           *
' *                                                                                                             *
' * By using the products(s) associated with the software, and/or the software, the Purchaser and/or user(s)    *
' * agree(s) to abide by the terms and conditions set forth within this document, as well as, respectively,     *
' * any and all other documents issued by PixeLINK in relation to the product(s).                               *
' *                                                                                                             *
' * PixeLINK is hereby absolved of any and all liability to the Purchaser, and/or a third party, financial or   *
' * otherwise, arising from any subsequent loss, direct and indirect, and damage, direct and indirect,          *
' * resulting from intended and/or unintended usage of its software, product(s) and documentation, as well      *
' * as additional service(s) rendered by PixeLINK, such as technical support, unless otherwise explicitly       *
' * specified in a written agreement signed by both parties. Under no circumstances shall the terms and         *
' * conditions of such an agreement apply retroactively.                                                        *
' *                                                                                                             *
' ***************************************************************************************************************/

' ------------------------------------------------------------------------
'
'    PimMegaApi.TXT -- PixeLINK(tm) API Declarations for Visual Basic
'
'       Needs to be installed in
'         <PROGRAM FILES>\Microsoft Visual Studio\Common\Tools\Winapi
' ------------------------------------------------------------------------

'------------------------------------------------------------------------
'
'    For safety, the Following Constants  and Types should be obtained from the system
'
'    Make the Api Viewer available
'        Add-Ins -> Add-In Manager -> VB6 Api Viewer
'
'    Add in the Constants - Note that they must be in order:
'       Add-Ins -> API Viewer
'         File -> Load Text File
'           <PROGRAM FILES>\Microsoft Visual Studio\Common\Tools\Winapi\Win32Api.txt
'
'           API Type    - Constants
'
'           API Type    - Types
' ------------------------------------------------------------------------
Public Const WS_CHILD As Long = &H40000000
Public Const WS_VISIBLE As Long = &H10000000
Public Const WS_CAPTION As Long = &HC00000                  '  WS_BORDER Or WS_DLGFRAME
Public Const WS_SYSMENU As Long = &H80000
Public Const WS_THICKFRAME As Long = &H40000
Public Const WS_MAXIMIZEBOX As Long = &H10000
Public Const WS_MINIMIZEBOX As Long = &H20000
Public Const WS_OVERLAPPED As Long = &H0
Public Const WS_OVERLAPPEDWINDOW As Long = (WS_OVERLAPPED Or WS_CAPTION Or WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX)
Public Const THREAD_BASE_PRIORITY_MIN As Long = -2
Public Const THREAD_PRIORITY_LOWEST = THREAD_BASE_PRIORITY_MIN
Public Const THREAD_PRIORITY_BELOW_NORMAL = (THREAD_PRIORITY_LOWEST + 1)

 Public Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
 End Type

'**************************
'   CONSTANT Declarations
'
'**************************
'
' Specific Characteristics
Public Const PXL_MAX_WIDTH As Long = 1280
Public Const PXL_MAX_HEIGHT As Long = 1024
Public Const PXL_MIN_HEIGHT As Long = 32
Public Const PXL_MIN_WIDTH As Long = 32
Public Const PXL_DEFAULT_WIDTH As Long = 640
Public Const PXL_DEFAULT_HEIGHT As Long = 480

' Decimation Codes
Public Const PXL_NO_DECIMATION As Long = 1
Public Const PXL_DECIMATE_BY_2 As Long = 2
Public Const PXL_DECIMATE_BY_4 As Long = 4

' Data Transfer Sizes
Public Const PXL_8BIT_DATA As Long = 8
Public Const PXL_16BIT_DATA As Long = 16

' Clock Rates
Public Const PXL_24MHZ As Long = &H80
Public Const PXL_16MHZ As Long = &H0
Public Const PXL_12MHZ As Long = &H81
Public Const PXL_8MHZ As Long = &H1
Public Const PXL_6MHZ As Long = &H82
Public Const PXL_4MHZ As Long = &H2

' Max size of serial command packets
Public Const PXL_MAX_COMMAND_SIZE As Long = &H60

' Friendly Name (use this for all operating systems)
Public Const PXL_FRIENDLY_NAME As String = "PixeLINK(tm) 1394 Camera"

' Imager Types
Public Const PXL_UNKNOWN_IMAGER As Long = 0
Public Const PXL_MONOCHROME_IMAGER As Long = 1
Public Const PXL_COLOR_IMAGER As Long = 2

' Sensor Types
Public Const PXL_UNKNOWN_SENSOR As Long = 0
Public Const PXL_PCS2112_SENSOR As Long = 1
Public Const PXL_KAC1310_SENSOR As Long = 2

' Default Timeout
Public Const PXL_DEFAULT_TIMEOUT As Long = 4000

' Light Source Codes
Public Const PXL_LIGHT_32K As Long = &H1
Public Const PXL_LIGHT_D55 As Long = &H2
Public Const PXL_LIGHT_F2 As Long = &H3
Public Const PXL_LIGHT_F7 As Long = &H4

' Gpo Codes
Public Const PXL_GPO1 As Long = 1
Public Const PXL_GPO2 As Long = 2

' Video Modes
Public Const STILL_MODE As Long = 0
Public Const VIDEO_MODE As Long = 1

' Color Conversion codes
Public Const BAYER_2BY2_COLOR As Long = &H0               ' Fastest
Public Const BAYER_3BY3_COLOR As Long = &H1               ' Fast
Public Const BAYER_3BY3GGRAD_COLOR As Long = &H2          ' Best quality for realtime
Public Const BAYER_2PASSGRAD_COLOR As Long = &H3          ' Best for captured images
Public Const BAYER_2PASSADAPT_COLOR As Long = &H4         ' Best for captured images
Public Const BAYER_VARGRAD_COLOR As Long = &H5            ' Best for captured images
Public Const BAYER_2BY2_MONO As Long = &H10               ' Fastest (monochrome)
Public Const BAYER_3BY3_MONO As Long = &H11               ' Best quality for realtime (monochrome)
Public Const BAYER_ADAPT_MONO As Long = &H12              ' Best for captured images (monochrome)
Public Const BAYER_NO_CONVERSION As Long = &HFF           ' No bayer conversion

' Data Format Types (for Overlay Callback)
Public Const RGB_MONO8 As Long = &H1
Public Const RGB_MONO16 As Long = &H2
Public Const RGB_COLOR24 As Long = &H3
Public Const RGB_COLOR48 As Long = &H4

' Return Codes
Public Const API_SUCCESS As Long = 0
Public Const API_NULL_HANDLE_ERROR As Long = 1
Public Const API_NULL_POINTER_ERROR As Long = 2
Public Const API_NO_DEVICE_ERROR As Long = 3
Public Const API_COM_ERROR As Long = 4
Public Const API_IOCTL_ERROR As Long = 5
Public Const API_FILE_OPEN_ERROR As Long = 6
Public Const API_INVALID_PARAMETER_ERROR As Long = 7
Public Const API_IMAGER_UNKNOWN_ERROR As Long = 8
Public Const API_OUT_OF_MEMORY_ERROR As Long = 9
Public Const API_UNKNOWN_ERROR As Long = &HA
Public Const API_NO_PREVIEW_RUNNING_ERROR As Long = &HB
Public Const API_NOT_SUPPORTED_ERROR As Long = &HC
Public Const API_INVALID_FUNCTION_CALL_ERROR As Long = &HD
Public Const API_HARDWARE_ERROR As Long = &HE
Public Const API_OS_VERSION_ERROR As Long = &HF
Public Const API_MAXIMUM_ITERATIONS_ERROR As Long = &H10
Public Const API_TIMEOUT_ERROR As Long = &H11
Public Const API_CLOCK_CHANGED_WARNING As Long = &H12

' Operating Systems
Public Const UNKNOWN_OS As Long = 0
Public Const WIN98 As Long = 1
Public Const WINNT4 As Long = 2
Public Const WINNT5 As Long = 3

' Structure to return Hardware Version
Public Type HARDWARE_VERSION
        ProductID(1 To 100) As Byte
        SerialNumber(1 To 9) As Byte
        FirmwareVersion(1 To 12) As Byte
        FpgaVersion(1 To 3) As Byte
        SensorType As Byte   ' New [20020729]
End Type

'***************************************************
'   FUNCTION Declarations - must follow constants
'
'   Note: These declarations can be used immediately - just by adding this
'         file to the VB project because the Default for "Declare Function"
'         is Public.
'         If memory is a problem, it is better to use API Viewer to add in
'         the required declarations as each one takes up quite a few bytes.
'
'***************************************************
'
Declare Function PimMegaAutoExposure Lib "PimMegaApi.DLL" Alias "_PimMegaAutoExposure@28" (ByVal lImager As Long, ByVal lValue As Long, Optional ByVal bWindow As Boolean = False, Optional ByVal lLeft As Long = 0, Optional ByVal lTop As Long = 0, Optional ByVal lWidth As Long = 4, Optional ByVal lHeight As Long = 4) As Long
Declare Function PimMegaCaptureAVI Lib "PimMegaApi.DLL" Alias "_PimMegaCaptureAVI@12" (ByVal lImager As Long, ByVal lNumberOfFrames As Long, ByVal strFileName As String) As Long
Declare Function PimMegaCaptureFrameToBitmap Lib "PimMegaApi.DLL" Alias "_PimMegaCaptureFrameToBitmap@44" (ByVal lImager As Long, ByVal dExposureTime As Single, ByVal bUseFlash As Boolean, ByVal dFlashDelay As Single, ByVal bUseShutter As Boolean, ByVal dShutterDelay As Single, ByVal dShutterCloseDelay As Single, ByVal strFileName As String, Optional ByVal bColorCor As Boolean = False, Optional ByVal lSaturation As Long = 0, Optional ByVal lColorConversion As Long = BAYER_3BY3_COLOR) As Long
Declare Function PimMegaColorCorrectRgb Lib "PimMegaApi.DLL" Alias "_PimMegaColorCorrectRgb@20" (ByVal lImager As Long, ByVal lWidth As Long, ByVal lHeight As Long, ByRef lBuffer As Byte, ByVal lSaturation As Long) As Long
Declare Function PimMegaConvertColor16BppTo24Bpp Lib "PimMegaApi.DLL" Alias "_PimMegaConvertColor16BppTo24Bpp@24" (ByVal lImager As Long, ByRef bytFirstRaw As Byte, ByVal lSubWindowWidth As Long, ByVal lSubWindowHeight As Long, ByRef bytFirstRGB As Byte, Optional ByVal lColorConversion As Long = BAYER_3BY3_COLOR) As Long
Declare Function PimMegaConvertColor16BppTo48Bpp Lib "PimMegaApi.DLL" Alias "_PimMegaConvertColor16BppTo48Bpp@24" (ByVal lImager As Long, ByRef bytFirstRaw As Byte, ByVal lSubWindowWidth As Long, ByVal lSubWindowHeight As Long, ByRef bytFirstRGB As Byte, Optional ByVal lColorConversion As Long = BAYER_3BY3_COLOR) As Long
Declare Function PimMegaConvertColor8BppTo24Bpp Lib "PimMegaApi.DLL" Alias "_PimMegaConvertColor8BppTo24Bpp@24" (ByVal lImager As Long, ByRef bytFirstRaw As Byte, ByVal lSubWindowWidth As Long, ByVal lSubWindowHeight As Long, ByRef bytFirstRGB As Byte, Optional ByVal lColorConversion As Long = BAYER_3BY3_COLOR) As Long
Declare Function PimMegaConvertMono16BppTo24Bpp Lib "PimMegaApi.DLL" Alias "_PimMegaConvertMono16BppTo24Bpp@20" (ByVal lImager As Long, ByRef bytFirstRaw As Byte, ByVal lSubWindowWidth As Long, ByVal lSubWindowHeight As Long, ByRef bytFirstRGB As Byte) As Long
Declare Function PimMegaConvertMono8BppTo24Bpp Lib "PimMegaApi.DLL" Alias "_PimMegaConvertMono8BppTo24Bpp@20" (ByVal lImager As Long, ByRef bytFirstRaw As Byte, ByVal lSubWindowWidth As Long, ByVal lSubWindowHeight As Long, ByRef bytFirstRGB As Byte) As Long
Declare Function PimMegaFlushVideoData Lib "PimMegaApi.DLL" Alias "_PimMegaFlushVideoData@4" (ByVal lImager As Long) As Long
Declare Function PimMegaGetBlueGain Lib "PimMegaApi.DLL" Alias "_PimMegaGetBlueGain@8" (ByVal lImager As Long, ByRef lValue As Long) As Long
Declare Function PimMegaGetCurrentFrameRate Lib "PimMegaApi.DLL" Alias "_PimMegaGetCurrentFrameRate@8" (ByVal lImager As Long, ByRef sFrameRate As Single) As Long
Declare Function PimMegaGetDataTransferSize Lib "PimMegaApi.DLL" Alias "_PimMegaGetDataTransferSize@8" (ByVal lImager As Long, ByRef lSize As Long) As Long
Declare Function PimMegaGetExposure Lib "PimMegaApi.DLL" Alias "_PimMegaGetExposure@8" (ByVal lImager As Long, ByRef lValue As Long) As Long
Declare Function PimMegaGetExposureGain Lib "PimMegaApi.DLL" Alias "_PimMegaGetExposureGain@8" (ByVal lImager As Long, ByRef sValue As Single) As Long
Declare Function PimMegaGetExposureTime Lib "PimMegaApi.DLL" Alias "_PimMegaGetExposureTime@8" (ByVal lImager As Long, ByRef dValue As Single) As Long
Declare Function PimMegaGetGamma Lib "PimMegaApi.DLL" Alias "_PimMegaGetGamma@8" (ByVal lImager As Long, ByRef sValue As Single) As Long
Declare Function PimMegaGetGpo Lib "PimMegaApi.DLL" Alias "_PimMegaGetGpo@12" (ByVal lImager As Long, ByRef bytpValue As Long, Optional ByVal lGpo As Long = PXL_GPO1) As Long
Declare Function PimMegaGetGreenGain Lib "PimMegaApi.DLL" Alias "_PimMegaGetGreenGain@8" (ByVal lImager As Long, ByRef lValue As Long) As Long
Declare Function PimMegaGetHardwareVersion Lib "PimMegaApi.DLL" Alias "_PimMegaGetHardwareVersion@8" (ByVal lImager As Long, ByRef lValue As Byte) As Long
Declare Function PimMegaGetImageFlip Lib "PimMegaApi.DLL" Alias "_PimMegaGetImageFlip@12" (ByVal lImager As Long, ByRef lHorizontal As Long, ByRef lVertical As Long) As Long
Declare Function PimMegaGetImagerChipId Lib "PimMegaApi.DLL" Alias "_PimMegaGetImagerChipId@8" (ByVal lImager As Long, ByRef lValue As Long) As Long
Declare Function PimMegaGetImagerClocking Lib "PimMegaApi.DLL" Alias "_PimMegaGetImagerClocking@8" (ByVal lImager As Long, ByRef lValue As Long) As Long
Declare Function PimMegaGetImagerName Lib "PimMegaApi.DLL" Alias "_PimMegaGetImagerName@8" (ByVal lImager As Long, ByVal strName As String) As Long
Declare Function PimMegaGetImagerType Lib "PimMegaApi.DLL" Alias "_PimMegaGetImagerType@8" (ByVal lImager As Long, ByRef lValue As Long) As Long
Declare Function PimMegaGetLightSource Lib "PimMegaApi.DLL" Alias "_PimMegaGetLightSource@8" (ByVal lImager As Long, ByRef lValue As Long) As Long
Declare Function PimMegaGetLockValue Lib "PimMegaApi.DLL" Alias "_PimMegaGetLockValue@8" (ByVal lImager As Long, ByRef lValue As Long) As Long
Declare Function PimMegaGetMaxExposureTime Lib "PimMegaApi.DLL" Alias "_PimMegaGetMaxExposureTime@28" (ByVal lImager As Long, ByVal lDecimation As Long, ByVal lWidth As Long, ByVal lHeight As Long, ByVal lClockRate As Long, ByVal sMinFrameRate As Single, ByRef sMaxExposureTime As Single) As Long
Declare Function PimMegaGetMonoGain Lib "PimMegaApi.DLL" Alias "_PimMegaGetMonoGain@8" (ByVal lImager As Long, ByRef lValue As Long) As Long
Declare Function PimMegaGetNumberDevices Lib "PimMegaApi.DLL" Alias "_PimMegaGetNumberDevices@8" (ByVal strFriendlyName As String, ByRef lNumberDevices As Long) As Long
Declare Function PimMegaGetPreviewWindowPos Lib "PimMegaApi.DLL" Alias "_PimMegaGetPreviewWindowPos@12" (ByVal lImager As Long, ByRef lLeft As Long, ByRef lTop As Long) As Long
Declare Function PimMegaGetPreviewWindowSize Lib "PimMegaApi.DLL" Alias "_PimMegaGetPreviewWindowSize@12" (ByVal lImager As Long, ByRef lWidth As Long, ByRef lHeight As Long) As Long
Declare Function PimMegaGetRedGain Lib "PimMegaApi.DLL" Alias "_PimMegaGetRedGain@8" (ByVal lImager As Long, ByRef lValue As Long) As Long
Declare Function PimMegaGetSaturation Lib "PimMegaApi.DLL" Alias "_PimMegaGetSaturation@8" (ByVal lImager As Long, ByRef lValue As Long) As Long
Declare Function PimMegaGetSerialNumber Lib "PimMegaApi.DLL" Alias "_PimMegaGetSerialNumber@8" (ByVal lImager As Long, ByRef lValue As Long) As Long
Declare Function PimMegaGetSoftwareVersion Lib "PimMegaApi.DLL" Alias "_PimMegaGetSoftwareVersion@8" (ByVal lImager As Long, ByRef lValue As Long) As Long
Declare Function PimMegaGetSubWindow Lib "PimMegaApi.DLL" Alias "_PimMegaGetSubWindow@24" (ByVal lImager As Long, ByRef lDecimation As Long, ByRef lStartColumn As Long, ByRef lStartRow As Long, ByRef lSubWindowWidth As Long, ByRef lSubWindowHeight As Long) As Long
Declare Function PimMegaGetSubWindowPos Lib "PimMegaApi.DLL" Alias "_PimMegaGetSubWindowPos@12" (ByVal lImager As Long, ByRef lStartColumn As Long, ByRef lStartRow As Long) As Long
Declare Function PimMegaGetSubWindowSize Lib "PimMegaApi.DLL" Alias "_PimMegaGetSubWindowSize@16" (ByVal lImager As Long, ByRef lDecimation As Long, ByRef lSubWindowWidth As Long, ByRef lSubWindowHeight As Long) As Long
Declare Function PimMegaGetTimeout Lib "PimMegaApi.DLL" Alias "_PimMegaGetTimeout@8" (ByVal lImager As Long, ByRef lValue As Long) As Long
Declare Function PimMegaGetVideoMode Lib "PimMegaApi.DLL" Alias "_PimMegaGetVideoMode@8" (ByVal lImager As Long, ByRef lMode As Long) As Long
Declare Function PimMegaI2cRead Lib "PimMegaApi.DLL" Alias "_PimMegaI2cRead@24" (ByVal lImager As Long, ByVal bytI2cDevice As Byte, ByRef bytAddressToRead As Byte, ByVal bytAddressLength As Byte, ByRef bytInputBuffer As Byte, ByVal bytBytesToReceive As Byte) As Long
Declare Function PimMegaI2cWrite Lib "PimMegaApi.DLL" Alias "_PimMegaI2cWrite@16" (ByVal lImager As Long, ByVal bytI2cDevice As Byte, ByRef bytBufferToSend As Byte, ByVal bytBytesToSend As Byte) As Long
Declare Function PimMegaImageFlip Lib "PimMegaApi.DLL" Alias "_PimMegaImageFlip@12" (ByVal lImager As Long, ByVal lHorizontal As Long, ByVal lVertical As Long) As Long
Declare Function PimMegaInitialize Lib "PimMegaApi.DLL" Alias "_PimMegaInitialize@12" (ByVal strFilterName As String, ByVal lIndex As Long, ByRef lImager As Long) As Long
Declare Function PimMegaIsExtOscillator Lib "PimMegaApi.DLL" Alias "_PimMegaIsExtOscillator@8" (ByVal lImager As Long, ByRef lPresent As Long) As Long
Declare Function PimMegaPausePreview Lib "PimMegaApi.DLL" Alias "_PimMegaPausePreview@8" (ByVal lImager As Long, ByVal lPause As Long) As Long
Declare Function PimMegaPauseVideoStream Lib "PimMegaApi.DLL" Alias "_PimMegaPauseVideoStream@8" (ByVal lImager As Long, ByVal lPause As Long) As Long
Declare Function PimMegaReadCommand Lib "PimMegaApi.DLL" Alias "_PimMegaReadCommand@12" (ByVal lImager As Long, ByRef bytBuffer As Byte, ByVal lNumberBytes As Long) As Long
Declare Function PimMegaReadExtI2CRegister Lib "PimMegaApi.DLL" Alias "_PimMegaReadExtI2CRegister@16" (ByVal lImager As Long, ByVal lI2CDevice As Long, ByVal lRegister As Long, ByRef lValue As Byte) As Long
Declare Function PimMegaReadGpio Lib "PimMegaApi.DLL" Alias "_PimMegaReadGpio@8" (ByVal lImager As Long, ByRef lValue As Long) As Long
Declare Function PimMegaReadMultRegister Lib "PimMegaApi.DLL" Alias "_PimMegaReadMultRegister@16" (ByVal lImager As Long, ByVal lStartRegister As Long, ByVal lNumberRegisters As Long, ByRef bytFirstRegValue As Byte) As Long
Declare Function PimMegaReadRegister Lib "PimMegaApi.DLL" Alias "_PimMegaReadRegister@12" (ByVal lImager As Long, ByVal lRegister As Long, ByRef lValue As Byte) As Long
Declare Function PimMegaRequestContinuousAutoExposure Lib "PimMegaApi.DLL" Alias "_PimMegaRequestContinuousAutoExposure@12" (ByVal lImager As Long, ByVal lDoContinuousAutoExposure As Long, ByVal lPercentSaturation As Long) As Long
Declare Function PimMegaResetPreviewWindow Lib "PimMegaApi.DLL" Alias "_PimMegaResetPreviewWindow@4" (ByVal lImager As Long) As Long
Declare Function PimMegaReturnFrameAfterTrigger Lib "PimMegaApi.DLL" Alias "_PimMegaReturnFrameAfterTrigger@48" (ByVal lImager As Long, ByVal dExposureTime As Single, ByVal lUseFlash As Long, ByVal dFlashDelay As Single, ByVal lUseShutter As Long, ByVal dShutterDelay As Single, ByVal dShutterCloseDelay As Single, ByVal lUserFunctionPtr As Long, ByVal lConvertToRGB As Long, ByRef bytFirstRaw As Byte, ByRef bytFirstRGB As Byte, Optional ByVal lColorConversion As Long = BAYER_3BY3_COLOR) As Long
Declare Function PimMegaReturnStillFrame Lib "PimMegaApi.DLL" Alias "_PimMegaReturnStillFrame@32" (ByVal lImager As Long, ByRef bytFirstDest As Byte, ByVal dExposureTime As Single, Optional ByVal lUseFlash As Long = False, Optional ByVal dFlashDelay As Single = 0, Optional ByVal lUseShutter As Long = False, Optional ByVal dShutterDelay As Single = 0, Optional ByVal dShutterCloseDelay As Single = 0) As Long
Declare Function PimMegaReturnVideoData Lib "PimMegaApi.DLL" Alias "_PimMegaReturnVideoData@12" (ByVal lImager As Long, ByVal lNumberBytes As Long, ByRef bytFirstDest As Byte) As Long
Declare Function PimMegaSaveFrameAsBitmap Lib "PimMegaApi.DLL" Alias "_PimMegaSaveFrameAsBitmap@12" (ByVal lImager As Long, ByRef bytFirstSource As Byte, ByVal strFileName As String) As Long
Declare Function PimMegaSaveFrameAsJpeg Lib "PimMegaApi.DLL" Alias "_PimMegaSaveFrameAsJpeg@12" (ByVal lImager As Long, ByRef bytFirstSource As Byte, ByVal strFileName As String) As Long
Declare Function PimMegaSaveFrameAsTiff Lib "PimMegaApi.DLL" Alias "_PimMegaSaveFrameAsTiff@24" (ByVal lImager As Long, ByRef bytFirstSource As Byte, ByVal strFileName As String, Optional ByVal bColorCor As Boolean = False, Optional ByVal lSaturation As Long = 0, Optional ByVal lColorConversion As Long = BAYER_3BY3_COLOR) As Long
Declare Function PimMegaSetBlueGain Lib "PimMegaApi.DLL" Alias "_PimMegaSetBlueGain@8" (ByVal lImager As Long, ByVal lValue As Long) As Long
Declare Function PimMegaSetDataTransferSize Lib "PimMegaApi.DLL" Alias "_PimMegaSetDataTransferSize@8" (ByVal lImager As Long, ByVal lValue As Long) As Long
Declare Function PimMegaSetExposure Lib "PimMegaApi.DLL" Alias "_PimMegaSetExposure@8" (ByVal lImager As Long, ByVal lValue As Long) As Long
Declare Function PimMegaSetExposureGain Lib "PimMegaApi.DLL" Alias "_PimMegaSetExposureGain@8" (ByVal lImager As Long, ByVal sValue As Single) As Long
Declare Function PimMegaSetExposureTime Lib "PimMegaApi.DLL" Alias "_PimMegaSetExposureTime@12" (ByVal lImager As Long, ByVal dValue As Single, Optional ByVal bChangeClockSpeed As Boolean = False) As Long
Declare Function PimMegaSetGamma Lib "PimMegaApi.DLL" Alias "_PimMegaSetGamma@8" (ByVal lImager As Long, ByVal lValue As Single) As Long
Declare Function PimMegaSetGpo Lib "PimMegaApi.DLL" Alias "_PimMegaSetGpo@16" (ByVal lImager As Long, ByVal lValue As Long, ByVal sPulseLength As Single, Optional ByVal lGpo As Long = PXL_GPO1) As Long
Declare Function PimMegaSetGreenGain Lib "PimMegaApi.DLL" Alias "_PimMegaSetGreenGain@8" (ByVal lImager As Long, ByVal lValue As Long) As Long
Declare Function PimMegaSetImagerClocking Lib "PimMegaApi.DLL" Alias "_PimMegaSetImagerClocking@8" (ByVal lImager As Long, ByVal lValue As Long) As Long
Declare Function PimMegaSetImagerName Lib "PimMegaApi.DLL" Alias "_PimMegaSetImagerName@8" (ByVal lImager As Long, ByVal strName As String) As Long
Declare Function PimMegaSetLightSource Lib "PimMegaApi.DLL" Alias "_PimMegaSetLightSource@8" (ByVal lImager As Long, ByVal lValue As Long) As Long
Declare Function PimMegaSetMonoGain Lib "PimMegaApi.DLL" Alias "_PimMegaSetMonoGain@8" (ByVal lImager As Long, ByVal lValue As Long) As Long
Declare Function PimMegaSetOverlayCallBack Lib "PimMegaApi.DLL" Alias "_PimMegaSetOverlayCallBack@16" (ByVal lImager As Long, ByVal bUseForPreview As Boolean, ByVal bUseForCapture As Boolean, ByVal lUserFunctionPtr As Long) As Long
Declare Function PimMegaSetPreviewColorConversion Lib "PimMegaApi.DLL" Alias "_PimMegaSetPreviewColorConversion@8" (ByVal lImager As Long, ByVal lColorConversion As Long) As Long
Declare Function PimMegaSetPreviewWindow Lib "PimMegaApi.DLL" Alias "_PimMegaSetPreviewWindow@8" (ByVal lImager As Long, ByRef pClient As RECT) As Long
Declare Function PimMegaSetRedGain Lib "PimMegaApi.DLL" Alias "_PimMegaSetRedGain@8" (ByVal lImager As Long, ByVal lValue As Long) As Long
Declare Function PimMegaSetSaturation Lib "PimMegaApi.DLL" Alias "_PimMegaSetSaturation@8" (ByVal lImager As Long, ByVal lValue As Long) As Long
Declare Function PimMegaSetSubWindow Lib "PimMegaApi.DLL" Alias "_PimMegaSetSubWindow@24" (ByVal lImager As Long, ByVal lDecimation As Long, ByVal lStartColumn As Long, ByVal lStartRow As Long, ByVal lNumberColumns As Long, ByVal lNumberRows As Long) As Long
Declare Function PimMegaSetSubWindowPos Lib "PimMegaApi.DLL" Alias "_PimMegaSetSubWindowPos@12" (ByVal lImager As Long, ByVal lStartColumn As Long, ByVal lStartRow As Long) As Long
Declare Function PimMegaSetSubWindowSize Lib "PimMegaApi.DLL" Alias "_PimMegaSetSubWindowSize@16" (ByVal lImager As Long, ByVal lDecimation As Long, ByVal lNumberColumns As Long, ByVal lNumberRows As Long) As Long
Declare Function PimMegaSetTimeout Lib "PimMegaApi.DLL" Alias "_PimMegaSetTimeout@8" (ByVal lImager As Long, ByVal lValue As Long) As Long
Declare Function PimMegaSetVideoMode Lib "PimMegaApi.DLL" Alias "_PimMegaSetVideoMode@8" (ByVal lImager As Long, ByVal lValue As Long) As Long
Declare Function PimMegaStartPreview Lib "PimMegaApi.DLL" Alias "_PimMegaStartPreview@44" (ByVal lImager As Long, Optional ByVal strTitle As String = "PL1394 Camera Preview", Optional ByVal lStyle As Long = WS_OVERLAPPEDWINDOW Or WS_VISIBLE, Optional ByVal lLeft As Long = 0, Optional ByVal lTop As Long = 0, Optional ByVal lWidth As Long = -1, Optional ByVal lHeight As Long = -1, Optional ByVal lParent As Long = 0, Optional ByVal lChildId As Long = 0, Optional ByVal lPreviewDataThreadPriority As Long = THREAD_PRIORITY_BELOW_NORMAL, Optional ByVal lPreviewDrawThreadPriority As Long = THREAD_PRIORITY_BELOW_NORMAL) As Long
Declare Function PimMegaStartVideoStream Lib "PimMegaApi.DLL" Alias "_PimMegaStartVideoStream@4" (ByVal lImager As Long) As Long
Declare Function PimMegaStopPreview Lib "PimMegaApi.DLL" Alias "_PimMegaStopPreview@4" (ByVal lImager As Long) As Long
Declare Function PimMegaStopTriggerMode Lib "PimMegaApi.DLL" Alias "_PimMegaStopTriggerMode@4" (ByVal lImager As Long) As Long
Declare Function PimMegaStopVideoStream Lib "PimMegaApi.DLL" Alias "_PimMegaStopVideoStream@4" (ByVal lImager As Long) As Long
Declare Function PimMegaUninitialize Lib "PimMegaApi.DLL" Alias "_PimMegaUninitialize@4" (ByRef lImager As Long) As Long
Declare Function PimMegaWhiteBalance Lib "PimMegaApi.DLL" Alias "_PimMegaWhiteBalance@36" (ByVal lImager As Long, Optional ByVal bWindow As Boolean = False, Optional ByVal lLeft As Long = 0, Optional ByVal lTop As Long = 0, Optional ByVal lWidth As Long = 4, Optional ByVal lHeight As Long = 4, Optional ByVal lRed As Long = 255, Optional ByVal lGreen As Long = 255, Optional ByVal lBlue As Long = 255) As Long
Declare Function PimMegaWriteCommand Lib "PimMegaApi.DLL" Alias "_PimMegaWriteCommand@12" (ByVal lImager As Long, ByRef bytBuffer As Byte, ByVal lNumberBytes As Long) As Long
Declare Function PimMegaWriteExtI2CRegister Lib "PimMegaApi.DLL" Alias "_PimMegaWriteExtI2CRegister@16" (ByVal lImager As Long, ByVal lI2CDevice As Long, ByVal lRegister As Long, ByVal lValue As Byte) As Long
Declare Function PimMegaWriteGpio Lib "PimMegaApi.DLL" Alias "_PimMegaWriteGpio@8" (ByVal lImager As Long, ByVal lValue As Long) As Long
Declare Function PimMegaWriteMultRegister Lib "PimMegaApi.DLL" Alias "_PimMegaWriteMultRegister@20" (ByVal lImager As Long, ByVal lStartRegister As Long, ByVal lNumberRegisters As Long, ByRef bytFirstRegValue As Byte, Optional ByVal bAsynch As Boolean = False) As Long
Declare Function PimMegaWriteRegister Lib "PimMegaApi.DLL" Alias "_PimMegaWriteRegister@16" (ByVal lImager As Long, ByVal lRegister As Long, ByVal lValue As Byte, Optional ByVal bAsynch As Boolean = False) As Long



