ホーム › Media.Multimedia › ICDecompress
ICDecompress
関数圧縮された映像フレームを伸張する。
シグネチャ
// MSVFW32.dll
#include <windows.h>
DWORD ICDecompress(
HIC hic,
DWORD dwFlags,
BITMAPINFOHEADER* lpbiFormat,
void* lpData,
BITMAPINFOHEADER* lpbi,
void* lpBits
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hic | HIC | in |
| dwFlags | DWORD | in |
| lpbiFormat | BITMAPINFOHEADER* | in |
| lpData | void* | in |
| lpbi | BITMAPINFOHEADER* | in |
| lpBits | void* | out |
戻り値の型: DWORD
各言語での呼び出し定義
// MSVFW32.dll
#include <windows.h>
DWORD ICDecompress(
HIC hic,
DWORD dwFlags,
BITMAPINFOHEADER* lpbiFormat,
void* lpData,
BITMAPINFOHEADER* lpbi,
void* lpBits
);[DllImport("MSVFW32.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern uint ICDecompress(
IntPtr hic, // HIC
uint dwFlags, // DWORD
IntPtr lpbiFormat, // BITMAPINFOHEADER*
IntPtr lpData, // void*
IntPtr lpbi, // BITMAPINFOHEADER*
IntPtr lpBits // void* out
);<DllImport("MSVFW32.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ICDecompress(
hic As IntPtr, ' HIC
dwFlags As UInteger, ' DWORD
lpbiFormat As IntPtr, ' BITMAPINFOHEADER*
lpData As IntPtr, ' void*
lpbi As IntPtr, ' BITMAPINFOHEADER*
lpBits As IntPtr ' void* out
) As UInteger
End Function' hic : HIC
' dwFlags : DWORD
' lpbiFormat : BITMAPINFOHEADER*
' lpData : void*
' lpbi : BITMAPINFOHEADER*
' lpBits : void* out
Declare PtrSafe Function ICDecompress Lib "msvfw32" ( _
ByVal hic As LongPtr, _
ByVal dwFlags As Long, _
ByVal lpbiFormat As LongPtr, _
ByVal lpData As LongPtr, _
ByVal lpbi As LongPtr, _
ByVal lpBits As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ICDecompress = ctypes.cdll.msvfw32.ICDecompress
ICDecompress.restype = wintypes.DWORD
ICDecompress.argtypes = [
wintypes.HANDLE, # hic : HIC
wintypes.DWORD, # dwFlags : DWORD
ctypes.c_void_p, # lpbiFormat : BITMAPINFOHEADER*
ctypes.POINTER(None), # lpData : void*
ctypes.c_void_p, # lpbi : BITMAPINFOHEADER*
ctypes.POINTER(None), # lpBits : void* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MSVFW32.dll')
ICDecompress = Fiddle::Function.new(
lib['ICDecompress'],
[
Fiddle::TYPE_VOIDP, # hic : HIC
-Fiddle::TYPE_INT, # dwFlags : DWORD
Fiddle::TYPE_VOIDP, # lpbiFormat : BITMAPINFOHEADER*
Fiddle::TYPE_VOIDP, # lpData : void*
Fiddle::TYPE_VOIDP, # lpbi : BITMAPINFOHEADER*
Fiddle::TYPE_VOIDP, # lpBits : void* out
],
-Fiddle::TYPE_INT, Fiddle::Function::CDECL)#[link(name = "msvfw32")]
extern "C" {
fn ICDecompress(
hic: *mut core::ffi::c_void, // HIC
dwFlags: u32, // DWORD
lpbiFormat: *mut BITMAPINFOHEADER, // BITMAPINFOHEADER*
lpData: *mut (), // void*
lpbi: *mut BITMAPINFOHEADER, // BITMAPINFOHEADER*
lpBits: *mut () // void* out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MSVFW32.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern uint ICDecompress(IntPtr hic, uint dwFlags, IntPtr lpbiFormat, IntPtr lpData, IntPtr lpbi, IntPtr lpBits);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSVFW32_ICDecompress' -Namespace Win32 -PassThru
# $api::ICDecompress(hic, dwFlags, lpbiFormat, lpData, lpbi, lpBits)#uselib "MSVFW32.dll"
#func global ICDecompress "ICDecompress" sptr, sptr, sptr, sptr, sptr, sptr
; ICDecompress hic, dwFlags, varptr(lpbiFormat), lpData, varptr(lpbi), lpBits ; 戻り値は stat
; hic : HIC -> "sptr"
; dwFlags : DWORD -> "sptr"
; lpbiFormat : BITMAPINFOHEADER* -> "sptr"
; lpData : void* -> "sptr"
; lpbi : BITMAPINFOHEADER* -> "sptr"
; lpBits : void* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "MSVFW32.dll" #cfunc global ICDecompress "ICDecompress" sptr, int, var, sptr, var, sptr ; res = ICDecompress(hic, dwFlags, lpbiFormat, lpData, lpbi, lpBits) ; hic : HIC -> "sptr" ; dwFlags : DWORD -> "int" ; lpbiFormat : BITMAPINFOHEADER* -> "var" ; lpData : void* -> "sptr" ; lpbi : BITMAPINFOHEADER* -> "var" ; lpBits : void* out -> "sptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "MSVFW32.dll" #cfunc global ICDecompress "ICDecompress" sptr, int, sptr, sptr, sptr, sptr ; res = ICDecompress(hic, dwFlags, varptr(lpbiFormat), lpData, varptr(lpbi), lpBits) ; hic : HIC -> "sptr" ; dwFlags : DWORD -> "int" ; lpbiFormat : BITMAPINFOHEADER* -> "sptr" ; lpData : void* -> "sptr" ; lpbi : BITMAPINFOHEADER* -> "sptr" ; lpBits : void* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD ICDecompress(HIC hic, DWORD dwFlags, BITMAPINFOHEADER* lpbiFormat, void* lpData, BITMAPINFOHEADER* lpbi, void* lpBits) #uselib "MSVFW32.dll" #cfunc global ICDecompress "ICDecompress" intptr, int, var, intptr, var, intptr ; res = ICDecompress(hic, dwFlags, lpbiFormat, lpData, lpbi, lpBits) ; hic : HIC -> "intptr" ; dwFlags : DWORD -> "int" ; lpbiFormat : BITMAPINFOHEADER* -> "var" ; lpData : void* -> "intptr" ; lpbi : BITMAPINFOHEADER* -> "var" ; lpBits : void* out -> "intptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD ICDecompress(HIC hic, DWORD dwFlags, BITMAPINFOHEADER* lpbiFormat, void* lpData, BITMAPINFOHEADER* lpbi, void* lpBits) #uselib "MSVFW32.dll" #cfunc global ICDecompress "ICDecompress" intptr, int, intptr, intptr, intptr, intptr ; res = ICDecompress(hic, dwFlags, varptr(lpbiFormat), lpData, varptr(lpbi), lpBits) ; hic : HIC -> "intptr" ; dwFlags : DWORD -> "int" ; lpbiFormat : BITMAPINFOHEADER* -> "intptr" ; lpData : void* -> "intptr" ; lpbi : BITMAPINFOHEADER* -> "intptr" ; lpBits : void* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msvfw32 = windows.NewLazySystemDLL("MSVFW32.dll")
procICDecompress = msvfw32.NewProc("ICDecompress")
)
// hic (HIC), dwFlags (DWORD), lpbiFormat (BITMAPINFOHEADER*), lpData (void*), lpbi (BITMAPINFOHEADER*), lpBits (void* out)
r1, _, err := procICDecompress.Call(
uintptr(hic),
uintptr(dwFlags),
uintptr(lpbiFormat),
uintptr(lpData),
uintptr(lpbi),
uintptr(lpBits),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction ICDecompress(
hic: THandle; // HIC
dwFlags: DWORD; // DWORD
lpbiFormat: Pointer; // BITMAPINFOHEADER*
lpData: Pointer; // void*
lpbi: Pointer; // BITMAPINFOHEADER*
lpBits: Pointer // void* out
): DWORD; cdecl;
external 'MSVFW32.dll' name 'ICDecompress';result := DllCall("MSVFW32\ICDecompress"
, "Ptr", hic ; HIC
, "UInt", dwFlags ; DWORD
, "Ptr", lpbiFormat ; BITMAPINFOHEADER*
, "Ptr", lpData ; void*
, "Ptr", lpbi ; BITMAPINFOHEADER*
, "Ptr", lpBits ; void* out
, "Cdecl UInt") ; return: DWORD●ICDecompress(hic, dwFlags, lpbiFormat, lpData, lpbi, lpBits) = DLL("MSVFW32.dll", "dword ICDecompress(void*, dword, void*, void*, void*, void*)")
# 呼び出し: ICDecompress(hic, dwFlags, lpbiFormat, lpData, lpbi, lpBits)
# hic : HIC -> "void*"
# dwFlags : DWORD -> "dword"
# lpbiFormat : BITMAPINFOHEADER* -> "void*"
# lpData : void* -> "void*"
# lpbi : BITMAPINFOHEADER* -> "void*"
# lpBits : void* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。