⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 okapi32.h

📁 实现了java调用c的功能(JNI)
💻 H
📖 第 1 页 / 共 4 页
字号:
		// return 0 if failed(eg. format not matched). -1 not support target
		//this call will create a thread to manage to capture sequencely then
		//return immediately not wait to finish. This thread will callback if need
		//this function same as okCaptureTo(hBoard, Dest, wParam, n);
		//but it is not same, when n=1 this function is also a thread and still support callback

BOOL	WINAPI okCaptureToScreen(HANDLE hBoard);
		//Start to capture to screen (video real-time display on screen) and return immediately
		//this is just a special routine of okCaptureTo(hBoard,SCREEN,0,0)

BOOL	WINAPI okCaptureTo(HANDLE hBoard, TARGET Dest, long start, LPARAM lParam);
		//capture video source to target which can be BUFFER, SCREEN, FRAME, MONITOR 
		//start(o based), lParam>0: number of frame to capture to, =0: cont. mode,
 		//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 can be stored in the target if success,
		// return 0 if failed(eg. format not matched). -1 not support target
		//this call will return immediately not wait to finish.
		//This function is not recomended to use for new user 


BOOL	WINAPI okPlaybackFrom(HANDLE hBoard, TARGET src, long start, LPARAM lParam);
		//playback on monitor from target which can be BUFFER, FRAME
		//start(o based), lParam>0: number of frame to capture to, =0: cont. mode 
		//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 target
		//this call will return immediately not wait to finish.
		//

//get status and stop capture
long	WINAPI okGetCaptureStatus(HANDLE hBoard, BOOL bWait);
		//query capturing status, if bWait then wait to finish capturing, else return immediately.
		//return 0 if finished, if cont. mode capturing return target capture to
		//(which include SCREEN -1, FRAME -2, MONITOR -3)
		//if capturing to/from BUFFER or file, return the frame No.(1 based) being capturing 

BOOL	WINAPI okStopCapture(HANDLE hBoard);
		//Stop capturing to or playback from SCREEN, BUFFER or other targets 
		//return target just captured to or from. 
		//if capturing to/from BUFFER or file, return the frame No.(1 based) being capturing 

long	WINAPI okGetSeqCapture(HANDLE hBoard, long start, long count);
		//get current frame no. of sequence capturing to buffer
		//start: set buffer no. to use, effecting only count==0
		//count: count no. to catpure
		//return frame no finished


//capture by to /from 
BOOL	WINAPI okCaptureByBuffer(HANDLE hBoard, TARGET dest, long start, long num);
		//capture sequence images to dest by way of two frame buffers (in BUFFER), 
		//the frame size and format is taken as same as current config of BUFFER
		//if dest is file name which can be .seq or .bmp (will generate multi bmp files)
		//dest can be also a user memory pointer or a BLOCKINFO pointer (with user memory pointer)
		//retrun true immediately if success. num should be great than 0

BOOL	WINAPI okCaptureByBufferEx(HANDLE hBoard, long fileset, TARGET dest, long start, long num);
		// all are same as okCaptureByBuffer except for fileset which is quality when to jpg file

		
BOOL	WINAPI okPlaybackByBuffer(HANDLE hBoard, TARGET src, long start, long num);
		//playback sequence images on monitor from src by way of two frame buffers (in BUFFER)
		//the size and format of BUFFER will be changed to same as src
		//src can be a file name which may be .seq or .bmp (first orderd bmp files) 
		////src can be also a BLOCKINFO pointer (with infos of user memory pointer,size and format)
		//if src is just user memory pointer, this function will think its block size and format 
		//are same as current config of BUFFER (in this case can not support loop function).
		//retrun true immediately if success 
		//if num is great than the true frame number in src, it will loop back
		//if num=-1 mean it will loop infinitely until call okStopCapture

//set and get params
long	WINAPI okSetVideoParam(HANDLE hBoard, WORD wParam, long lParam);
		//----set video param sub-function defines
		//set video param and return previous param; 
		//if input lParam=-1, just return previous param 			
		//if not support return -1, if error return -2 

long	WINAPI okSetCaptureParam(HANDLE hBoard, WORD wParam, long lParam);
		//set capture param and return previous param; 
		//if input lParam=-1, just return previous param 			
		//if not support return -1, if error return -2 


//transfer and convert rect
long	WINAPI	okReadPixel(HANDLE hBoard, TARGET src, long start, short x, short y);
		//read value of one pixel specified (x,y) in frame start of src (SCREEN, BUFFER, FRAME...)
		//return is this pixel value, it may be with bits 8,16,24,or 32 depend on the src's format

long	WINAPI	okWritePixel(HANDLE hBoard, TARGET tgt, long start, short x, short y, long lValue);
		//write value into specified (x,y) in the frame start of tgt (SCREEN, BUFFER, FRAME...)
		//

long	WINAPI okSetConvertParam(HANDLE hBoard, WORD wParam, long lParam);
		//set convert param for for function okConvertRect 
		//if not support return -1, if error return -2 

long	WINAPI okReadRect(HANDLE hBoard, TARGET src, long start, LPBYTE lpBuf);
		//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

long	WINAPI okWriteRect(HANDLE hBoard, TARGET dst, long 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, long 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, long 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, long iFirst, TARGET src, long 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, long first, TARGET src, long 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, long first, HANDLE hSrcBoard, TARGET src, long start, LPARAM no);
		//same as the above function okConvertRect except with src handle


BOOL	WINAPI okSetTextTo(HANDLE hBoard, TARGET target, LPRECT lpRect, LOGFONT *lfLogFont, SETTEXTMODE *textMode, LPSTR lpString, long lLength); 
		//set text into the image of specified target
		//target can be SCREEN, BUFFER, FRAME, also BLOCKINFO
		//lpRect: just use its (left,top) to points start posision
		//lfLogFont: windows font definition, see window's document
		//textMode: specify forecolor, backcolor and set mode
		//lpString, lLength: text string and it's length

long	WINAPI okDrawEllipsTo(HANDLE hBoard, TARGET target, long lStart, LPRECT lpRect, long iForeColor);
		//draw a ellips into specified target
		//target can be SCREEN, BUFFER, FRAME, also BLOCKINFO
		//lpRect: specify the rect region of expected ellips
		//iForeColor: draw value on to target
		//return the pixel count of ellips

HDC		WINAPI okCreateDCBitmap(HANDLE hBoard, TARGET target, HANDLE *hDCBitmap);
		//create a memory DC compatible with windows's GDI, draw graphic and text etc. with GDI functions
		//target can be SCREEN, BUFFER, FRAME, also BLOCKINFO
		//hDCBitmap: return a handle with which we can map the graphics on the memory DC
		//to our target.
		//return the memory DC with which you can use windows"s GDI functions

BOOL	WINAPI okMapDCBitmapTo(HANDLE hDCBitmap, long lStart);
		//map the graphics of memory DC created by okCreateDCBitmap into specified target
		//hDCBitmap: the handle created by okCreateDCBitmap

BOOL	WINAPI okFreeDCBitmap(HANDLE hDCBitmap);
		//free the allocated resource by okCreateDCBitmap
		//hDCBitmap: the handle created by okCreateDCBitmap



//get and put signals	
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

long	WINAPI okPutSignalParam(HANDLE hBoard, WPARAM wParam, LPARAM lParam);
		//put specified signal param  
		//if not support return -1, if error return -2, 


//treat callback functions
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


//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.

//load and save config files with all parameters
BOOL	WINAPI okSaveConfigFile(HANDLE hBoard, LPSTR szFileName);
		//save all current parameters set to specified config file (*.okf)

BOOL	WINAPI okLoadConfigFile(HANDLE hBoard, LPSTR szFileName);
		//load specified config file to set current all paramters



//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


//--2. special routines supported by some cards--------------

//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 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -