ホーム › Media.MediaFoundation › DXVA_ProcAmpControlBlt
DXVA_ProcAmpControlBlt
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Size | DWORD | 4 | +0 | +0 | 本構造体のバイトサイズを示す。バージョン判定に用いる。 |
| DstRect | RECT | 16 | +4 | +4 | 出力先の矩形領域である。 |
| SrcRect | RECT | 16 | +20 | +20 | ソースの処理対象矩形領域である。 |
| Alpha | FLOAT | 4 | +36 | +36 | 出力に適用する全体の不透明度(0.0〜1.0)を示す。 |
| Brightness | FLOAT | 4 | +40 | +40 | 輝度(明るさ)調整値を示す。 |
| Contrast | FLOAT | 4 | +44 | +44 | コントラスト調整値を示す。 |
| Hue | FLOAT | 4 | +48 | +48 | 色相調整値を示す。 |
| Saturation | FLOAT | 4 | +52 | +52 | 彩度調整値を示す。 |
各言語での定義
#include <windows.h>
// RECT (x64 16 / x86 16 バイト)
typedef struct RECT {
INT left;
INT top;
INT right;
INT bottom;
} RECT;
// DXVA_ProcAmpControlBlt (x64 56 / x86 56 バイト)
typedef struct DXVA_ProcAmpControlBlt {
DWORD Size;
RECT DstRect;
RECT SrcRect;
FLOAT Alpha;
FLOAT Brightness;
FLOAT Contrast;
FLOAT Hue;
FLOAT Saturation;
} DXVA_ProcAmpControlBlt;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 DXVA_ProcAmpControlBlt
{
public uint Size;
public RECT DstRect;
public RECT SrcRect;
public float Alpha;
public float Brightness;
public float Contrast;
public float Hue;
public float Saturation;
}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 DXVA_ProcAmpControlBlt
Public Size As UInteger
Public DstRect As RECT
Public SrcRect As RECT
Public Alpha As Single
Public Brightness As Single
Public Contrast As Single
Public Hue As Single
Public Saturation As Single
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 DXVA_ProcAmpControlBlt(ctypes.Structure):
_fields_ = [
("Size", wintypes.DWORD),
("DstRect", RECT),
("SrcRect", RECT),
("Alpha", ctypes.c_float),
("Brightness", ctypes.c_float),
("Contrast", ctypes.c_float),
("Hue", ctypes.c_float),
("Saturation", ctypes.c_float),
]#[repr(C)]
pub struct RECT {
pub left: i32,
pub top: i32,
pub right: i32,
pub bottom: i32,
}
#[repr(C)]
pub struct DXVA_ProcAmpControlBlt {
pub Size: u32,
pub DstRect: RECT,
pub SrcRect: RECT,
pub Alpha: f32,
pub Brightness: f32,
pub Contrast: f32,
pub Hue: f32,
pub Saturation: f32,
}import "golang.org/x/sys/windows"
type RECT struct {
left int32
top int32
right int32
bottom int32
}
type DXVA_ProcAmpControlBlt struct {
Size uint32
DstRect RECT
SrcRect RECT
Alpha float32
Brightness float32
Contrast float32
Hue float32
Saturation float32
}type
RECT = record
left: Integer;
top: Integer;
right: Integer;
bottom: Integer;
end;
DXVA_ProcAmpControlBlt = record
Size: DWORD;
DstRect: RECT;
SrcRect: RECT;
Alpha: Single;
Brightness: Single;
Contrast: Single;
Hue: Single;
Saturation: Single;
end;const RECT = extern struct {
left: i32,
top: i32,
right: i32,
bottom: i32,
};
const DXVA_ProcAmpControlBlt = extern struct {
Size: u32,
DstRect: RECT,
SrcRect: RECT,
Alpha: f32,
Brightness: f32,
Contrast: f32,
Hue: f32,
Saturation: f32,
};type
RECT {.bycopy.} = object
left: int32
top: int32
right: int32
bottom: int32
DXVA_ProcAmpControlBlt {.bycopy.} = object
Size: uint32
DstRect: RECT
SrcRect: RECT
Alpha: float32
Brightness: float32
Contrast: float32
Hue: float32
Saturation: float32struct RECT
{
int left;
int top;
int right;
int bottom;
}
struct DXVA_ProcAmpControlBlt
{
uint Size;
RECT DstRect;
RECT SrcRect;
float Alpha;
float Brightness;
float Contrast;
float Hue;
float Saturation;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXVA_ProcAmpControlBlt サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; Size : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; DstRect : RECT (+4, 16byte) varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; SrcRect : RECT (+20, 16byte) varptr(st)+20 を基点に操作(16byte:入れ子/配列)
; Alpha : FLOAT (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; Brightness : FLOAT (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; Contrast : FLOAT (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; Hue : FLOAT (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; Saturation : FLOAT (+52, 4byte) st.13 = 値 / 値 = st.13 (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 DXVA_ProcAmpControlBlt
#field int Size
#field RECT DstRect
#field RECT SrcRect
#field float Alpha
#field float Brightness
#field float Contrast
#field float Hue
#field float Saturation
#endstruct
stdim st, DXVA_ProcAmpControlBlt ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size