📄 okapi32.h
字号:
//if lpBuf=NULL, just return data length to read
long WINAPI okWriteRect(HANDLE hBoard, TARGET dst, short start, LPBYTE lpBuf);
//write data in lpBuf to rect(set previous) of dst (SCREEN, BUFFER, FRAME)
//the data in lpBuf stored in way row by row
//return -1 if not support, return 0 failed,
//if success return data length written in byte
long WINAPI okReadRectEx(HANDLE hBoard, TARGET src, short start, LPBYTE lpBuf, LPARAM lParam);
//read data into lpBuf from rect(set previous) in frame start of dst (SCREEN, BUFFER, FRAME)
//the data in lpBuf stored in way row by row
//if src not supported return -1, if failed return 0,
//return -1 if not support, return 0 failed,
//if success return data length read in byte
//if lpBuf=NULL, just return data length to read
//LOWORD(lParam)is form code for bits of lpBuf (e.g.:FORM_GRAY8),if it is 0 mean: as same as src
//HIWORD(LParam) is the mode of taking channels. mode=0 take all, =1 red, =2 green, =3 blue;
long WINAPI okWriteRectEx(HANDLE hBoard, TARGET dst, short start, LPBYTE lpBuf, LPARAM lParam);
//write data in lpBuf to rect(set previous) of dst (SCREEN, BUFFER, FRAME)
//the data in lpBuf stored in way row by row
//return -1 if not support, return 0 failed,
//if success return data length written in byte
//LOWORD(lParam)is form code for bits of lpBuf (e.g.:FORM_GRAY8),if it is 0 mean: as same as dst
//HIWORD(LParam) is the mode of taking channels. mode=0 take all, =1 red, =2 green, =3 blue;
long WINAPI okTransferRect(HANDLE hBoard, TARGET dest, short iFirst, TARGET src, short iStart, long lNum);
//transfer source rect to dest rect (here target can be SCREEN, BUFFER, FRAME, also BLOCKINFO point to user memory)
//if total in dest or src less than lNum, it will rewind to begin then continue
//this function transfer in format of src, that means it don't convert pixel bits if dst and src are not same
//if src or dst not supported return -1, if failed return 0,
//if success return data length of one block image in byte
long WINAPI okConvertRect(HANDLE hBoard, TARGET dst, short first, TARGET src, short start, LPARAM lParam);
//transfer source rect to dest rect (here target can be SCREEN, BUFFER, FRAME, also BLOCKINFO point to user memory)
//LOWORD(lParam)=lNum, total num, HIWORD(lParam)=mode, channels to convert
//mode=0 take all, =1 red, =2 green, =3 blue;
//if total in dest or src < lNum, it will rewind to begin then continue
//this function convert to pixel foramt of dst if dst has not same bits format as src
//if src or dst not supported return -1, if failed return 0,
//if success return image size of one block in pixel
long WINAPI okConvertRectEx(HANDLE hDstBoard, TARGET dst, short first, HANDLE hSrcBoard, TARGET src, short start, LPARAM no);
//same as the above function okConvertRect except with src handle
long WINAPI okGetSignalParam(HANDLE hBoard, WPARAM wParam);
//Get specified param of video signal source
//if not support return -1, if error return -2, else return param
long WINAPI okWaitSignalEvent(HANDLE hBoard, WPARAM wParam, LPARAM lMilliSecond);
//Wait specified signal come
//lMilliSecond is time-out time in milliseconds for to wait
//if lMilliSecond is zero, the function returns current state immediately
//if lMilliSecond is INFINITE(-1) wait forever until event come
//return -1 not support, 0 speicfied signal not come, 1 come
BOOL WINAPI okSetSeqProcWnd(HANDLE hBoard, HWND hwndMain);
//set proc hwnd for receive message about sequence capture
BOOL WINAPI okSetSeqCallback(HANDLE hBoard,
BOOL CALLBACK BeginProc(HANDLE hBoard),
BOOL CALLBACK SeqProc(HANDLE hBoard, long No),
BOOL CALLBACK EndProc(HANDLE hBoard));
//set callback function for multi-frame capturing function
//(which are okCaptureTo, okCaptureFrom,okCaptureToFile, okCaptureFromFile)
//see follow
BOOL CALLBACK BeginProc(HANDLE hBoard); //user defined callback function
//callback this function before to capture
BOOL CALLBACK SeqProc(HANDLE hBoard, long No); //user defined callback function
// callback this function after finish capturing one frame
// No is the number(0 based) frame just finished or being playbacked.
BOOL CALLBACK EndProc(HANDLE hBoard); //user defined callback function
// callback this function after end capturing
//---overlay mask:
long WINAPI okEnableMask(HANDLE hBoard, BOOL bMask);
//0: disable mask; 1: positive mask, 2: negative mask
//positive: 0 for win clients visible, 1 video visible
//negative: 0 for video visible, 1 for win client (graph) visible
//if bMask=-1 actually not set just get status previous set
//return last mask status,
long WINAPI okSetMaskRect(HANDLE hBoard, LPRECT lpRect, LPBYTE lpMask);
//Set mask rect(lpRect is relative to lpDstRect in SetScreenRect or
//SetBufferRect, lpMask is mask code (in byte 0 or 1). one byte for one pixel
//if lpMask==1, set all rect region in lpRect video visible
//if lpMask==0, set all rect region in lpRect video unvisible
//return base linear address of inner mask bit
//---set out LUT:
long WINAPI okFillOutLUT(HANDLE hBoard, LPBYTE bLUT, short start, short num);
//fill specified playback out LUT.
//bLut stored values to fill, (r0,g0,b0, r1,g1,b1 ...)
//start: offset pos in LUT(based 0), num: num items to fill
BOOL WINAPI okCaptureSequence(HANDLE hBoard, LONG lStart, LPARAM lNoFrame);
//capture sequence to BUFFER by way of Interrupt Service Routine
//Note: Only M10 series, M20H,M40, M60, M30, M70 and RGB20 support this way
//wParam=start(o based). lParam>0: number of frame to capture to,
//if lParam > total frames in BUFER, it will loop in rewind mode(i%total)
//when -1 mean loop in all buffer. infinitely until call okStopCapture,
//return max num frame can be stored in the target in this way if success,
// return 0 if failed(eg. format not matched). -1 not support target
//this call will start a Interrupt Service Routine to manage to capture sequencely then
//return immediately not wait to finish. This routine not support callback
BOOL WINAPI okPlaybackSequence(HANDLE hBoard, LONG lStart, LONG lNoFrame);
//playback on monitor from BUFFER
//start(0 based), lNoFrame>0: number of frame to capture to,
//if lParam > total frames in BUFER, it will loop in rewind mode (i%total)
//if lParam=-1 mean it loop infinitely until call okStopCapture
//return max num frame be stored in the target if success,
//return 0 if wrong. -1 not support
//this call will start a Interrupt Service Routine to manage to playback sequencely then
//return immediately not wait to finish. This routine not support callback
//
//---multi cards access--------
short WINAPI okGetSlotBoard(BOARDTYPE **lpOkInfo);
//Query all Ok boards available in PCI bus, return total number
short WINAPI okGetBoardIndex(char *szBoardName, short iNo);
//Get index (start 0) of specified board name string (it can also be typcode string)
// and order in same name (start 0),
//return -1 if no this specified ok board
short WINAPI okGetBoardName(long lIndex, LPSTR szBoardName);
//get the board code and name of the specified index
//return the type code if success else return 0 if no card
BOOL WINAPI okLoadInitParam(HANDLE hBoard, short iChannNo);
//load specified chann (and as current chann.)of initial params
BOOL WINAPI okSaveInitParam(HANDLE hBoard, short iChannNo);
//save current init param to specified chann (and as current chann.)
long WINAPI okGetAvailBuffer(void **lpLinear, DWORD *dwSize);
//Get free meomery buffers pre-allocated .
//call it when user hope to access buffer directly or lock for some one board
long WINAPI okLockBuffer(HANDLE hBoard, DWORD dwSizeByte, void **lpBasLinear);
//Lock speicfiled size meomery buffers, then other handle can not use them
//return the size of locked buffer in fact
BOOL WINAPI okUnlockAllBuffer(void);
//Unlock all buffer for all handle
BOOL WINAPI okMulCaptureTo(HANDLE *lphBaord,TARGET Dest, WORD wParam, LPARAM lParam);
//control multi boards to capture to target simultaneously, lphBaord are pointer of hBoard of multi board
//other functions are same as okCaptureByBuffer
BOOL WINAPI okMulCaptureByBuffer(HANDLE *lphBaord,TARGET tgt, short start, long num);
//control multi boards to capture by buffer simultaneously, lphBaord are pointer of hBoard of multi board
//other functions are same as okCaptureByBuffer
//-- set pre-allocate buffer size in k byte
long WINAPI okSetAllocBuffer(long lSize);
//set the new size to preallocate in k bytes,
//if new size is not same as current,
//then the functuion will restart the window system
BOOL WINAPI okSetStaticVxD(long lMode);
//lMode=0: check if static vxd registered.
//=1: create static vxd register
//=2: delete static vxd register
BOOL WINAPI okSetNTDriver(BOOL bCmd);
//bCmd=0: check if nt driver installed.
//=1: install nt driver
//=2: remove nt driver
//---apps utilities-----------------
//save and load files
long WINAPI okSaveImageFile(HANDLE hBoard, LPSTR szFileName, long first, TARGET target, long start, long num);
//here target can be BUFFER, SCREEN, FRAME or user buffer pointor
//1.if ext name=".bmp":
//create new file and than save one frame in start position of target as bmp file
//
//2.if ext name=".seq":
//save no frame from (start) in target into (first) frame pos in seq(sequence) file in sequencely.
//if the file already exist the function will not delete it, that mean old contents in the file will be kept.
//So if you want create a new seq file with a existed file name you must delete before this call .
//
long WINAPI okLoadImageFile(HANDLE hBoard, LPSTR szFileName, long first, TARGET target, long start, long num);
//here target can be BUFFER, SCREEN, FRAME or user buffer pointor
//1.if ext name=".bmp":
//load one frame into start position of target from bmp file
//
//2.if ext name=".seq":
//load no frame into (start) in target from (first) frame pos in seq(sequence) file in sequencely.
//apps setup dialog
BOOL WINAPI okOpenSetParamDlg( HANDLE hBoard, HWND hParentWnd);
//dialog to setup video param
BOOL WINAPI okOpenSeqCaptureDlg( HANDLE hBoard, HWND hParentWnd);
//dialog to capture sequence image
LPDIBINFO WINAPI okOpenReplayDlg( HANDLE hBoard, HWND hWnd, TARGET src, long total);
//open modeless dialog to replay sequence images(in BUFFER, USERBUF or seq file) on SCREEN or MONITOR
HWND WINAPI okOpenReplayDlgEx( HANDLE hBoard, HWND hWnd, TARGET src, long total, LPBITMAPINFOHEADER lpbi, LPBYTE lpdib);
//open modeless dialog to replay sequence images(in BUFFER, USERBUF or seq file) on SCREEN or MONITOR
//---
long WINAPI okReadProtCode(HANDLE hApi, short iIndex);
long WINAPI okWriteProtCode(HANDLE hApi, short iIndex, long code);
// ports io utilities
//this function only used for OK PCI GPIO20
short WINAPI okGetGPIOPort(short index, WORD *wPortBase);
//get port base and count of ok PCI GPIO20
//wPortBase: port base, return port count if success else return 0
//utilities just for WinNT/Win2000
BOOL WINAPI okOutputByte(WORD wPort, BYTE data);
//output a byte at specified port
BOOL WINAPI okOutputShort(WORD wPort, short data);
//output a word at specified port
BOOL WINAPI okOutputLong(WORD wPort, long data);
//output a dword at specified port
//----------- input data at port
BYTE WINAPI okInputByte(WORD wPort);
//input a byte at specified port
short WINAPI okInputShort(WORD wPort);
//input a word at specified port
long WINAPI okInputLong(WORD wPort);
//input a dword at specified port
BOOL WINAPI okSetPortBase(WORD wPortBase, short iPortCount);
//set ports to use by setting port base address and port count
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
//-------------------end--------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -