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

📄 vfw.pas

📁 制作摄相头的。网上下的
💻 PAS
📖 第 1 页 / 共 5 页
字号:
ICCOMPRESSFRAMES_PADDING = $00000001 ;

type
TICCompressProc = function(lInput: LPARAM; lFrame: DWORD; lpBits: Pointer; len: DWORD): DWORD; stdcall;

PICCOMPRESSFRAMES = ^TICCOMPRESSFRAMES;
TICCOMPRESSFRAMES = record
dwFlags : DWORD ; // flags

lpbiOutput : PBITMAPINFOHEADER ; // output format
lOutput : LPARAM ; // output identifier

lpbiInput : PBITMAPINFOHEADER ; // format of frame to compress
lInput : LPARAM ; // input identifier

lStartFrame : DWORD ; // start frame
lFrameCount : DWORD ; // # of frames

lQuality : DWORD ; // quality
lDataRate : DWORD ; // data rate
lKeyRate : DWORD ; // key frame rate

dwRate : DWORD ; // frame rate, as always
dwScale : DWORD ;

dwOverheadPerFrame : DWORD ;
dwReserved2 : DWORD ;

GetData : TICCompressProc;
PutData : TICCompressProc;
end;

{-- Messages for Status callback ---------------------------------------------}

const
ICSTATUS_START = 0 ;
ICSTATUS_STATUS = 1 ; // l = % done
ICSTATUS_END = 2 ;
ICSTATUS_ERROR = 3 ; // l = error string (LPSTR)
ICSTATUS_YIELD = 4 ;

type 
// return nonzero means abort operation in progress
TICStatusProc = function(lParam: LPARAM; message: UINT; l: DWORD): DWORD; stdcall;

PICSETSTATUSPROC = ^TICSETSTATUSPROC;
TICSETSTATUSPROC = record
dwFlags : DWORD ;
lParam : LPARAM ;
Status : TICStatusProc;
end;

{-----------------------------------------------------------------------------}

const
ICDECOMPRESS_HURRYUP = $80000000 ; // don't draw just buffer (hurry up!)
ICDECOMPRESS_UPDATE = $40000000 ; // don't draw just update screen
ICDECOMPRESS_PREROLL = $20000000 ; // this frame is before real start
ICDECOMPRESS_NULLFRAME = $10000000 ; // repeat last frame
ICDECOMPRESS_NOTKEYFRAME = $08000000 ; // this frame is not a key frame

type
PICDECOMPRESS = ^TICDECOMPRESS;
TICDECOMPRESS = record
dwFlags : DWORD ; // flags (from AVI index...)
lpbiInput : PBITMAPINFOHEADER ; // BITMAPINFO of compressed data
// biSizeImage has the chunk size
lpInput : Pointer ; // compressed data
lpbiOutput : PBITMAPINFOHEADER ; // DIB to decompress to
lpOutput : Pointer ;
ckid : DWORD ; // ckid from AVI file
end;

PICDECOMPRESSEX = ^TICDECOMPRESSEX;
TICDECOMPRESSEX = record

//
// same as ICM_DECOMPRESS
//

dwFlags : DWORD;
lpbiSrc : PBITMAPINFOHEADER; // BITMAPINFO of compressed data
lpSrc : Pointer; // compressed data
lpbiDst : PBITMAPINFOHEADER; // DIB to decompress to
lpDst : Pointer; // output data

//
// new for ICM_DECOMPRESSEX
//

xDst : integer ; // destination rectangle
yDst : integer ;
dxDst : integer ;
dyDst : integer ;

xSrc : integer ; // source rectangle
ySrc : integer ;
dxSrc : integer ;
dySrc : integer ;
end;

{-----------------------------------------------------------------------------}

const
ICDRAW_QUERY = $00000001 ; // test for support
ICDRAW_FULLSCREEN = $00000002 ; // draw to full screen
ICDRAW_HDC = $00000004 ; // draw to a HDC/HWND
ICDRAW_ANIMATE = $00000008 ; // expect palette animation
ICDRAW_CONTINUE = $00000010 ; // draw is a continuation of previous draw
ICDRAW_MEMORYDC = $00000020 ; // DC is offscreen, by the way
ICDRAW_UPDATING = $00000040 ; // We're updating, as opposed to playing
ICDRAW_RENDER = $00000080 ; // used to render data not draw it
ICDRAW_BUFFER = $00000100 ; // please buffer this data offscreen, we will need to update it

type
PICDRAWBEGIN = ^TICDRAWBEGIN;
TICDRAWBEGIN = record
dwFlags : DWORD ; // flags

hpal : HPALETTE ; // palette to draw with
hwnd : HWND ; // window to draw to
hdc : HDC ; // HDC to draw to

xDst : integer ; // destination rectangle
yDst : integer ;
dxDst : integer ;
dyDst : integer ;

lpbi : PBITMAPINFOHEADER ;
// format of frame to draw

xSrc : integer ; // source rectangle
ySrc : integer ;
dxSrc : integer ;
dySrc : integer ;

dwRate : DWORD ; // frames/second = (dwRate/dwScale)
dwScale : DWORD ;
end;

{-----------------------------------------------------------------------------}

const
ICDRAW_HURRYUP = $80000000 ; // don't draw just buffer (hurry up!)
ICDRAW_UPDATE = $40000000 ; // don't draw just update screen
ICDRAW_PREROLL = $20000000 ; // this frame is before real start
ICDRAW_NULLFRAME = $10000000 ; // repeat last frame
ICDRAW_NOTKEYFRAME = $08000000 ; // this frame is not a key frame

type
PICDRAW = ^TICDRAW;
TICDRAW = record
dwFlags : DWORD ; // flags
lpFormat : Pointer ; // format of frame to decompress
lpData : Pointer ; // frame data to decompress
cbData : DWORD ;
lTime : DWORD ; // time in drawbegin units (see dwRate and dwScale)
end;

PICDRAWSUGGEST = ^TICDRAWSUGGEST;
TICDRAWSUGGEST = record
lpbiIn : PBITMAPINFOHEADER ; // format to be drawn
lpbiSuggest : PBITMAPINFOHEADER ; // location for suggested format (or NULL to get size)
dxSrc : integer ; // source extent or 0
dySrc : integer ;
dxDst : integer ; // dest extent or 0
dyDst : integer ;
hicDecompressor : HIC ; // decompressor you can talk to
end;

{-----------------------------------------------------------------------------}

PICPALETTE = ^TICPALETTE;
TICPALETTE = record
dwFlags : DWORD ; // flags (from AVI index...)
iStart : integer ; // first palette to change
iLen : integer ; // count of entries to change.
lppe : PPALETTEENTRY ; // palette
end;

{-- ICM function declarations ------------------------------------------------}

function ICInfo(fccType, fccHandler: DWORD; lpicinfo: PICINFO) : BOOL ; stdcall ;
function ICInstall(fccType, fccHandler: DWORD; lParam: LPARAM; szDesc: LPSTR; wFlags: UINT) : BOOL ; stdcall ;
function ICRemove(fccType, fccHandler: DWORD; wFlags: UINT) : BOOL ; stdcall ;
function ICGetInfo(hic: HIC; picinfo: PICINFO; cb: DWORD) : DWORD ; stdcall ;

function ICOpen(fccType, fccHandler: DWORD; wMode: UINT) : HIC ; stdcall ;
function ICOpenFunction(fccType, fccHandler: DWORD; wMode: UINT; lpfnHandler: TFarProc) : HIC ; stdcall ;
function ICClose(hic: HIC) : DWORD; stdcall ;

function ICSendMessage(hic: HIC; msg: UINT; dw1, dw2: integer) : DWORD ; stdcall ;

{-- Values for wFlags of ICInstall -------------------------------------------}

const
ICINSTALL_UNICODE = $8000 ;

ICINSTALL_FUNCTION = $0001 ; // lParam is a DriverProc (function ptr)
ICINSTALL_DRIVER = $0002 ; // lParam is a driver name (string)
ICINSTALL_HDRV = $0004 ; // lParam is a HDRVR (driver handle)

ICINSTALL_DRIVERW = $8002 ; // lParam is a unicode driver name

{-- Query macros -------------------------------------------------------------}

ICMF_CONFIGURE_QUERY = $00000001 ;
ICMF_ABOUT_QUERY = $00000001 ;

function ICQueryAbout(hic: HIC): BOOL;
function ICAbout(hic: HIC; hwnd: HWND): DWORD;
function ICQueryConfigure(hic: HIC): BOOL;
function ICConfigure(hic: HIC; hwnd: HWND): DWORD;

{-- Get/Set state macros -----------------------------------------------------}

function ICGetState(hic: HIC; pv: Pointer; cb: DWORD): DWORD;
function ICSetState(hic: HIC; pv: Pointer; cb: DWORD): DWORD;
function ICGetStateSize(hic: HIC): DWORD;

{-- Get value macros ---------------------------------------------------------}

function ICGetDefaultQuality(hic: HIC): DWORD;
function ICGetDefaultKeyFrameRate(hic: HIC): DWORD;

{-- Draw window macro --------------------------------------------------------}

function ICDrawWindow(hic: HIC; prc: PRECT): DWORD;

{== Compression functions ====================================================}

{-- ICCompress() - compress a single frame -----------------------------------}

function ICCompress(
hic : HIC;
dwFlags : DWORD; // flags
lpbiOutput : PBITMAPINFOHEADER; // output format
lpData : Pointer; // output data
lpbiInput : PBITMAPINFOHEADER; // format of frame to compress
lpBits : Pointer; // frame data to compress
lpckid : PDWORD; // ckid for data in AVI file
lpdwFlags : PDWORD; // flags in the AVI index.
lFrameNum : DWORD; // frame number of seq.
dwFrameSize : DWORD; // reqested size in bytes. (if non zero)
dwQuality : DWORD; // quality within one frame
lpbiPrev : PBITMAPINFOHEADER; // format of previous frame
lpPrev : Pointer // previous frame
) : DWORD; cdecl;

{-- ICCompressBegin() - start compression from a source fmt to a dest fmt ----}

function ICCompressBegin(hic: HIC; lpbiInput: PBITMAPINFOHEADER; lpbiOutput: PBITMAPINFOHEADER): DWORD;

{-- ICCompressQuery() - determines if compression from src to dst is supp ----}

function ICCompressQuery(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;

{-- ICCompressGetFormat() - get the output format (fmt of compressed) --------}

// if lpbiOutput is nil return the size in bytes needed for format.

function ICCompressGetFormat(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
function ICCompressGetFormatSize(hic: HIC; lpbi: PBITMAPINFOHEADER): DWORD;

{-- ICCompressSize() - return the maximal size of a compressed frame ---------}

function ICCompressGetSize(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
function ICCompressEnd(hic: HIC): DWORD;

{== Decompression functions ==================================================}

{-- ICDecompress() - decompress a single frame -------------------------------}

function ICDecompress(
hic : HIC;
dwFlags : DWORD; // flags (from AVI index...)
lpbiFormat : PBITMAPINFOHEADER; // BITMAPINFO of compressed data
// biSizeImage has the chunk size
lpData : Pointer; // data
lpbi : PBITMAPINFOHEADER; // DIB to decompress to
lpBits : Pointer
): DWORD; cdecl;

{-- ICDecompressBegin() - start compression from src fmt to a dest fmt -------}

function ICDecompressBegin(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;

{-- ICDecompressQuery() - determines if compression is supported -------------}

function ICDecompressQuery(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;

{-- ICDecompressGetFormat - get the output fmt (fmt of uncompressed data) ----}

// if lpbiOutput is NULL return the size in bytes needed for format.

function ICDecompressGetFormat(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
function ICDecompressGetFormatSize(hic: HIC; lpbi: PBITMAPINFOHEADER): DWORD;

{-- ICDecompressGetPalette() - get the output palette ------------------------}

function ICDecompressGetPalette(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
function ICDecompressSetPalette(hic: HIC; lpbiPalette: PBITMAPINFOHEADER): DWORD;

function ICDecompressEnd(hic: HIC): DWORD;

{== Decompression(ex) functions ==============================================}

//
// on Win16 these functions are macros that call ICMessage. ICMessage will
// not work on NT. rather than add new entrypoints we have given
// them as static inline functions
//

{-- ICDecompressEx() - decompress a single frame -----------------------------}

function ICDecompressEx(
hic : HIC;
dwFlags : DWORD;
lpbiSrc : PBITMAPINFOHEADER;
lpSrc : Pointer;
xSrc : integer;
ySrc : integer;
dxSrc : integer;
dySrc : integer;
lpbiDst : PBITMAPINFOHEADER;
lpDst : Pointer;
xDst : integer;
yDst : integer;
dxDst : integer;
dyDst : integer
): DWORD; stdcall;

{-- ICDecompressExBegin() - start compression from a src fmt to a dest fmt ---}

function ICDecompressExBegin(
hic : HIC;
dwFlags : DWORD;
lpbiSrc : PBITMAPINFOHEADER;
lpSrc : Pointer;
xSrc : integer;
ySrc : integer;
dxSrc : integer;
dySrc : integer;
lpbiDst : PBITMAPINFOHEADER;
lpDst : Pointer;
xDst : integer;
yDst : integer;
dxDst : integer;
dyDst : integer
): DWORD; stdcall;

{-- ICDecompressExQuery() ----------------------------------------------------}

function ICDecompressExQuery(
hic : HIC;
dwFlags : DWORD;
lpbiSrc : PBITMAPINFOHEADER;
lpSrc : Pointer;
xSrc : integer;
ySrc : integer;
dxSrc : integer;
dySrc : integer;
lpbiDst : PBITMAPINFOHEADER;
lpDst : Pointer;
xDst : integer;
yDst : integer;
dxDst : integer;
dyDst : integer

⌨️ 快捷键说明

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