ホーム › Media.Multimedia › ICCOMPRESSFRAMES
ICCOMPRESSFRAMES
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwFlags | DWORD | 4 | +0 | +0 | 複数フレーム圧縮を制御するフラグ。 |
| lpbiOutput | BITMAPINFOHEADER* | 8/4 | +8 | +4 | 出力(圧縮後)画像のBITMAPINFOHEADERへのポインタ。 |
| lOutput | LPARAM | 8/4 | +16 | +8 | 出力に関するユーザー定義値(LPARAM)。 |
| lpbiInput | BITMAPINFOHEADER* | 8/4 | +24 | +12 | 入力(圧縮前)画像のBITMAPINFOHEADERへのポインタ。 |
| lInput | LPARAM | 8/4 | +32 | +16 | 入力に関するユーザー定義値(LPARAM)。 |
| lStartFrame | INT | 4 | +40 | +20 | 圧縮する最初のフレーム番号。 |
| lFrameCount | INT | 4 | +44 | +24 | 圧縮するフレーム数。 |
| lQuality | INT | 4 | +48 | +28 | 圧縮品質。0〜10000の範囲で指定する。 |
| lDataRate | INT | 4 | +52 | +32 | 目標データレート。1秒あたりのバイト数を示す。 |
| lKeyRate | INT | 4 | +56 | +36 | キーフレームの間隔。何フレームごとにキーフレームを置くかを示す。 |
| dwRate | DWORD | 4 | +60 | +40 | フレームレートの分子。dwScaleとの比でレートを示す。 |
| dwScale | DWORD | 4 | +64 | +44 | フレームレートの分母。dwRateとの比でレートを示す。 |
| dwOverheadPerFrame | DWORD | 4 | +68 | +48 | フレームごとのオーバーヘッドバイト数。 |
| dwReserved2 | DWORD | 4 | +72 | +52 | 予約済みフィールド。将来の拡張用で通常はゼロ。 |
| GetData | INT_PTR | 8/4 | +80 | +56 | フレームデータ取得用コールバック関数へのポインタ(INT_PTR)。 |
| PutData | INT_PTR | 8/4 | +88 | +60 | 圧縮データ出力用コールバック関数へのポインタ(INT_PTR)。 |
各言語での定義
#include <windows.h>
// ICCOMPRESSFRAMES (x64 96 / x86 64 バイト)
typedef struct ICCOMPRESSFRAMES {
DWORD dwFlags;
BITMAPINFOHEADER* lpbiOutput;
LPARAM lOutput;
BITMAPINFOHEADER* lpbiInput;
LPARAM lInput;
INT lStartFrame;
INT lFrameCount;
INT lQuality;
INT lDataRate;
INT lKeyRate;
DWORD dwRate;
DWORD dwScale;
DWORD dwOverheadPerFrame;
DWORD dwReserved2;
INT_PTR GetData;
INT_PTR PutData;
} ICCOMPRESSFRAMES;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ICCOMPRESSFRAMES
{
public uint dwFlags;
public IntPtr lpbiOutput;
public IntPtr lOutput;
public IntPtr lpbiInput;
public IntPtr lInput;
public int lStartFrame;
public int lFrameCount;
public int lQuality;
public int lDataRate;
public int lKeyRate;
public uint dwRate;
public uint dwScale;
public uint dwOverheadPerFrame;
public uint dwReserved2;
public IntPtr GetData;
public IntPtr PutData;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ICCOMPRESSFRAMES
Public dwFlags As UInteger
Public lpbiOutput As IntPtr
Public lOutput As IntPtr
Public lpbiInput As IntPtr
Public lInput As IntPtr
Public lStartFrame As Integer
Public lFrameCount As Integer
Public lQuality As Integer
Public lDataRate As Integer
Public lKeyRate As Integer
Public dwRate As UInteger
Public dwScale As UInteger
Public dwOverheadPerFrame As UInteger
Public dwReserved2 As UInteger
Public GetData As IntPtr
Public PutData As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class ICCOMPRESSFRAMES(ctypes.Structure):
_fields_ = [
("dwFlags", wintypes.DWORD),
("lpbiOutput", ctypes.c_void_p),
("lOutput", ctypes.c_ssize_t),
("lpbiInput", ctypes.c_void_p),
("lInput", ctypes.c_ssize_t),
("lStartFrame", ctypes.c_int),
("lFrameCount", ctypes.c_int),
("lQuality", ctypes.c_int),
("lDataRate", ctypes.c_int),
("lKeyRate", ctypes.c_int),
("dwRate", wintypes.DWORD),
("dwScale", wintypes.DWORD),
("dwOverheadPerFrame", wintypes.DWORD),
("dwReserved2", wintypes.DWORD),
("GetData", ctypes.c_ssize_t),
("PutData", ctypes.c_ssize_t),
]#[repr(C)]
pub struct ICCOMPRESSFRAMES {
pub dwFlags: u32,
pub lpbiOutput: *mut core::ffi::c_void,
pub lOutput: isize,
pub lpbiInput: *mut core::ffi::c_void,
pub lInput: isize,
pub lStartFrame: i32,
pub lFrameCount: i32,
pub lQuality: i32,
pub lDataRate: i32,
pub lKeyRate: i32,
pub dwRate: u32,
pub dwScale: u32,
pub dwOverheadPerFrame: u32,
pub dwReserved2: u32,
pub GetData: isize,
pub PutData: isize,
}import "golang.org/x/sys/windows"
type ICCOMPRESSFRAMES struct {
dwFlags uint32
lpbiOutput uintptr
lOutput uintptr
lpbiInput uintptr
lInput uintptr
lStartFrame int32
lFrameCount int32
lQuality int32
lDataRate int32
lKeyRate int32
dwRate uint32
dwScale uint32
dwOverheadPerFrame uint32
dwReserved2 uint32
GetData uintptr
PutData uintptr
}type
ICCOMPRESSFRAMES = record
dwFlags: DWORD;
lpbiOutput: Pointer;
lOutput: NativeInt;
lpbiInput: Pointer;
lInput: NativeInt;
lStartFrame: Integer;
lFrameCount: Integer;
lQuality: Integer;
lDataRate: Integer;
lKeyRate: Integer;
dwRate: DWORD;
dwScale: DWORD;
dwOverheadPerFrame: DWORD;
dwReserved2: DWORD;
GetData: NativeInt;
PutData: NativeInt;
end;const ICCOMPRESSFRAMES = extern struct {
dwFlags: u32,
lpbiOutput: ?*anyopaque,
lOutput: isize,
lpbiInput: ?*anyopaque,
lInput: isize,
lStartFrame: i32,
lFrameCount: i32,
lQuality: i32,
lDataRate: i32,
lKeyRate: i32,
dwRate: u32,
dwScale: u32,
dwOverheadPerFrame: u32,
dwReserved2: u32,
GetData: isize,
PutData: isize,
};type
ICCOMPRESSFRAMES {.bycopy.} = object
dwFlags: uint32
lpbiOutput: pointer
lOutput: int
lpbiInput: pointer
lInput: int
lStartFrame: int32
lFrameCount: int32
lQuality: int32
lDataRate: int32
lKeyRate: int32
dwRate: uint32
dwScale: uint32
dwOverheadPerFrame: uint32
dwReserved2: uint32
GetData: int
PutData: intstruct ICCOMPRESSFRAMES
{
uint dwFlags;
void* lpbiOutput;
ptrdiff_t lOutput;
void* lpbiInput;
ptrdiff_t lInput;
int lStartFrame;
int lFrameCount;
int lQuality;
int lDataRate;
int lKeyRate;
uint dwRate;
uint dwScale;
uint dwOverheadPerFrame;
uint dwReserved2;
ptrdiff_t GetData;
ptrdiff_t PutData;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; ICCOMPRESSFRAMES サイズ: 64 バイト(x86)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpbiOutput : BITMAPINFOHEADER* (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; lOutput : LPARAM (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; lpbiInput : BITMAPINFOHEADER* (+12, 4byte) varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; lInput : LPARAM (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; lStartFrame : INT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; lFrameCount : INT (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; lQuality : INT (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; lDataRate : INT (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; lKeyRate : INT (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; dwRate : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; dwScale : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; dwOverheadPerFrame : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; dwReserved2 : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; GetData : INT_PTR (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; PutData : INT_PTR (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ICCOMPRESSFRAMES サイズ: 96 バイト(x64)
dim st, 24 ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpbiOutput : BITMAPINFOHEADER* (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; lOutput : LPARAM (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; lpbiInput : BITMAPINFOHEADER* (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; lInput : LPARAM (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; lStartFrame : INT (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; lFrameCount : INT (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; lQuality : INT (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; lDataRate : INT (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; lKeyRate : INT (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; dwRate : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; dwScale : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; dwOverheadPerFrame : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; dwReserved2 : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; GetData : INT_PTR (+80, 8byte) qpoke st,80,値 / qpeek(st,80) ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; PutData : INT_PTR (+88, 8byte) qpoke st,88,値 / qpeek(st,88) ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global ICCOMPRESSFRAMES
#field int dwFlags
#field intptr lpbiOutput
#field intptr lOutput
#field intptr lpbiInput
#field intptr lInput
#field int lStartFrame
#field int lFrameCount
#field int lQuality
#field int lDataRate
#field int lKeyRate
#field int dwRate
#field int dwScale
#field int dwOverheadPerFrame
#field int dwReserved2
#field intptr GetData
#field intptr PutData
#endstruct
stdim st, ICCOMPRESSFRAMES ; NSTRUCT 変数を確保
st->dwFlags = 100
mes "dwFlags=" + st->dwFlags