RGB.H
资源名称:RGBEASY.ZIP [点击查看]
上传用户:guoxiu1214
上传日期:2019-02-27
资源大小:876k
文件大小:12k
源码类别:
多显示器编程
开发平台:
Visual C++
- /*******************************************************************************
- Copyright Datapath Ltd. 2007, 2008.
- File: rgb.h
- Purpose: Definitions for a simple RGB interface.
- History:
- 19 DEC 07 SB Created.
- 08 FEB 08 MJE Added capture card #defines so they can be
- conditionally parsed by the preprocessor.
- 28 MAR 08 MJE Added drawing callback functions.
- 03 APR 08 MJE Added RGBMODEINFO.
- 25 JUN 08 SB Added colour balance to the RGBVALUECHANGEDINFO
- structure. Changed RGBDRAWNOSIGNALFN and
- RGBDRAWINVALIDSIGNALFN to bring them in line with
- the other callback functions.
- *******************************************************************************/
- #ifndef _RGB_H_
- #define _RGB_H_
- #include <pshpack1.h>
- /******************************************************************************/
- /* The calling convention of the RGB SDK callback functions. */
- #define RGBCBKAPI __stdcall
- /******************************************************************************/
- /* The RGB load handle. */
- typedef unsigned long HRGBDLL, *PHRGBDLL;
- /* The RGB capture handle. */
- typedef unsigned long HRGB, *PHRGB;
- /******************************************************************************/
- #define CAPTURECARD_DGC103 0
- #define CAPTURECARD_DGC133 1
- /* The CAPTURESTATE enumerated type contains a list of the capture cards
- * returned by RGBGetCaptureCard. */
- typedef enum _CAPTURECARD
- {
- RGB_CAPTURECARD_DGC103 = CAPTURECARD_DGC103,
- RGB_CAPTURECARD_DGC133 = CAPTURECARD_DGC133,
- } CAPTURECARD, *PCAPTURECARD;
- /******************************************************************************/
- /* The CAPTURESTATE enumerated type contains a list of the capture states
- * returned by RGBGetCaptureState. */
- typedef enum _CAPTURESTATE
- {
- RGB_STATE_CAPTURING = 0,
- RGB_STATE_NOSIGNAL = 1,
- RGB_STATE_INVALIDSIGNAL = 2,
- RGB_STATE_PAUSED = 3,
- RGB_STATE_ERROR = 4,
- } CAPTURESTATE, *PCAPTURESTATE;
- /******************************************************************************/
- /* The PIXELFORMAT enumerated type contains a list of possible pixel formats.
- * Please not that a capture card may only support a subset of these pixel
- * formats. */
- typedef enum _PIXELFORMAT
- {
- RGB_PIXELFORMAT_AUTO = 0,
- RGB_PIXELFORMAT_555 = 1,
- RGB_PIXELFORMAT_565 = 2,
- RGB_PIXELFORMAT_888 = 3,
- RGB_PIXELFORMAT_GREY = 4,
- } PIXELFORMAT, *PPIXELFORMAT;
- /******************************************************************************/
- /* The RGBFRAMECAPTUREDFN function is an application-defined callback function
- * used with RGBSetFrameCapturedFn. The RGB SDK calls this function when a frame
- * of RGB data has been captured.
- *
- * The pBitmapInfo and pBitmapBits pointers will be NULL when DirectDMA has been
- * enabled. This is because the RGB data is not available as it has been
- * transfered by DMA directly from the RGB capture card to the Display card. */
- typedef void (RGBCBKAPI RGBFRAMECAPTUREDFN) (
- HWND hWnd, /* Handle to the RGB Window. */
- HRGB hRGB, /* Handle to the RGB Capture. */
- LPBITMAPINFOHEADER pBitmapInfo, /* Pointer to a BITMAPINFOHEADER structure. */
- void *pBitmapBits, /* Pointer to the bitmap bits. */
- unsigned long userData ); /* Application defined context. */
- typedef RGBFRAMECAPTUREDFN *PRGBFRAMECAPTUREDFN;
- /******************************************************************************/
- /* The RGBMODECHANGEDFN function is an application-defined callback function
- * used with RGBSetModeChangedFn. The RGB SDK calls this function when a new
- * video mode has been detected. */
- typedef struct
- {
- unsigned long Size; /* Size of this structure. */
- unsigned long RefreshRate; /* The horizontal refresh rate in Hertz. */
- unsigned long LineRate; /* The vertical line rate in Hertz. */
- unsigned long TotalNumberOfLines; /* The total number of lines. */
- long BInterlaced; /* A boolean indicating an interlaced
- mode has been detected. */
- long BDVI; /* A boolean indicating a DVI mode has
- been detected. */
- } RGBMODECHANGEDINFO, *PRGBMODECHANGEDINFO;
- typedef void (RGBCBKAPI RGBMODECHANGEDFN) (
- HWND hWnd, /* Handle to the RGB Window. */
- HRGB hRGB, /* Handle to the RGB Capture. */
- PRGBMODECHANGEDINFO pModeChangedInfo, /* Pointer to a RGBMODECHANGEDINFO
- structure. */
- unsigned long userData ); /* Application defined context. */
- typedef RGBMODECHANGEDFN *PRGBMODECHANGEDFN;
- /******************************************************************************/
- /* The RGBMODEINFO structure is filled by RGBGetModeInfo. It describes the
- * current mode being captured. If State is RGB_STATE_CAPTURING then all the
- * fields are valid. If State is RGB_STATE_NOSIGNAL then RefreshRate, LineRate,
- * TotalNumberOfLines, BInterlaced and BDVI are all invalid. If State is
- * RGB_STATE_INVALIDSIGNAL RefreshRate and LineRate contain the out of range
- * frequencies, and BDVI indicates whether the signal is DVI. */
- typedef struct
- {
- unsigned long Size; /* Size of this structure. */
- CAPTURESTATE State; /* The state of the capture. */
- unsigned long RefreshRate; /* The horizontal refresh rate in Hertz. */
- unsigned long LineRate; /* The vertical line rate in Hertz. */
- unsigned long TotalNumberOfLines; /* The total number of lines. */
- long BInterlaced; /* A boolean indicating an interlaced
- mode has been detected. */
- long BDVI; /* A boolean indicating a DVI mode has
- been detected. */
- } RGBMODEINFO, *PRGBMODEINFO;
- /******************************************************************************/
- /* The RGBNOSIGNALFN function is an application-defined callback function
- * used with RGBSetNoSignalFn. The RGB SDK calls this function when a video
- * signal cannot be detected. */
- typedef void (RGBCBKAPI RGBNOSIGNALFN) (
- HWND hWnd, /* Handle to the RGB Window. */
- HRGB hRGB, /* Handle to the RGB Capture. */
- unsigned long userData ); /* Application defined context. */
- typedef RGBNOSIGNALFN *PRGBNOSIGNALFN;
- /* The RGBDRAWNOSIGNALFN function is an application defined callback function
- * used with RGBSetDrawNoSignalFn. The RGB SDK calls this function to draw the
- * window when a video signal cannot be detected. */
- typedef void (RGBCBKAPI RGBDRAWNOSIGNALFN) (
- HWND hWnd,
- HRGB hRGB,
- HDC hDC,
- unsigned long userData );
- typedef RGBDRAWNOSIGNALFN *PRGBDRAWNOSIGNALFN;
- /******************************************************************************/
- /* The RGBINVALIDSIGNALFN function is an application-defined callback function
- * used with RGBSetInvalidSignalFn. The RGB SDK calls this function when a video
- * signal beyond the capabilities of the hardware is detected. */
- typedef void (RGBCBKAPI RGBINVALIDSIGNALFN) (
- HWND hWnd, /* Handle to the RGB Window. */
- HRGB hRGB, /* Handle to the RGB Capture. */
- unsigned long horClock,
- unsigned long verClock,
- unsigned long userData ); /* Application defined context. */
- typedef RGBINVALIDSIGNALFN *PRGBINVALIDSIGNALFN;
- /* The RGBDRAWINVALIDSIGNALFN function is an application defined callback
- * function used with RGBSetDrawInvalidSignalFn. The RGB SDK calls
- * this function to draw the window when a video signal is invalid. */
- typedef void (RGBCBKAPI RGBDRAWINVALIDSIGNALFN) (
- HWND hWnd,
- HRGB hRGB,
- HDC hDC,
- unsigned long horClock,
- unsigned long verClock,
- unsigned long userData );
- typedef RGBDRAWINVALIDSIGNALFN *PRGBDRAWINVALIDSIGNALFN;
- /******************************************************************************/
- typedef void (RGBCBKAPI RGBERRORFN) (
- HWND hWnd, /* Handle to the RGB Window. */
- HRGB hRGB, /* Handle to the RGB Capture. */
- unsigned long error, /* The error. */
- unsigned long userData, /* Application defined context. */
- unsigned long *pReserved );
- typedef RGBERRORFN *PRGBERRORFN;
- /******************************************************************************/
- /* The RGBVALUECHANGEDFN function is an application-defined callback function
- * used with RGBSetModeValueChangedFn. The RGB SDK calls this function when a
- * value new video mode has been detected. */
- typedef struct
- {
- long BChanged; /* Flag to indicate that value has changed. */
- signed long Value; /* The new signed value. */
- } SIGNEDVALUE;
- typedef struct
- {
- long BChanged; /* Flag to indicate that value has changed. */
- unsigned long Value; /* The new unsigned value. */
- } UNSIGNEDVALUE;
- typedef struct
- {
- unsigned long Size; /* Size of this structure. */
- SIGNEDVALUE HorPosition; /* Horizontal Position. */
- UNSIGNEDVALUE HorScale; /* Horizontal Scale. */
- UNSIGNEDVALUE VerPosition; /* Vertical Position. */
- SIGNEDVALUE CaptureWidth; /* Capture Width. */
- UNSIGNEDVALUE CaptureHeight; /* Capture Height. */
- SIGNEDVALUE Brightness; /* Brightness. */
- SIGNEDVALUE Contrast; /* Contrast. */
- SIGNEDVALUE BlackLevel; /* Black level. */
- SIGNEDVALUE Phase; /* Phase. */
- UNSIGNEDVALUE RedGain; /* RedGain. */
- UNSIGNEDVALUE GreenGain; /* GreenGain. */
- UNSIGNEDVALUE BlueGain; /* BlueGain. */
- UNSIGNEDVALUE RedOffset; /* RedOffset. */
- UNSIGNEDVALUE GreenOffset; /* GreenOffset. */
- UNSIGNEDVALUE BlueOffset; /* BlueOffset. */
- } RGBVALUECHANGEDINFO, *PRGBVALUECHANGEDINFO;
- typedef void (RGBCBKAPI RGBVALUECHANGEDFN) (
- HWND hWnd, /* Handle to the RGB Window. */
- HRGB hRGB, /* Handle to the RGB Capture. */
- PRGBVALUECHANGEDINFO pValueChangedInfo, /* Pointer to a RGBVALUECHANGEDINFO
- structure. */
- unsigned long userData ); /* Application defined context. */
- typedef RGBVALUECHANGEDFN *PRGBVALUECHANGEDFN;
- /******************************************************************************/
- #define RGB_ERROR_BASE 0x01160000
- #define RGB_ERROR_UNKNOWN ( RGB_ERROR_BASE + 0x0000 )
- #define RGB_ERROR_OUTOFRANGE ( RGB_ERROR_BASE + 0x0001 )
- #define RGB_ERROR_INVALIDINPUT ( RGB_ERROR_BASE + 0x0002 )
- #define RGB_ERROR_WINDOWINUSE ( RGB_ERROR_BASE + 0x0003 )
- #define RGB_ERROR_DETECTVIDEOMODE ( RGB_ERROR_BASE + 0x0005 )
- #define RGB_ERROR_INVALIDBUFFER ( RGB_ERROR_BASE + 0x0006 )
- #define RGB_ERROR_INVALIDHANDLE ( RGB_ERROR_BASE + 0x0007 )
- /******************************************************************************/
- #include <poppack.h>
- /******************************************************************************/
- #endif //_RGB_H_
- /******************************************************************************/