using System; using System.Runtime.InteropServices; namespace OpenBildAnlyse { public class Falcon { private const string IMPORT = "falcon_64.dll"; [DllImport("kernel32.dll")] static extern IntPtr CreateEvent(IntPtr lpEventAttributes, bool bManualReset, bool bInitialState, string lpName); #region Initialization und termination /// /// Hardware initialization /// is_InitBoard() opens the driver and establishes contact to the hardware. If the hardware is successfully initialized, this function allocates a handle to the frame grabber. All of the following functions require this as their first parameter. If DirectDraw is not used for image output, hWnd can be set to Null. /// To install several EAGLE or FALCON frame grabbers in one computer (multi board operation), you have to decide during initialization of the handle which board is to be initialized. The Board ID is fixed in the EEPROM (see also is_GetBoardInfo()). If a special board is to be addressed, you have to initialize the handle hf with the relevant Board-ID of this board. /// If you don’t want multi board operation, handle hf must be initialized with the value zero before calling function is_InitBoard(). Here the value zero means, that the first not used frame grabber will be used. /// /// Pointer to the frame grabber handle. The values have the following meaning: 0: use first unused board, 1-254: use board with this board ID /// Handle to the window in which the image is to be displayed(NULL is allowed) /// IS_SUCCESS or a error code [DllImport(IMPORT, EntryPoint = "is_InitBoard")] public static extern int InitBoard(ref IntPtr phf, IntPtr hWnd); /// /// Closes the card and deallocates memory /// is_ExitBoard() cancels the active device handle hf and deallocates the data structures and memory areas currently associated with the FALCON/EAGLE. /// The image memory which has been allocated by the user (is_AllocImageMem()) and which has not been released, is released with is_ExitBoard(). /// /// Frame grabber handle /// IS_SUCCESS, IS_NO_SUCCESS [DllImport(IMPORT, EntryPoint = "is_ExitBoard")] public static extern int ExitBoard(IntPtr hf); #endregion #region Image acquisition and memory management /// /// Stops live video /// The is_StopLiveVideo() function freezes the image in the VGA card or in the PC’s system memory. /// The function is controlled with the parameter Wait. The function has two modes: /// Using the first mode, the function immediately returns to the calling function and grabs the image in the background. /// In the second mode the function waits until the image has been completely acquired and only then does the function return. /// Note for EAGLE: Being in trigger mode(see is_SetExternalTrigger() (c#:SetExternalTrigger)), the live mode is only ended, if a trigger signal is detected on trigger input. /// /// Frame grabber handle /// IS_SUCCESS, IS_NO_SUCCESS /// [DllImport(IMPORT, EntryPoint = "is_StopLiveVideo")] public static extern int StopLiveVideo(IntPtr hf, int wait); /// /// Acquires live video /// digitizes video images in real time and transfers the images to the previously allocated image memory. /// Alternatively if you are using DirectDraw the images can be transferred to the graphics board. /// In doing so, the conditions as set out in the is_SetCaptureMode() are taken into account. /// If you are working with ring buffering (is_AddToSequence()) the image acquisition in the sequence runs through all image memories in a loop. /// /// Frame grabber handle /// IS_DONT_WAIT: This function synchronizes the image acquisition of the next frame and/or V-SYNC field, but returns immediately. /// IS_WAIT: This function synchronizes the image acquisition of the next frame and/or V-SYNC field and only then does return (i.e. waits until image acquisition begins). /// 10 y Wait < 32768 :Wait time in 10 ms steps(Wait = 100 > 1 s) /// A maximum of 328,68 s can be waited. /// (This is approx. 5 min and 20 s). For 1 < Wait < 10 Wait becomes equal to 10. /// (Example: Wait = 100 > 1 s waiting) /// /// IS_SUCCESS, IS_NO_SUCCESS /// IS_TIMED_OUT(only if the IS_WAIT parameter is used in the triggered sequence mode of the EAGLE /// and the trigger is not recognized in the next VSYNC) /// [DllImport(IMPORT, EntryPoint = "is_CaptureVideo")] public static extern int CaptureVideo(IntPtr hf, int wait); /// /// CopyImageMem() copies the contents of the image memory, as described is pcSource and nID to the area in memory, which pcDest points to. /// Copies image to memory as defined by programmer /// /// Frame grabber handle /// Pointer to image memory /// ID of image memory /// Pointer to destination memory to which the image should be copied /// IS_SUCCESS, IS_NO_SUCCESS [DllImport(IMPORT, EntryPoint = "is_CopyImageMem")] public static extern int CopyImageMem(IntPtr hf, string pcSource, int nID, ref byte[] pcDest); /// /// Copies single lines to memory as defined by programmer /// is_CopyImageMem() copies the contents of the image memory, as described is pcSource and nID to the area in memory, which pcDest points to. /// Note: The user must make sure that the allocated memory pcDest is large enough to store the whole image (not just the area of interest) in the current format (bits per pixel). /// /// Frame grabber handle /// Pointer to image memory /// ID of image memory /// Number of lines which are copied /// Pointer to destination memory to which the image should be copied /// IS_SUCCESS, IS_NO_SUCCESS [DllImport(IMPORT, EntryPoint = "is_CopyImageMemLines")] public static extern int CopyImageMemLines(IntPtr hf, string pcSource, int nID, int nLines, ref byte[] pcDest); /// /// Acquires image and writes to destination address /// is_FreezeVideo() digitizes an image and transfers it to the active image memory. In DirectDraw mode the image is digitized in the DirectDraw buffer (either on the VGA card or in a back buffer). When working with ring buffering, image acquisition only takes place in the first image memory of the sequence. /// Note to EAGLE: If the frame grabber is in trigger mode(see also is_SetExternalTrigger()), an image is only digitized, when a trigger signal occurs. /// /// Frame grabber handle /// IS_DONT_WAIT: This function synchronizes the image acquisition of the next frame and/or V-SYNC field, but returns immediately. /// IS_WAIT: This function synchronizes the image acquisition of the next frame and/or V-SYNC field and only then does return (i.e. waits until image acquisition begins). /// 10 y Wait < 32768 :Wait time in 10 ms steps(Wait = 100 > 1 s) /// A maximum of 328,68 s can be waited. /// (This is approx. 5 min and 20 s). For 1 < Wait < 10 Wait becomes equal to 10. /// (Example: Wait = 100 > 1 s waiting) /// /// IS_SUCCESS, IS_NO_SUCCESS [DllImport(IMPORT, EntryPoint = "is_FreezeVideo")] public static extern int FreezeVideo(IntPtr hf, int wait); /// /// Allocates image memory /// /// /// Frame grabber handle /// Width of image /// Height of image /// Color depth of image (bits per pixel) /// Contains pointer to start of image memory /// Contains the ID for image memory /// IS_SUCCESS, IS_NO_SUCCESS [DllImport(IMPORT, EntryPoint = "is_AllocImageMem")] public static unsafe extern int AllocImageMem(IntPtr hf, int width, int height, PixelFormat bitspixel, ref IntPtr ppcImgMem, ref int pid); /// /// Frees allocated image memory /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_FreeImageMem")] public static extern int FreeImageMem(IntPtr hf, string pcMem, int id); /// /// Makes image memory active /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetImageMem")] public static extern int SetImageMem(IntPtr hf, IntPtr pcMem, int id); /// /// Reduces the number of images over PCI bus /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetDecimationMode")] public static extern int SetDecimationMode(IntPtr hf, int nMode, int nDecimate); /// /// Returns pointer to image memory /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_GetImageMem")] public unsafe static extern int GetImageMem(IntPtr hf, ref void* pMem); /// /// Returns line offset (n) to (n+1) /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_GetImageMemPitch")] public static extern int GetImageMemPitch(IntPtr hf, ref int pPitch); /// /// Returns number of active image memory /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_GetActiveImageMem")] public static extern int GetActiveImageMem(IntPtr hf, ref string ppcMem, ref int pnID); /// /// Returns image memory’s properties /// /// /// /// /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_InquireImageMem")] public static extern int InquireImageMem(IntPtr hf, string pcMem, int nID, ref int pnX, ref int pnY, ref int pnBits, ref int pnPitch); /// /// Has the image acquisition started? /// is_HasVideoStarted() can check whether the digitizing of an image has started or not. This function is useful when used together with is_FreezeVideo() and the parameter IS_DONT_WAIT. /// /// Frame grabber handle /// Contains the digitization status:0 = not started,1 = image acquisition started /// IS_SUCCESS, IS_NO_SUCCESS [DllImport(IMPORT, EntryPoint = "is_HasVideoStarted")] public static extern int HasVideoStarted(IntPtr hf, ref bool pbo); /// /// Has the image acquisition finished? /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_IsVideoFinish")] public static extern int IsVideoFinish(IntPtr hf, ref bool pbo); /// /// Makes external memory to image memory /// /// /// /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetAllocatedImageMem")] public static extern int SetAllocatedImageMem(IntPtr hf, int width, int height, int bitspixel, string pcImgMem, ref int pid); #endregion #region Double and multiple buffering /// /// Records image memory in sequence list /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_AddToSequence")] public static extern int AddToSequence(IntPtr hf, string pcMem, int nID); /// /// Deletes sequence list /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_ClearSequence")] public static extern int ClearSequence(IntPtr hf); /// /// Determines the image memory which is currently being used for the sequence. /// /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_GetActSeqBuf")] public static extern int GetActSeqBuf(IntPtr hf, ref int pnNum, ref string ppcMem, ref string ppcMemLast); /// /// Protects image memory of the sequence from being overwritten. /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_LockSeqBuf")] public static extern int LockSeqBuf(IntPtr hf, int nNum, string pcMem); /// /// Allows image memory of the sequence to be overwritten. /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_UnlockSeqBuf")] public static extern int UnlockSeqBuf(IntPtr hf, int nNum, string pcMem); #endregion #region Selection of operating modes and return of properties /// /// Gets event counter and counter value /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_BoardStatus")] public static extern uint BoardStatus(IntPtr hf, int nInfo, uint ulValue); /// /// Selection of video input signal /// is_SetVideoInput() selects the video input to which a video source is connected for digitization. If the video sources are not synchronized to one another, the time it takes the multiplexer to switch and then to resynchronize to the new video source, can result in several lost or distorted frames. We therefore recommend that the cameras are operated in sync mode. /// /// Frame grabber handle /// /// [DllImport(IMPORT, EntryPoint = "is_SetVideoInput")] public static extern int SetVideoInput(IntPtr hf, VideoSource Source); /// /// Sets brightness /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetBrightness")] public static extern int SetBrightness(IntPtr hf, int Bright); /// /// Sets contrast /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetContrast")] public static extern int SetContrast(IntPtr hf, int Cont); /// /// Gets type of board (FALCON, FALCONplus, FALCONquattro, EAGLE) /// If the FALCON and EAGLE are both installed in the same machine, it is important to be able to differentiate between the two cards. is_GetBoardType() returns the result of which type of board is installed. /// /// Frame grabber handle /// Falcon = 1, Eagle = 2, FalconPlus = 7, FalconQuattro = 9 [DllImport(IMPORT, EntryPoint = "is_GetBoardType")] public static extern BoardType GetBoardType(IntPtr hf); /// /// Sets color saturation /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetSaturation")] public static extern int SetSaturation(IntPtr hf, int ChromU, int ChromV); /// /// Sets hue value /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetHue")] public static extern int SetHue(IntPtr hf, int Hue); /// /// Selection of video standard /// is_SetVideoMode() selects the video standard for the connected video source. Color and monochrome signal standards with 50 Hz and 60 Hz are supported. With the IS_SET_VM_AUTO parameter, the video standard of the connected video source can automatically be set. All the other required settings can be carried out with the driver. The automatic video standard detection lasts approximate 1 s. /// /// Frame grabber handle /// Video mode setting /// Current setting when called wih IS_GET_VIDEO_MODE, else IS_SUCCESS, IS_NO_SUCCESS [DllImport(IMPORT, EntryPoint = "is_SetVideoMode")] public static extern int SetVideoMode(IntPtr hf, VideoMode Mode); /// /// Selects image display mode /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetDisplayMode")] public static extern int SetDisplayMode(IntPtr hf, DisplayMode Mode); /// /// Activates/deactivates gamma correction /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetGamma")] public static extern int SetGamma(IntPtr hf, int Mode); /// /// Sets sync level for critical video sources (VCR) /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetSyncLevel")] public static extern int SetSyncLevel(IntPtr hf, int Level); /// /// Selects color mode /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetColorMode")] public static extern int SetColorMode(IntPtr hf, ColorMode Mode); /// /// Toggles scaler on and off; sets scaling ratio /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetScaler")] public static extern int SetScaler(IntPtr hf, float Scalex, float Scaley); /// /// Sets the size of the image /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetImageSize")] public static extern int SetImageSize(IntPtr hf, int x, int y); /// /// Sets image position within image window /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetImagePos")] public static extern int SetImagePos(IntPtr hf, int x, int y); /// /// Sets acquisition mode /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetCaptureMode")] public static extern int SetCaptureMode(IntPtr hf, CaptureModeType Mode); /// /// Activates/deactivates error output /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetErrorReport")] public static extern int SetErrorReport(IntPtr hf, int Mode); /// /// Sets horizontal interpolation filter /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetHorFilter")] public static extern int SetHorFilter(IntPtr hf, int Mode); /// /// Sets vertical interpolation filter /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetVertFilter")] public static extern int SetVertFilter(IntPtr hf, int Mode); /// /// Calls error message /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_GetError")] public static unsafe extern int GetError(IntPtr hf, ref int pErr, ref byte[] ppcErr); /// /// Returns currently active field (odd or even) /// is_GetCurrentField() returns which field was captured as last field (odd or even). The function can be called inside an event (e.g. Bothfields). /// /// Frame grabber handle /// Field type: 1 = odd, 0 = even /// IS_SUCCESS, IS_NO_SUCCESS [DllImport(IMPORT, EntryPoint = "is_GetCurrentField")] public static extern int GetCurrentField(IntPtr hf, out FieldType pField); /// /// Gets the interrupt used from the card /// is_GetIRQ() returns the interrupt of the board. /// /// Frame grabber handle /// Pointer to variable, which contains number of interrupt. /// IS_SUCCESS, IS_NO_SUCCESS [DllImport(IMPORT, EntryPoint = "is_GetIRQ")] public static extern int GetIRQ(IntPtr hf, ref int pnIRQ); /// /// Returns the number of the PCI slot the board is plugged in /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_GetPciSlot")] public static extern int GetPciSlot(IntPtr hf, ref int pnSlot); /// /// Calls operating system type /// /// /// [DllImport(IMPORT, EntryPoint = "is_GetOsVersion")] public static extern int GetOsVersion(); /// /// Output of VSYNC counter /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_GetVsyncCount")] public static extern int GetVsyncCount(IntPtr hf, ref int pIntr, ref int pActIntr); /// /// Sets the digital area of interest on the image /// /// /// Frame grabber handle /// x offset of left boarder (see following table for value range) /// has to be an even value /// /// y offset of the upper boarder /// has to be an odd value /// /// Image width /// Image height /// IS_SUCCESS, IS_NO_SUCCESS [DllImport(IMPORT, EntryPoint = "is_SetVideoSize")] public static extern int SetVideoSize(IntPtr hf, int xpos, int ypos, int xsize, int ysize); /// /// Resets handle to output window /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetHwnd")] public static extern int SetHwnd(IntPtr hf, IntPtr hwnd); /// /// Set the handle of the parent or main window /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetParentHwnd")] public static extern int SetParentHwnd(IntPtr hf, IntPtr hwnd); /// /// Gets current color mode from VGA card /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_GetColorDepth")] public static extern int GetColorDepth(IntPtr hf, ref int pnCol, ref int pnColMode); /// /// Changing the input after every frame /// /// /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetToggleMode")] public static extern int SetToggleMode(IntPtr hf, int nInput1, int nInput2, int nInput3, int nInput4); /// /// Sets real time ROP effects /// /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetRopEffect")] public static extern int SetRopEffect(IntPtr hf, int effect, int param, int reserved); /// /// Returns the version of IMPORT /// /// /// [DllImport(IMPORT, EntryPoint = "is_GetDLLVersion")] public static extern int GetDLLVersion(); /// /// Returns the number of installed boards /// Function is_GetNumberOfDevices() delivers the number of FALCON/EAGLE devices in the PC. With a FALCONquattro/FALCONquattro Express the number of DEVICEs e.g. is 4. /// /// Number of detected boards [DllImport(IMPORT, EntryPoint = "is_GetNumberOfDevices")] public static extern int GetNumberOfDevices(); /// /// Rules one of the video inputs to the video output /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetPassthrough")] public static extern int SetPassthrough(IntPtr hf, int Source); /// /// Controls the hardware watchdog /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_Watchdog")] public static extern int Watchdog(IntPtr hf, long lMode); /// /// Sets the time of the hardware watchdog /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_WatchdogTime")] public static extern int WatchdogTime(IntPtr hf, long lTime); #endregion #region Reading from and writing to EEPROMS /// /// Writes own data to EEPROM /// /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_WriteEEPROM")] public static extern int WriteEEPROM(IntPtr hf, int Adr, string pcString, int Count); /// /// Reads own data from EEPROM /// /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_ReadEEPROM")] public static extern int ReadEEPROM(IntPtr hf, int Adr, string pcString, int Count); /// /// Reads reprogrammed manufacturer's information /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_GetBoardInfo")] public static extern int GetBoardInfo(IntPtr hf, BordInfo pInfo); #endregion #region Saving and loading images /// /// Saves video image as a bitmap (BMP) /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SaveImage")] public static extern int SaveImage(IntPtr hf, string File); /// /// Saves image memory as a bitmap (BMP) /// /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SaveImageMem")] public static extern int SaveImageMem(IntPtr hf, string File, string pcMem, int nID); /// /// Loads a bitmap image /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_LoadImage")] public static extern int LoadImage(IntPtr hf, string File); #endregion #region Image output /// /// Displays images in a window /// is_SetRenderBitmap() displays images from an image memory in the defined window. For displaying the images Win32 Bitmap functions are used. /// /// Frame grabber handle /// ID of the image memory which should be displayed /// Window handle of the display window /// Render mode /// IS_SUCCESS, IS_NO_SUCCESS [DllImport(IMPORT, EntryPoint = "is_RenderBitmap")] public static extern int RenderBitmap(IntPtr hf, int nMemID, IntPtr hwnd, RenderMode nMode); /// /// Displays refresh with DirectDraw /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_UpdateDisplay")] public static extern int UpdateDisplay(IntPtr hf); /// /// Displays color bars from pattern generator /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_ShowColorBars")] public static extern int ShowColorBars(IntPtr hf, int Mode); /// /// Sets the mode for the display refresh /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetUpdateMode")] public static extern int SetUpdateMode(IntPtr hf, int mode); #endregion #region Supplementary DirectDraw functions /// /// Toggles DirectDraw overlay memory /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_EnableDDOverlay")] public static extern int EnableDDOverlay(IntPtr hf); /// /// Switches off DirectDraw overlay memory /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_DisableDDOverlay")] public static extern int DisableDDOverlay(IntPtr hf); /// /// Displays overlay memory /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_ShowDDOverlay")] public static extern int ShowDDOverlay(IntPtr hf); /// /// Hides overlay memory /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_HideDDOverlay")] public static extern int HideDDOverlay(IntPtr hf); /// /// Returns pointer to DirectDraw surface /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_GetDDOvlSurface")] public unsafe static extern int GetDDOvlSurface(IntPtr hf, ref void* ppDDSurf); /// /// Retrieves the device context handle’s overlay memory /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_GetDC")] public static extern int GetDC(IntPtr hf, ref IntPtr phDC); /// /// Releases the device context handle’s overlay memory /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_ReleaseDC")] public static extern int ReleaseDC(IntPtr hf, IntPtr hDC); /// /// Update cycle of image output with DirectDraw /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetDDUpdateTime")] public static extern int SetDDUpdateTime(IntPtr hf, int ms); /// /// Enables access to overlay memory /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_LockDDOverlayMem")] public unsafe static extern int LockDDOverlayMem(IntPtr hf, ref void* ppMem, ref int pPitch); /// /// Disables access to overlay memory /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_UnlockDDOverlayMem")] public static extern int UnlockDDOverlayMem(IntPtr hf); /// /// Enables VGA card to access the back buffer /// In DirectDraw mode is_LockDDMem() gives access to the image memory and returns the address pointer to the beginning of the image memory. /// In most cases the image memory is on the VGA card. Using the pointer the image memory can be accessed directly. Access is disabled with is_UnlockDDMem() – this must be done as soon as possible. /// Digitizing to memory cannot be terminated with is_LockDDMem(). /// When in DirectDraw back buffer mode, within a LockDDMem –UnlockDDMem block there are no updates of the back buffer on the display. /// /// Frame grabber handle /// Pointer to variable, which will contain address pointer /// Pointer to variable, which will contain the pitch value /// IS_SUCCESS, IS_NO_SUCCESS [DllImport(IMPORT, EntryPoint = "is_LockDDMem")] public unsafe static extern int LockDDMem(IntPtr hf, ref void* ppMem, ref int pPitch); /// /// Disables VGA card to access the back buffer /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_UnlockDDMem")] public static extern int UnlockDDMem(IntPtr hf); /// /// Sets the keying colour for the overlay display. /// /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetKeyColor")] public static extern int SetKeyColor(IntPtr hf, int r, int g, int b); /// /// Changes position of overlay display. /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetKeyOffset")] public static extern int SetKeyOffset(IntPtr hf, int nOffsetX, int nOffsetY); /// /// Switches off overlay surface when the window is moved /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_OvlSurfaceOffWhileMove")] public static extern int OvlSurfaceOffWhileMove(IntPtr hf, bool boMode); /// /// Initializes image stealing /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_PrepareStealVideo")] public static extern int PrepareStealVideo(IntPtr hf, int Mode, uint StealColorMode); /// /// Steals image from a DirectDraw live mode /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_StealVideo")] public static extern int StealVideo(IntPtr hf, int Wait); /// /// Scales overlay if video image becomes scaled /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_ScaleDDOverlay")] public static extern int ScaleDDOverlay(IntPtr hf, bool boScale); #endregion #region Event Handling /// /// Sets up event handler /// Initializes the event handler by registering the event object in the central driver. /// /// Frame grabber handle /// Event handle of the C/C++ function CreateEvent() /// Event ID to be initialized /// IS_SUCCESS, IS_NO_SUCCESS [DllImport(IMPORT, EntryPoint = "is_InitEvent")] public static extern int InitEvent(IntPtr hf, IntPtr hEv, EventType which); /// /// Exits event handler /// Deletes set event object. After deleting it can not be activated with is_EnableEvent(). /// /// Frame grabber handle /// ID of event that should be deleted /// IS_SUCCESS, IS_NO_SUCCESS [DllImport(IMPORT, EntryPoint = "is_ExitEvent")] public static extern int ExitEvent(IntPtr hf, EventType which); /// /// Enable object event /// Release of set up event object. After the release, the event signalling of the current event object is allowed. Calling is_FreezeVideo() signals the event. See also is_InitEvent(). /// /// Frame grabber handle /// ID of the event to release /// IS_SUCCESS, IS_NO_SUCCESS [DllImport(IMPORT, EntryPoint = "is_EnableEvent")] public static extern int EnableEvent(IntPtr hf, EventType which); /// /// Disable object event /// is_DisableEvent() locks the event specified here. The event (e.g. a VSYNC) still normally occurs, however, but does not trigger within the interrupt service routine an event signal. After calling this function the application software does not get the blocked events. With is_EnableEvent() the desired event become activated again. See also is_InitEvent(). /// /// Frame grabber handle /// ID of the event to be locked /// IS_SUCCESS, IS_NO_SUCCESS [DllImport(IMPORT, EntryPoint = "is_DisableEvent")] public static extern int DisableEvent(IntPtr hf, int which); #endregion #region Control of sync generator and input/outputs /// /// Activates external trigger input /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetExternalTrigger")] public static extern int SetExternalTrigger(IntPtr hf, int nTriggerMode); /// /// Sets the flash/strobe output /// /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetFlashStrobe")] public static extern int SetFlashStrobe(IntPtr hf, int nField, int nLine); /// /// Activates the internal sync generator for the synchronization of more than one camera /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetSync")] public static extern int SetSync(IntPtr hf, int nSync); /// /// Sets digital output or reads digital input /// /// /// /// /// [DllImport(IMPORT, EntryPoint = "is_SetIO")] public static extern int SetIO(IntPtr hr, int nIO); /// /// /// /// Frame grabber handle /// Direct3D function mode /// Void-type pointer to a data object or an array of objects (depending on the mode selected using nMode). /// Size (in bytes) of the data object in array /// [DllImport(IMPORT, EntryPoint = "is_DirectRenderer")] public static unsafe extern int DirectRenderer(IntPtr hf, DirectRendererMode nMode, void* pParam, int SizeOfParam); #endregion [StructLayout(LayoutKind.Explicit, Size = 64)] public struct BordInfo { // 0 1 2 3 4 5 6 7 8 9 0 1 | 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 2 3 4 5 6 7 8 9 0 1 | 2 3 4 5 6 7 8 9 0 1 2 3 | 4 | 5 | 6 7 8 9 0 1 2 3 // 1 2 3 4 5 6 7 8 9 0 1 2 | 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 | 1 2 3 4 5 6 7 8 9 0 | 1 2 3 4 5 6 7 8 9 0 1 2 | 1 | 1 | 1 2 3 4 5 6 7 8 // SerNo 0 - 11 | ID 12 - 31 | Version 32 - 41 | Date 42 - 53 |Sel|Typ| Reserved 56 - 63 [FieldOffset(0)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public byte[] SerNo; // e.g. "12345-1234" (11 char) } public struct FalconImage { public byte[] Memory; public int ImageID; } #region Constants public enum ErrorCodes { NO_SUCCESS = -0x1, SUCCESS = 0x0, INVALID_FALCON_HANDLE = 0x1, INVALID_HANDLE = 0x1, IO_REQUEST_FAILED = 0x2, CANT_OPEN_DEVICE = 0x3, CANT_CLOSE_DEVICE = 0x4, CANT_SETUP_MEMORY = 0x5, NO_IntPtr_FOR_ERROR_REPORT = 0x6, ERROR_MESSAGE_NOT_CREATED = 0x7, ERROR_STRING_NOT_FOUND = 0x8, HOOK_NOT_CREATED = 0x9, TIMER_NOT_CREATED = 0x000A, CANT_OPEN_REGISTRY = 0xB, CANT_READ_REGISTRY = 0xC, CANT_VALIDATE_BOARD = 0xD, CANT_GIVE_BOARD_ACCESS = 0xE, NO_IMAGE_MEM_ALLOCATED = 0xF, CANT_CLEANUP_MEMORY = 0x10, CANT_COMMUNICATE_WITH_DRIVER = 0x11, FUNCTION_NOT_SUPPORTED_YET = 0x12, OPERATING_SYSTEM_NOT_SUPPORTED = 0x13, INVALID_VIDEO_IN = 0x14, INVALID_IMG_SIZE = 0x15, INVALID_ADDRESS = 0x16, INVALID_VIDEO_MODE = 0x17, INVALID_AGC_MODE = 0x18, INVALID_GAMMA_MODE = 0x19, INVALID_SYNC_LEVEL = 0x1A, INVALID_CBARS_MODE = 0x1B, INVALID_COLOR_MODE = 0x1C, INVALID_SCALE_FACTOR = 0x1D, INVALID_IMAGE_SIZE = 0x1E, INVALID_IMAGE_POS = 0x1F, INVALID_CAPTURE_MODE = 0x20, INVALID_RISC_PROGRAM = 0x21, INVALID_BRIGHTNESS = 0x22, INVALID_CONTRAST = 0x23, INVALID_SATURATION_U = 0x24, INVALID_SATURATION_V = 0x25, INVALID_HUE = 0x26, INVALID_HOR_FILTER_STEP = 0x27, INVALID_VERT_FILTER_STEP = 0x28, INVALID_EEPROM_READ_ADDRESS = 0x29, INVALID_EEPROM_WRITE_ADDRESS = 0x2A, INVALID_EEPROM_READ_LENGTH = 0x2B, INVALID_EEPROM_WRITE_LENGTH = 0x2C, INVALID_BOARD_INFO_POINTER = 0x2D, INVALID_DISPLAY_MODE = 0x2E, INVALID_ERR_REP_MODE = 0x2F, INVALID_BITS_PIXEL = 0x30, INVALID_MEMORY_POINTER = 0x31, FILE_WRITE_OPEN_ERROR = 0x32, FILE_READ_OPEN_ERROR = 0x33, FILE_READ_INVALID_BMP_ID = 0x34, FILE_READ_INVALID_BMP_SIZE = 0x35, FILE_READ_INVALID_BIT_COUNT = 0x36, WRONG_KERNEL_VERSION = 0x37, RISC_INVALID_XLENGTH = 0x3C, RISC_INVALID_YLENGTH = 0x3D, RISC_EXCEED_IMG_SIZE = 0x3E, DD_MAIN_FAILED = 0x46, DD_PRIMSURFACE_FAILED = 0x47, DD_SCRN_SIZE_NOT_SUPPORTED = 0x48, DD_CLIPPER_FAILED = 0x49, DD_CLIPPER_IntPtr_FAILED = 0x4A, DD_CLIPPER_CONNECT_FAILED = 0x4B, DD_BACKSURFACE_FAILED = 0x4C, DD_BACKSURFACE_IN_SYSMEM = 0x4D, DD_MDL_MALLOC_ERR = 0x4E, DD_MDL_SIZE_ERR = 0x4F, DD_CLIP_NO_CHANGE = 0x50, DD_PRIMMEM_NULL = 0x51, DD_BACKMEM_NULL = 0x52, DD_BACKOVLMEM_NULL = 0x53, DD_OVERLAYSURFACE_FAILED = 0x54, DD_OVERLAYSURFACE_IN_SYSMEM = 0x55, DD_OVERLAY_NOT_ALLOWED = 0x56, DD_OVERLAY_COLKEY_ERR = 0x57, DD_OVERLAY_NOT_ENABLED = 0x58, DD_GET_DC_ERROR = 0x59, DD_DDRAW_DLL_NOT_LOADED = 0x5A, DD_THREAD_NOT_CREATED = 0x5B, DD_CANT_GET_CAPS = 0x5C, DD_NO_OVERLAYSURFACE = 0x5D, DD_NO_OVERLAYSTRETCH = 0x5E, DD_CANT_CREATE_OVERLAYSURFACE = 0x5F, DD_CANT_UPDATE_OVERLAYSURFACE = 0x60, DD_INVALID_STRETCH = 0x61, EV_INVALID_EVENT_NUMBER = 0x64, INVALID_MODE = 0x65, CANT_FIND_FALCHOOK = 0x66, CANT_FIND_HOOK = 0x66, CANT_GET_HOOK_PROC_ADDR = 0x67, CANT_CHAIN_HOOK_PROC = 0x68, CANT_SETUP_WND_PROC = 0x69, IntPtr_NULL = 0x6A, INVALID_UPDATE_MODE = 0x6B, NO_ACTIVE_IMG_MEM = 0x6C, CANT_INIT_EVENT = 0x6D, FUNC_NOT_AVAIL_IN_OS = 0x6E, CAMERA_NOT_CONNECTED = 0x6F, SEQUENCE_LIST_EMPTY = 0x70, CANT_ADD_TO_SEQUENCE = 0x71, LOW_OF_SEQUENCE_RISC_MEM = 0x72, IMGMEM2FREE_USED_IN_SEQ = 0x73, IMGMEM_NOT_IN_SEQUENCE_LIST = 0x74, SEQUENCE_BUF_ALREADY_LOCKED = 0x75, INVALID_DEVICE_ID = 0x76, INVALID_BOARD_ID = 0x77, ALL_DEVICES_BUSY = 0x78, HOOK_BUSY = 0x79, TIMED_OUT = 0x7A, NULL_POINTER = 0x7B, WRONG_HOOK_VERSION = 0x7C, INVALID_PARAMETER = 0x7D, NOT_ALLOWED = 0x7E, OUT_OF_MEMORY = 0x7F, INVALID_WHILE_LIVE = 0x80, ACCESS_VIOLATION = 0x81, UNKNOWN_ROP_EFFECT = 0x82, INVALID_RENDER_MODE = 0x83, INVALID_THREAD_CONTEXT = 0x84, NO_HARDWARE_INSTALLED = 0x85, INVALID_WATCHDOG_TIME = 0x86, INVALID_WATCHDOG_MODE = 0x87, INVALID_PASSTHROUGH_IN = 0x88, ERROR_SETTING_PASSTHROUGH_IN = 0x89, FAILURE_ON_SETTING_WATCHDOG = 0x8A, ERROR_SETTING_DIGITAL_OUT = 0x8B, ERROR_NOT_SUPPORTED_BY_HARDWARE = 0x8C, PROCESS_ACCESS_DENIED = 0x8D, VIDEO_PROCESS_ALREADY_ATTACHED = 0x8E, IMG_SIZE_FOR_IMG_MEM_NOT_SET = 0x8F, WRONG_KEY = 0x96, DR_LIBRARY_NOT_FOUND = 0xA0, // the DirectRender library could not be found DR_DEVICE_OUT_OF_MEMORY = 0xA1, // insufficient graphics adapter video memory DR_CANNOT_CREATE_SURFACE = 0xA2, // the image or overlay surface could not be created DR_CANNOT_CREATE_VERTEX_BUFFER = 0xA3, // the vertex buffer could not be created DR_CANNOT_CREATE_TEXTURE = 0xA4, // the texture could not be created DR_CANNOT_LOCK_OVERLAY_SURFACE = 0xA5, // the overlay surface could not be locked DR_CANNOT_UNLOCK_OVERLAY_SURFACE = 0xA6, // the overlay surface could not be unlocked DR_CANNOT_GET_OVERLAY_DC = 0xA7, // cannot get the overlay surface DC DR_CANNOT_RELEASE_OVERLAY_DC = 0xA8, // cannot release the overlay surface DC DR_DEVICE_CAPS_INSUFFICIENT = 0xA9, // insufficient graphics adapter capabilities DR_SURFACE_LOST = 0xAA, // created surfaces were lost and recreated DR_CANNOT_LOCK_IMAGE_SURFACE = 0xAB, // the image surface could not be locked DR_CANNOT_UNLOCK_IMAGE_SURFACE = 0xAC, // the image surface could not be unlocked DR_NOT_ALLOWED_WHILE_DC_IS_ACTIVE = 0xAD, // not allowed between GetDC/ReleaseDC block } public const int IS_WAIT = 0x1; public const int IS_DONT_WAIT = 0x0; public const int IS_FORCE_VIDEO_STOP = 0x4000; public const int IS_FORCE_VIDEO_START = 0x4000; public const int RESET = 0x0000; public const int SET = 0x0001; public const int GET_ERR_REP_MODE = 0x8000; public const int GET_VIDEO_IN = 0x8000; public const int GET_VIDEO_IN_TOGGLE = 0x8001; public const int GET_LIVE = 0x8000; public const int GET_BRIGHTNESS = 0x8000; public const int GET_CONTRAST = 0x8000; public const int GET_SATURATION_U = 0x8000; public const int GET_SATURATION_V = 0x8001; public const int GET_HUE = 0x8000; public const int GET_VIDEO_MODE = 0x8000; public const int GET_DISPLAY_MODE = 0x8000; public const int GET_AGC_MODE = 0x8000; public const int GET_GAMMA_MODE = 0x8000; public const int GET_SYNC_LEVEL = 0x8000; public const int GET_CBARS_MODE = 0x8000; public const int GET_COLOR_MODE = 0x8000; public const int GET_CAPTURE_MODE = 0x8000; public const int GET_IMAGE_SIZE_X = 0x8000; public const int GET_IMAGE_SIZE_Y = 0x8001; public const int GET_IMAGE_POS_X = 0x8000; public const int GET_IMAGE_POS_Y = 0x8001; public const int GET_HOR_FILTER_MODE = 0x8000; public const int GET_HOR_FILTER_STEP = 0x8001; public const int GET_VERT_FILTER_MODE = 0x8000; public const int GET_VERT_FILTER_STEP = 0x8001; public const int GET_SCALER_MODE = 0x3E8; public const int GET_KC_RED = 0x8000; public const int GET_KC_GREEN = 0x8001; public const int GET_KC_BLUE = 0x8002; public const int GET_KC_RGB = 0x8003; public const int GET_KC_INDEX = 0x8004; public const int GET_KEYOFFSET_X = 0x8000; public const int GET_KEYOFFSET_Y = 0x8001; public const int GET_UPDATE_MODE = 0x8000; public const int GET_SYNC_GEN = 0x8000; public const int GET_IO = 0x8000; public const int GET_DIGOUT = 0x8001; public const int GET_FLASHSTROBE_FIELD = 0x8000; public const int GET_FLASHSTROBE_LINE = 0x8001; public const int GET_EXTERNALTRIGGER = 0x8000; public const int GET_TRIGGER_STATUS = 0x8001; public const int GET_TRIGGER_MASK = 0x8002; public const int GET_TRIGGER_INPUTS = 0x8003; public const int GET_STATUS = 0x8000; public const int GET_TOGGLE_INPUT_1 = 0x8000; public const int GET_TOGGLE_INPUT_2 = 0x8001; public const int GET_TOGGLE_INPUT_3 = 0x8002; public const int GET_TOGGLE_INPUT_4 = 0x8003; public const int GET_CROSSBAR = 0x8000; public const int GET_DD_OVERLAY_SCALE = 0x8000; public const int GET_VIDEO_PASSTHROUGH = 0x8000; #endregion public enum CaptureModeType : int { /// /// Acquires odd half images /// ODD = 0x0001, /// /// Acquires even half images /// Even = 0x0002, /// /// Acquires interlaced video (first the odd field, then the even field) /// Frame = 0x0004, /// /// Acquires non-interlaced video. Software solution, non interlaced cameras cannot be used. /// The first field is written in top of the memory and the second field into the lower part of the memory. /// NextFrame = 0x0010, /// /// Acquires next interlaced video beginning with next field (odd or even) /// NextField = 0x0020, /// /// Acquires next half image (odd or even) /// NonInterlaced = 0x0008, /// /// Acquires both fields with double field rate.Odd- and even-fields are acquired in the same memory area.Image size e.g.. 768x288 pixel, frame rate 50Hz. /// BothFields = ODD | Even | NonInterlaced, /// /// Acquires stereo video. Before the video channel IS_SET_VIDEO_IN_1 must have been set with is_SetVideoInput(). /// FrameStereo = 0x2004, /// /// Returns the current setting /// Mode = 0x8000 } public enum VideoSource : int { /// /// Video input 1 (composite video) /// VideoIn1 = 0x00, /// /// Video input 2 (composite video) /// VideoIn2 = 0x01, /// /// Video input 3 (composite video) /// VideoIn3 = 0x03, /// /// Video input 4 (composite video) /// VideoIn4 = 0x04, /// /// Video input 3 (S-Video; SVHS) /// VideoInS = 0x02, /// /// Video input 1 (S-Video) /// VideoIn1S = 0x10, /// /// Video input 2 (S-Video) /// VideoIn2S = 0x11, /// /// Video input 2 (S-Video) /// VideoIn3S = 0x13, /// /// Video input 1 (S-Video) /// VideoIn4S = 0x14, /// /// Return of current setting /// GetVideoIn = 0x8000 } public enum BoardType : int { Falcon = 1, Eagle = 2, FalconPlus = 7, FalconQuattro = 9 } public enum BoardStatusType : int { /// /// Number of FIFO Overruns. Will be increased each time image data are lost during the transmission via PCI bus from PC to frame grabber. /// IsFifoOverCNT = 1, /// /// Number of images in a sequence. The counter is set to zero with function is_CaptureVideo() and increased with each change of the sequence buffer. /// IsSequenceCNT = 2, /// /// Has a Fifo-Overrun happen in last frame? /// IsLastFrameFifoOVR = 3, /// /// Number of sequence buffer (read only) /// IsSequenceSize = 4, /// ///Trigger interrupt counter (only FALCONquattro/FALCONquattro Express) /// IsExtTriggerEventCNT = 0, /// /// Returns whether a video signal is present at the selected video input. (read only) /// 0 = no signal present /// 1 = signal present /// After the start of is_CaptureVideo() approx. 0,1 s must be waited before this function may be queried. /// IsVideoPresent = 5, /// /// Flag which indicates whether the steal process has finished (read only): /// 0 = still active /// 1 = finished /// IsStealFinished = 6, /// /// Option to keep the selected file path of the file open or file save dialog box of is_SaveImage()/is_LoadImage(). /// value = 0: don’t keep file path (default) /// value = 1: keep file path /// IsStoreFilePath = 7, /// /// Enables or disables the luma notch filter: /// 0 = disabled /// 1 = enabled /// IsLumaBandwidthFilter = 8, /// /// Returns the hardware revision of the board (read only). /// IsBoardRevision = 9, /// /// Horizontal mirroring with is_SaveImage() and is_SaveImageMem() /// 0 = mirroring off /// 1 = mirroring on /// IsMirrorBitmapUpDown = 10, /// /// Number of PCI bus overruns. The number is incremented if data were lost because of bus overload. /// IsBusOverCNT = 11, /// /// 0 = color processing always on /// 1 = Switch off color processing in the case of bad signals. (default) /// IsLowColorRemoval = 13, /// /// Enable/Disable ChromaComb filter /// 0 = filter off /// 1 = filter on /// IsCHROMA_COMB_FILTER = 14, /// /// Enable/Disable the automatic gain control (AGC): /// 0 = Chroma AGC off /// 1 = Chroma AGC on (default) /// IschromaAGC = 15, /// /// Display double height images in DirectDraw mode. /// 0 = single height /// 1 = double height /// IsRenderDoubleHeight = 128, /// /// Switching off the internal reference signal and expects an external one (Vref). /// 0 = internal AGC mode /// 1 = external Vref mode /// IsExternalVREFMode = 18, /// /// Returns the presence of a hardware watchdog (read only): /// 0 = no watchdog available /// 1 = watchdog available /// IsWatchdogOnBoard = 16, /// /// Returns the presence of a video output (read only): /// 0 = no video output available /// 1 = video output available /// IsPassthroughOnBoard = 17 } public enum VideoMode : int { /// /// PAL standard color 50 Hz /// PAL = 0x00, /// /// NTSC standard color 60 Hz /// NTSC = 0x01, /// /// SECAM standard 50 Hz /// SECAM = 0x02, /// /// Automatic video standard detection /// If no video signal is present then IS_NO_SUCCESS is returned. /// AUTO = 0x03, /// /// Returns the current setting /// Mode = 0x8000 } public enum FieldType : int { Odd = 0, Even = 1 } public enum EventType : int { /// /// Event is signalized in odd field (in connection with is_FreezeVideo()) /// Odd = 0x00, /// /// Event is signalized in even field (in connection with is_FreezeVideo()) /// Even = 0x01, /// /// Event is signalized after a complete frame (in connection with is_FreezeVideo()) /// Frame = 0x02, /// /// Trigger event /// ExtTrigger = 0x03, /// /// Event is signalized at every VSYNC /// VSync = 0x04, /// /// Event is signalized at change of sequence buffer /// Attention: If the video signal is lost, the event is still set /// Sequence = 0x05, /// /// Event is signalized when is_StealVideo() has finished /// Steal = 0x06, /// /// Event is signalized when the analogous video signal of the active input is turned on or off. See also is_BoardStatus() parameter IS_VIDEO_PRESENT. /// VideoPresent = 0x07, } public enum RenderMode { /// /// Image output 1:1 from the memory /// Normal, /// /// Fit the image into the size of the window /// FitToWindow, /// /// Display the image with a size of 50 % of the original size. /// Downscale1To2, /// /// Horizontal mirroring of the image (upside down) /// MirrorUpDown, /// /// Display of the image with half height without scaling. The is been clipped. /// HalfHeight, /// /// Uses the color setting of the allocated image memory, not the current setting of is_SetColorMode(). /// UseMemoryColor } public enum DirectRendererMode { /// /// Returns the device context (DC) handle to the overlay area of the graphics card. /// In Direct3D mode, the DR_GET_OVERLAY_DC mode returns the device context (DC) handle of the overlay area. Using this handle, it is possible to access the overlay using the Windows GDI functionality. Thus, all Windows graphics commands (e.g. Line, Circle, Rectangle, TextOut) are available. To transfer the drawn elements to the overlay, release the DC handle by calling DR_RELEASE_OVERLAY_DC. /// GetOverlayDC = 1, /// /// Releases the device context (DC) handle. /// Using DR_RELEASE_OVERLAY_DC, you can release the DC handle and update the overlay data /// ReleaseOverlayDC = 4, /// /// Reurns the width x and height y of the maximum overlay area supported by the graphics card. /// GetMaxOverlaySize = 2, /// /// Defines the size of the overlay area (default: current camera image size). /// SetOverlaySize = 7, /// /// Defines the position of the overlay area. /// SetOverlayPosition = 8, /// /// Returns the RGB values of the current key color (default: black). /// GetOverlayColorKey = 3, /// /// Defines the RGB values of the key color. /// SetOverlayColorKey = 9, /// /// Enables overlay display on top of the current camera image /// ShowOverlay = 5, /// /// Disables overlay display. /// HideOverlay = 6, /// /// Enables real-time scaling of the image to the size of the display window. /// EnableScaling = 11, /// /// Disables real-time scaling. /// DisableScaling = 12, /// /// Enables a semi-transparent display of the overlay area. /// In semi-transparent mode, the values of the camera image and the overlay data are added up for each pixel. Since black has the value 0, the complete camera image will be visible if the overlay is black; if the overlay is white, only the overlay will be visible. With all other colors, the camera image will be visible with the overlay superimposed. /// The key color has no effect in semi-transparent mode! /// EnableSemiTransparentOverlay = 14, /// /// Disables the semi-transparent display of the overlay area. /// DisableSemiTransparentOverlay = 15, /// /// Enables synchronization of the image display with the monitor's image rendering. The image is displayed upon the monitor's next VSYNC signal. /// SetVSyncAuto = 18, /// /// Disables image display synchronization. The image is displayed immediately. /// SetVSyncOff = 17, /// /// Enables synchronization of the image display with a monitor pixel row specified by the user. /// Note that the auto-VSYNC function might not always optimally synchronize image rendering. In this case, you can eliminate flicker by manually setting a suitable position for synchronization. The position needs to be determined individually, based on the camera type and the graphics card. /// SetUserSync = 19, /// /// Returns the minimum and maximum row position for DR_SET_USER_SYNC. /// GetUSerSyncPositionRange = 20, /// /// Loads a bitmap image (*.BMP file) into the overlay area. If the bitmap image is larger than the overlay area, the bitmap image is clipped. /// OverlayFromFile = 21, /// /// Deletes the data of the overlay area by filling it with black color. /// ClearOverlay = 13, /// /// Copies the next image to the active user memory which was set with is_SetImageMem() (Steal function). /// Using the pParam parameter, you specify when the function should return: IS_WAIT: The function waits until the image save is complete.,IS_DONT_WAIT: The function returns immediately. /// StealNextFrame = 22, /// /// Defines the color format identical to is_Prepare StealVideo(). /// For a list of all available color formats, see the function description for is_SetColorMode(). The default is IS_CM_RGB32. A value of 0xFFFFFFFF (-1) deactivates the steal mode (same as is_StealVideo(h, IS_EXIT_STEAL_VIDEO)). /// SetStealFormat = 23, /// /// Returns the color format setting for the Steal function. /// GetStealFormat = 24, /// /// Sets a new window handle for image output in Direct3D. This requires the Direct3D interface to be re-initialized internally. All overlay data will be discarded and has to be redrawn by the application. The Overlay-Lost message signals to the application in this case (see also description above). /// SetHWND = 10, /// /// Returns whether the graphics card supports the Direct3D functions. /// CheckCompatibility = 16, /// /// Checks whether the specified color modes can be used for display. The FALCON color mode has to be passed as source mode and the desired VGA mode as target mode. /// CheckColorModeSupport = 27, } public enum PixelFormat { Y8 = 8, RGB8 = 8, RGB15 = 15, RGB16 = 16, RGB24 = 24, RGB32 = 32, } public enum ColorMode { /// /// 8 bit monochrome images /// Y8 = 0x06, /// /// 8 bit color images; 2 R - 3 G - 2 B /// RGB8 = 0x07, /// /// Hi-color mode; 5 R - 5 G - 5 B /// RGB15 = 0x03, /// /// Hi-color mode; 5 R - 6 G - 5 B /// RGB16 = 0x2, /// /// 24 bit true color mode; R-G-B /// RGB24 = 0x1, /// /// 32 bit true color mode, R-G-B dummy /// RGB32 = 0x00, /// /// YUV color images /// YUV422Planar, /// /// Returns the current setting /// Mode = 0x8000, } public enum DisplayMode { /// /// Acquire image in image memory /// Bitmap = 1, /// /// DirectDraw mode (back buffer mode) /// DirectDraw = 2, /// /// Direct3D mode /// Direct3d = 4, //DirectDraw Back Buffer Erweiterung /// /// DirectDraw buffer can be set in PC, if the VGA memory is not large enough /// AllowSysmem = 0x40, //DirectDraw Primary Surface Erweiterung /// /// Primary surface mode (no overlay possible) /// AllowPrimary = 0x80, //DirectDraw Overlay Surface Erweiterung /// /// Overlay surface mode /// AllowOverlay = 0x100, /// /// Real time scaling in overlay surface mode /// AllowScaling = 0x200, /// /// Field representation at ysize ≤ PAL/2 (288) /// AllowFieldskip = 0x400, /// /// Returns the current setting /// Mode = 0x800, } #region Custom Methodes public const uint IS_GET_STATUS = 0x8000; /// /// Returns whether a video signal is present at the selected video input. /// /// Frame grabber handle /// false = no signal present, true = signal present public static bool IsSignalAvailable(in IntPtr hf) => 0 != BoardStatus(hf, (int)BoardStatusType.IsVideoPresent, IS_GET_STATUS); /// /// Returns the presence of a hardware watchdog /// /// Frame grabber handle /// false = no watchdog available, true = watchdog available public static bool IsWatchdogAvailable(in IntPtr hf) => 0 != BoardStatus(hf, (int)BoardStatusType.IsWatchdogOnBoard, IS_GET_STATUS); /// /// Returns the presence of a video output /// /// Frame grabber handle /// false = no video output available, true = video output available public static bool IsVideoAvailable(in IntPtr hf) => 0 != BoardStatus(hf, (int)BoardStatusType.IsPassthroughOnBoard, IS_GET_STATUS); #endregion } }