Win32 API 日本語リファレンス
ホームMedia.MediaFoundation › MFVideoAlphaBitmapParams

MFVideoAlphaBitmapParams

構造体
サイズx64: 48 バイト / x86: 48 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
dwFlagsDWORD4+0+0どのパラメータが有効かを示すMFVideoAlphaBitmapFlagsビットフラグ。
clrSrcKeyCOLORREF4+4+4透過に用いるソースカラーキーを示すCOLORREF。
rcSrcRECT16+8+8ソースビットマップ内の使用矩形領域(RECT)。
nrcDestMFVideoNormalizedRect16+24+24出力先の正規化矩形領域(MFVideoNormalizedRect)。
fAlphaFLOAT4+40+40ビットマップ全体に適用するアルファ値(0.0〜1.0)。
dwFilterModeDWORD4+44+44拡大縮小時のフィルタモードを示す値。

各言語での定義

#include <windows.h>

// RECT  (x64 16 / x86 16 バイト)
typedef struct RECT {
    INT left;
    INT top;
    INT right;
    INT bottom;
} RECT;

// MFVideoNormalizedRect  (x64 16 / x86 16 バイト)
typedef struct MFVideoNormalizedRect {
    FLOAT left;
    FLOAT top;
    FLOAT right;
    FLOAT bottom;
} MFVideoNormalizedRect;

// MFVideoAlphaBitmapParams  (x64 48 / x86 48 バイト)
typedef struct MFVideoAlphaBitmapParams {
    DWORD dwFlags;
    COLORREF clrSrcKey;
    RECT rcSrc;
    MFVideoNormalizedRect nrcDest;
    FLOAT fAlpha;
    DWORD dwFilterMode;
} MFVideoAlphaBitmapParams;
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 MFVideoNormalizedRect
{
    public float left;
    public float top;
    public float right;
    public float bottom;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MFVideoAlphaBitmapParams
{
    public uint dwFlags;
    public uint clrSrcKey;
    public RECT rcSrc;
    public MFVideoNormalizedRect nrcDest;
    public float fAlpha;
    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 MFVideoNormalizedRect
    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 MFVideoAlphaBitmapParams
    Public dwFlags As UInteger
    Public clrSrcKey As UInteger
    Public rcSrc As RECT
    Public nrcDest As MFVideoNormalizedRect
    Public fAlpha As Single
    Public dwFilterMode As UInteger
End Structure
import 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 MFVideoNormalizedRect(ctypes.Structure):
    _fields_ = [
        ("left", ctypes.c_float),
        ("top", ctypes.c_float),
        ("right", ctypes.c_float),
        ("bottom", ctypes.c_float),
    ]

class MFVideoAlphaBitmapParams(ctypes.Structure):
    _fields_ = [
        ("dwFlags", wintypes.DWORD),
        ("clrSrcKey", wintypes.DWORD),
        ("rcSrc", RECT),
        ("nrcDest", MFVideoNormalizedRect),
        ("fAlpha", ctypes.c_float),
        ("dwFilterMode", wintypes.DWORD),
    ]
#[repr(C)]
pub struct RECT {
    pub left: i32,
    pub top: i32,
    pub right: i32,
    pub bottom: i32,
}

#[repr(C)]
pub struct MFVideoNormalizedRect {
    pub left: f32,
    pub top: f32,
    pub right: f32,
    pub bottom: f32,
}

#[repr(C)]
pub struct MFVideoAlphaBitmapParams {
    pub dwFlags: u32,
    pub clrSrcKey: u32,
    pub rcSrc: RECT,
    pub nrcDest: MFVideoNormalizedRect,
    pub fAlpha: f32,
    pub dwFilterMode: u32,
}
import "golang.org/x/sys/windows"

type RECT struct {
	left int32
	top int32
	right int32
	bottom int32
}

type MFVideoNormalizedRect struct {
	left float32
	top float32
	right float32
	bottom float32
}

type MFVideoAlphaBitmapParams struct {
	dwFlags uint32
	clrSrcKey uint32
	rcSrc RECT
	nrcDest MFVideoNormalizedRect
	fAlpha float32
	dwFilterMode uint32
}
type
  RECT = record
    left: Integer;
    top: Integer;
    right: Integer;
    bottom: Integer;
  end;

  MFVideoNormalizedRect = record
    left: Single;
    top: Single;
    right: Single;
    bottom: Single;
  end;

  MFVideoAlphaBitmapParams = record
    dwFlags: DWORD;
    clrSrcKey: DWORD;
    rcSrc: RECT;
    nrcDest: MFVideoNormalizedRect;
    fAlpha: Single;
    dwFilterMode: DWORD;
  end;
const RECT = extern struct {
    left: i32,
    top: i32,
    right: i32,
    bottom: i32,
};

const MFVideoNormalizedRect = extern struct {
    left: f32,
    top: f32,
    right: f32,
    bottom: f32,
};

const MFVideoAlphaBitmapParams = extern struct {
    dwFlags: u32,
    clrSrcKey: u32,
    rcSrc: RECT,
    nrcDest: MFVideoNormalizedRect,
    fAlpha: f32,
    dwFilterMode: u32,
};
type
  RECT {.bycopy.} = object
    left: int32
    top: int32
    right: int32
    bottom: int32

  MFVideoNormalizedRect {.bycopy.} = object
    left: float32
    top: float32
    right: float32
    bottom: float32

  MFVideoAlphaBitmapParams {.bycopy.} = object
    dwFlags: uint32
    clrSrcKey: uint32
    rcSrc: RECT
    nrcDest: MFVideoNormalizedRect
    fAlpha: float32
    dwFilterMode: uint32
struct RECT
{
    int left;
    int top;
    int right;
    int bottom;
}

struct MFVideoNormalizedRect
{
    float left;
    float top;
    float right;
    float bottom;
}

struct MFVideoAlphaBitmapParams
{
    uint dwFlags;
    uint clrSrcKey;
    RECT rcSrc;
    MFVideoNormalizedRect nrcDest;
    float fAlpha;
    uint dwFilterMode;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MFVideoAlphaBitmapParams サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; clrSrcKey : COLORREF (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; rcSrc : RECT (+8, 16byte)  varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; nrcDest : MFVideoNormalizedRect (+24, 16byte)  varptr(st)+24 を基点に操作(16byte:入れ子/配列)
; fAlpha : FLOAT (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; dwFilterMode : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (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 MFVideoNormalizedRect
    #field float left
    #field float top
    #field float right
    #field float bottom
#endstruct

#defstruct global MFVideoAlphaBitmapParams
    #field int dwFlags
    #field int clrSrcKey
    #field RECT rcSrc
    #field MFVideoNormalizedRect nrcDest
    #field float fAlpha
    #field int dwFilterMode
#endstruct

stdim st, MFVideoAlphaBitmapParams        ; NSTRUCT 変数を確保
st->dwFlags = 100
mes "dwFlags=" + st->dwFlags