📄 vfw.pas
字号:
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 : PVOID ; // compressed data
lpbiOutput : PBITMAPINFOHEADER ; // DIB to decompress to
lpOutput : PVOID ;
ckid : DWORD ; // ckid from AVI file
end;
PICDECOMPRESSEX = ^TICDECOMPRESSEX;
TICDECOMPRESSEX = record
//
// same as ICM_DECOMPRESS
//
dwFlags : DWORD;
lpbiSrc : PBITMAPINFOHEADER; // BITMAPINFO of compressed data
lpSrc : PVOID; // compressed data
lpbiDst : PBITMAPINFOHEADER; // DIB to decompress to
lpDst : PVOID; // output data
//
// new for ICM_DECOMPRESSEX
//
xDst : int ; // destination rectangle
yDst : int ;
dxDst : int ;
dyDst : int ;
xSrc : int ; // source rectangle
ySrc : int ;
dxSrc : int ;
dySrc : int ;
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 : int ; // destination rectangle
yDst : int ;
dxDst : int ;
dyDst : int ;
lpbi : PBITMAPINFOHEADER ;
// format of frame to draw
xSrc : int ; // source rectangle
ySrc : int ;
dxSrc : int ;
dySrc : int ;
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 : PVOID ; // format of frame to decompress
lpData : PVOID ; // 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 : int ; // source extent or 0
dySrc : int ;
dxDst : int ; // dest extent or 0
dyDst : int ;
hicDecompressor : HIC ; // decompressor you can talk to
end;
{-----------------------------------------------------------------------------}
PICPALETTE = ^TICPALETTE;
TICPALETTE = record
dwFlags : DWORD ; // flags (from AVI index...)
iStart : int ; // first palette to change
iLen : int ; // 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: DWORD) : 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: PVOID; cb: DWORD): DWORD;
function ICSetState(hic: HIC; pv: PVOID; 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 : PVOID; // output data
lpbiInput : PBITMAPINFOHEADER; // format of frame to compress
lpBits : PVOID; // 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 : PVOID // 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 : PVOID; // data
lpbi : PBITMAPINFOHEADER; // DIB to decompress to
lpBits : PVOID
): 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 : PVOID;
xSrc : int;
ySrc : int;
dxSrc : int;
dySrc : int;
lpbiDst : PBITMAPINFOHEADER;
lpDst : PVOID;
xDst : int;
yDst : int;
dxDst : int;
dyDst : int
): DWORD; stdcall;
{-- ICDecompressExBegin() - start compression from a src fmt to a dest fmt ---}
function ICDecompressExBegin(
hic : HIC;
dwFlags : DWORD;
lpbiSrc : PBITMAPINFOHEADER;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -