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

VMR9ProcAmpControl

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

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

フィールド

フィールドサイズx64x86説明
dwSizeDWORD4+0+0構造体のバイトサイズ。互換性検証に使う。
dwFlagsDWORD4+4+4有効な調整項目を示すフラグ(VMR9ProcAmpControlFlags)。
BrightnessFLOAT4+8+8明るさ(輝度)の調整値。
ContrastFLOAT4+12+12コントラストの調整値。
HueFLOAT4+16+16色相(Hue)の調整値。
SaturationFLOAT4+20+20彩度(Saturation)の調整値。

各言語での定義

#include <windows.h>

// VMR9ProcAmpControl  (x64 24 / x86 24 バイト)
typedef struct VMR9ProcAmpControl {
    DWORD dwSize;
    DWORD dwFlags;
    FLOAT Brightness;
    FLOAT Contrast;
    FLOAT Hue;
    FLOAT Saturation;
} VMR9ProcAmpControl;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VMR9ProcAmpControl
{
    public uint dwSize;
    public uint dwFlags;
    public float Brightness;
    public float Contrast;
    public float Hue;
    public float Saturation;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VMR9ProcAmpControl
    Public dwSize As UInteger
    Public dwFlags As UInteger
    Public Brightness As Single
    Public Contrast As Single
    Public Hue As Single
    Public Saturation As Single
End Structure
import ctypes
from ctypes import wintypes

class VMR9ProcAmpControl(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("Brightness", ctypes.c_float),
        ("Contrast", ctypes.c_float),
        ("Hue", ctypes.c_float),
        ("Saturation", ctypes.c_float),
    ]
#[repr(C)]
pub struct VMR9ProcAmpControl {
    pub dwSize: u32,
    pub dwFlags: u32,
    pub Brightness: f32,
    pub Contrast: f32,
    pub Hue: f32,
    pub Saturation: f32,
}
import "golang.org/x/sys/windows"

type VMR9ProcAmpControl struct {
	dwSize uint32
	dwFlags uint32
	Brightness float32
	Contrast float32
	Hue float32
	Saturation float32
}
type
  VMR9ProcAmpControl = record
    dwSize: DWORD;
    dwFlags: DWORD;
    Brightness: Single;
    Contrast: Single;
    Hue: Single;
    Saturation: Single;
  end;
const VMR9ProcAmpControl = extern struct {
    dwSize: u32,
    dwFlags: u32,
    Brightness: f32,
    Contrast: f32,
    Hue: f32,
    Saturation: f32,
};
type
  VMR9ProcAmpControl {.bycopy.} = object
    dwSize: uint32
    dwFlags: uint32
    Brightness: float32
    Contrast: float32
    Hue: float32
    Saturation: float32
struct VMR9ProcAmpControl
{
    uint dwSize;
    uint dwFlags;
    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 レイアウト)
; VMR9ProcAmpControl サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Brightness : FLOAT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Contrast : FLOAT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Hue : FLOAT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; Saturation : FLOAT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global VMR9ProcAmpControl
    #field int dwSize
    #field int dwFlags
    #field float Brightness
    #field float Contrast
    #field float Hue
    #field float Saturation
#endstruct

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