ホーム › Media.DirectShow › VMR9AlphaBitmap
VMR9AlphaBitmap
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwFlags | DWORD | 4 | +0 | +0 | アルファビットマップの設定フラグ(VMR9AlphaBitmapFlags)。 |
| hdc | HDC | 8/4 | +8 | +4 | ビットマップ取得元のデバイスコンテキスト(HDC)。 |
| pDDS | IDirect3DSurface9* | 8/4 | +16 | +8 | ビットマップ取得元のDirect3D9サーフェスへのポインタ。 |
| rSrc | RECT | 16 | +24 | +12 | ソースビットマップから切り出す矩形領域(RECT)。 |
| rDest | VMR9NormalizedRect | 16 | +40 | +28 | 合成先の正規化矩形(VMR9NormalizedRect)。 |
| fAlpha | FLOAT | 4 | +56 | +44 | 全体に適用する透明度(アルファ)値。0.0~1.0。 |
| clrSrcKey | COLORREF | 4 | +60 | +48 | 透過色キー(COLORREF)。一致色を透明として扱う。 |
| dwFilterMode | DWORD | 4 | +64 | +52 | ビットマップ拡縮時のフィルタモードを示す値。 |
各言語での定義
#include <windows.h>
// RECT (x64 16 / x86 16 バイト)
typedef struct RECT {
INT left;
INT top;
INT right;
INT bottom;
} RECT;
// VMR9NormalizedRect (x64 16 / x86 16 バイト)
typedef struct VMR9NormalizedRect {
FLOAT left;
FLOAT top;
FLOAT right;
FLOAT bottom;
} VMR9NormalizedRect;
// VMR9AlphaBitmap (x64 72 / x86 56 バイト)
typedef struct VMR9AlphaBitmap {
DWORD dwFlags;
HDC hdc;
IDirect3DSurface9* pDDS;
RECT rSrc;
VMR9NormalizedRect rDest;
FLOAT fAlpha;
COLORREF clrSrcKey;
DWORD dwFilterMode;
} VMR9AlphaBitmap;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VMR9NormalizedRect
{
public float left;
public float top;
public float right;
public float bottom;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VMR9AlphaBitmap
{
public uint dwFlags;
public IntPtr hdc;
public IntPtr pDDS;
public RECT rSrc;
public VMR9NormalizedRect rDest;
public float fAlpha;
public uint clrSrcKey;
public uint dwFilterMode;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RECT
Public left As Integer
Public top As Integer
Public right As Integer
Public bottom As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VMR9NormalizedRect
Public left As Single
Public top As Single
Public right As Single
Public bottom As Single
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VMR9AlphaBitmap
Public dwFlags As UInteger
Public hdc As IntPtr
Public pDDS As IntPtr
Public rSrc As RECT
Public rDest As VMR9NormalizedRect
Public fAlpha As Single
Public clrSrcKey As UInteger
Public dwFilterMode As UInteger
End Structureimport ctypes
from ctypes import wintypes
class RECT(ctypes.Structure):
_fields_ = [
("left", ctypes.c_int),
("top", ctypes.c_int),
("right", ctypes.c_int),
("bottom", ctypes.c_int),
]
class VMR9NormalizedRect(ctypes.Structure):
_fields_ = [
("left", ctypes.c_float),
("top", ctypes.c_float),
("right", ctypes.c_float),
("bottom", ctypes.c_float),
]
class VMR9AlphaBitmap(ctypes.Structure):
_fields_ = [
("dwFlags", wintypes.DWORD),
("hdc", ctypes.c_void_p),
("pDDS", ctypes.c_void_p),
("rSrc", RECT),
("rDest", VMR9NormalizedRect),
("fAlpha", ctypes.c_float),
("clrSrcKey", wintypes.DWORD),
("dwFilterMode", wintypes.DWORD),
]#[repr(C)]
pub struct RECT {
pub left: i32,
pub top: i32,
pub right: i32,
pub bottom: i32,
}
#[repr(C)]
pub struct VMR9NormalizedRect {
pub left: f32,
pub top: f32,
pub right: f32,
pub bottom: f32,
}
#[repr(C)]
pub struct VMR9AlphaBitmap {
pub dwFlags: u32,
pub hdc: *mut core::ffi::c_void,
pub pDDS: *mut core::ffi::c_void,
pub rSrc: RECT,
pub rDest: VMR9NormalizedRect,
pub fAlpha: f32,
pub clrSrcKey: u32,
pub dwFilterMode: u32,
}import "golang.org/x/sys/windows"
type RECT struct {
left int32
top int32
right int32
bottom int32
}
type VMR9NormalizedRect struct {
left float32
top float32
right float32
bottom float32
}
type VMR9AlphaBitmap struct {
dwFlags uint32
hdc uintptr
pDDS uintptr
rSrc RECT
rDest VMR9NormalizedRect
fAlpha float32
clrSrcKey uint32
dwFilterMode uint32
}type
RECT = record
left: Integer;
top: Integer;
right: Integer;
bottom: Integer;
end;
VMR9NormalizedRect = record
left: Single;
top: Single;
right: Single;
bottom: Single;
end;
VMR9AlphaBitmap = record
dwFlags: DWORD;
hdc: Pointer;
pDDS: Pointer;
rSrc: RECT;
rDest: VMR9NormalizedRect;
fAlpha: Single;
clrSrcKey: DWORD;
dwFilterMode: DWORD;
end;const RECT = extern struct {
left: i32,
top: i32,
right: i32,
bottom: i32,
};
const VMR9NormalizedRect = extern struct {
left: f32,
top: f32,
right: f32,
bottom: f32,
};
const VMR9AlphaBitmap = extern struct {
dwFlags: u32,
hdc: ?*anyopaque,
pDDS: ?*anyopaque,
rSrc: RECT,
rDest: VMR9NormalizedRect,
fAlpha: f32,
clrSrcKey: u32,
dwFilterMode: u32,
};type
RECT {.bycopy.} = object
left: int32
top: int32
right: int32
bottom: int32
VMR9NormalizedRect {.bycopy.} = object
left: float32
top: float32
right: float32
bottom: float32
VMR9AlphaBitmap {.bycopy.} = object
dwFlags: uint32
hdc: pointer
pDDS: pointer
rSrc: RECT
rDest: VMR9NormalizedRect
fAlpha: float32
clrSrcKey: uint32
dwFilterMode: uint32struct RECT
{
int left;
int top;
int right;
int bottom;
}
struct VMR9NormalizedRect
{
float left;
float top;
float right;
float bottom;
}
struct VMR9AlphaBitmap
{
uint dwFlags;
void* hdc;
void* pDDS;
RECT rSrc;
VMR9NormalizedRect rDest;
float fAlpha;
uint clrSrcKey;
uint dwFilterMode;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; VMR9AlphaBitmap サイズ: 56 バイト(x86)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hdc : HDC (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pDDS : IDirect3DSurface9* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; rSrc : RECT (+12, 16byte) varptr(st)+12 を基点に操作(16byte:入れ子/配列)
; rDest : VMR9NormalizedRect (+28, 16byte) varptr(st)+28 を基点に操作(16byte:入れ子/配列)
; fAlpha : FLOAT (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; clrSrcKey : COLORREF (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; dwFilterMode : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VMR9AlphaBitmap サイズ: 72 バイト(x64)
dim st, 18 ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hdc : HDC (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pDDS : IDirect3DSurface9* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; rSrc : RECT (+24, 16byte) varptr(st)+24 を基点に操作(16byte:入れ子/配列)
; rDest : VMR9NormalizedRect (+40, 16byte) varptr(st)+40 を基点に操作(16byte:入れ子/配列)
; fAlpha : FLOAT (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; clrSrcKey : COLORREF (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; dwFilterMode : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global RECT
#field int left
#field int top
#field int right
#field int bottom
#endstruct
#defstruct global VMR9NormalizedRect
#field float left
#field float top
#field float right
#field float bottom
#endstruct
#defstruct global VMR9AlphaBitmap
#field int dwFlags
#field intptr hdc
#field intptr pDDS
#field RECT rSrc
#field VMR9NormalizedRect rDest
#field float fAlpha
#field int clrSrcKey
#field int dwFilterMode
#endstruct
stdim st, VMR9AlphaBitmap ; NSTRUCT 変数を確保
st->dwFlags = 100
mes "dwFlags=" + st->dwFlags