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

📄 okapi32.h

📁 OK视频采集卡VC源代码
💻 H
📖 第 1 页 / 共 4 页
字号:
BOOL	WINAPI okCaptureSingle(HANDLE hBoard, TARGET Dest, LONG lStart);
		//capture video source to target which can be BUFFER, SCREEN, FRAME, MONITOR 
		//start(o based).if success return 1, if failed return 0, if not support target -1
		//when this function sent command to grabber, then return immediately not wait to finish.
		//this function same as okCaptureTo(hBoard, Dest, wParam, 1);

BOOL	WINAPI okCaptureActive(HANDLE hBoard, TARGET Dest, LONG lStart);
		//capture continuous active video to same position in target which can be BUFFER, SCREEN, FRAME, MONITOR 
		//start(o based).if success return 1, if failed return 0, if not support target -1
		//when this function sent continuous command to grabber, then return immediately
		//but note that some card like RGB30. when target is SCREEN, this function is a thread.
		//this function same as okCaptureTo(hBoard, Dest, wParam, 0);

BOOL	WINAPI okCaptureThread(HANDLE hBoard, TARGET Dest, LONG lStart, LPARAM lNoFrame);
		//capture sequencely video to target which can be BUFFER, SCREEN, FRAME, MONITOR 
		//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)
		//if lParam=-N mean it loop in buffer of N frame infinitely until call okStopCapture, 
		//when -1 mean loop in all buffer.
		//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 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


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




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

//set out LUT:
long	WINAPI okFillOutLUT(HANDLE hBoard,  LPBYTE bLUT, short start, short num);
		//fill specified playback out LUT. 
		//bLut stored values(which may be 8 or 10, 12 bits data) to fill, (r0,g0,b0, r1,g1,b1 ...)
		//if bLut==NULL, just used to return bits of lut by this hardware. 
		//if >8 bits bLut must be used word not byte 
		//start: offset pos in LUT(based 0), num: num items to fill
		//if not support return -1.

//set input LUT:
long	WINAPI okFillInputLUT(HANDLE hBoard,  LPBYTE bLUT, short start, short num);
		//fill specified input LUT. 
		//bLut stored values (which may be 8 or 10, 12 bits data) to fill, (r0,g0,b0, r1,g1,b1 ...)
		//start: offset pos in LUT(based 0), num: num items to fill
		//if bLut==NULL, just used to return bits of lut by this hardware. 
		//if >8 bits bLut must be used word not byte 
		//start: offset pos in LUT(based 0), num: num items to fill
		//if not support return -1.

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

//
long	WINAPI okSetDriverParam(long lWhich, long lParam); 
		//lWhich defined as the follow
#define		STATICVXD		1
#define		INSTNTDRV		2
#define		ALLOCBUFFER		3
#define		MEMBLOCKSIZE	4
#define		MEMBLOCKCOUNT	5
#define		UNREGISTER		6


//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); //just for win95/98
		//lMode=0: check if static vxd registered.
		//=1: create static vxd register
		//=2: delete static vxd register

BOOL	WINAPI okSetNTDriver(BOOL bCmd);	//just for winNT/2K
		//bCmd=0: check if nt driver installed.
		//=1: install nt driver
		//=2: remove nt driver

BOOL	WINAPI okUnRegister(DWORD dwCmd);
		//uninstall all registered and generated infos

long	WINAPI	okGetProgramInfo(int iItem, LPSTR lpString, int iSize);
		//get program info
#define	PROGRAM		1
#define	VERSION		2
#define	PREFIX		3
#define	COMPANY		4
#define	TELFAX		5
#define	WEBEMAIL	6

long	WINAPI okSetLangResource(long langcode); //1252 for English, 936 for Simple Chinese



//--3. multi cards, channels, memories --------------

//multi cards access:
long	WINAPI okGetImageDevice(OKDEVTYPE **lpOkDevInfo, LPARAM lParam);
		//Query all Ok series Image devices available in PCI bus, USB, ... return total number
		//lParam should be 0

⌨️ 快捷键说明

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