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

DXVA2_ValueRange

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

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

フィールド

フィールドサイズx64x86説明
MinValueDXVA2_Fixed328/4+0+0設定可能な最小値を示すDXVA2_Fixed32。
MaxValueDXVA2_Fixed328/4+8+4設定可能な最大値を示すDXVA2_Fixed32。
DefaultValueDXVA2_Fixed328/4+16+8既定値を示すDXVA2_Fixed32。
StepSizeDXVA2_Fixed328/4+24+12値の刻み幅(増分単位)を示すDXVA2_Fixed32。

各言語での定義

#include <windows.h>

// DXVA2_Fixed32  (x64 8 / x86 4 バイト)
typedef struct DXVA2_Fixed32 {
    _Anonymous_e__Union Anonymous;
} DXVA2_Fixed32;

// DXVA2_ValueRange  (x64 32 / x86 16 バイト)
typedef struct DXVA2_ValueRange {
    DXVA2_Fixed32 MinValue;
    DXVA2_Fixed32 MaxValue;
    DXVA2_Fixed32 DefaultValue;
    DXVA2_Fixed32 StepSize;
} DXVA2_ValueRange;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXVA2_Fixed32
{
    public _Anonymous_e__Union Anonymous;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXVA2_ValueRange
{
    public DXVA2_Fixed32 MinValue;
    public DXVA2_Fixed32 MaxValue;
    public DXVA2_Fixed32 DefaultValue;
    public DXVA2_Fixed32 StepSize;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXVA2_Fixed32
    Public Anonymous As _Anonymous_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXVA2_ValueRange
    Public MinValue As DXVA2_Fixed32
    Public MaxValue As DXVA2_Fixed32
    Public DefaultValue As DXVA2_Fixed32
    Public StepSize As DXVA2_Fixed32
End Structure
import ctypes
from ctypes import wintypes

class DXVA2_Fixed32(ctypes.Structure):
    _fields_ = [
        ("Anonymous", _Anonymous_e__Union),
    ]

class DXVA2_ValueRange(ctypes.Structure):
    _fields_ = [
        ("MinValue", DXVA2_Fixed32),
        ("MaxValue", DXVA2_Fixed32),
        ("DefaultValue", DXVA2_Fixed32),
        ("StepSize", DXVA2_Fixed32),
    ]
#[repr(C)]
pub struct DXVA2_Fixed32 {
    pub Anonymous: _Anonymous_e__Union,
}

#[repr(C)]
pub struct DXVA2_ValueRange {
    pub MinValue: DXVA2_Fixed32,
    pub MaxValue: DXVA2_Fixed32,
    pub DefaultValue: DXVA2_Fixed32,
    pub StepSize: DXVA2_Fixed32,
}
import "golang.org/x/sys/windows"

type DXVA2_Fixed32 struct {
	Anonymous _Anonymous_e__Union
}

type DXVA2_ValueRange struct {
	MinValue DXVA2_Fixed32
	MaxValue DXVA2_Fixed32
	DefaultValue DXVA2_Fixed32
	StepSize DXVA2_Fixed32
}
type
  DXVA2_Fixed32 = record
    Anonymous: _Anonymous_e__Union;
  end;

  DXVA2_ValueRange = record
    MinValue: DXVA2_Fixed32;
    MaxValue: DXVA2_Fixed32;
    DefaultValue: DXVA2_Fixed32;
    StepSize: DXVA2_Fixed32;
  end;
const DXVA2_Fixed32 = extern struct {
    Anonymous: _Anonymous_e__Union,
};

const DXVA2_ValueRange = extern struct {
    MinValue: DXVA2_Fixed32,
    MaxValue: DXVA2_Fixed32,
    DefaultValue: DXVA2_Fixed32,
    StepSize: DXVA2_Fixed32,
};
type
  DXVA2_Fixed32 {.bycopy.} = object
    Anonymous: _Anonymous_e__Union

  DXVA2_ValueRange {.bycopy.} = object
    MinValue: DXVA2_Fixed32
    MaxValue: DXVA2_Fixed32
    DefaultValue: DXVA2_Fixed32
    StepSize: DXVA2_Fixed32
struct DXVA2_Fixed32
{
    _Anonymous_e__Union Anonymous;
}

struct DXVA2_ValueRange
{
    DXVA2_Fixed32 MinValue;
    DXVA2_Fixed32 MaxValue;
    DXVA2_Fixed32 DefaultValue;
    DXVA2_Fixed32 StepSize;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DXVA2_ValueRange サイズ: 16 バイト(x86)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; MinValue : DXVA2_Fixed32 (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; MaxValue : DXVA2_Fixed32 (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; DefaultValue : DXVA2_Fixed32 (+8, 4byte)  varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; StepSize : DXVA2_Fixed32 (+12, 4byte)  varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXVA2_ValueRange サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; MinValue : DXVA2_Fixed32 (+0, 8byte)  varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; MaxValue : DXVA2_Fixed32 (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; DefaultValue : DXVA2_Fixed32 (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; StepSize : DXVA2_Fixed32 (+24, 8byte)  varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DXVA2_Fixed32
    #field byte Anonymous 8
#endstruct

#defstruct global DXVA2_ValueRange
    #field DXVA2_Fixed32 MinValue
    #field DXVA2_Fixed32 MaxValue
    #field DXVA2_Fixed32 DefaultValue
    #field DXVA2_Fixed32 StepSize
#endstruct

stdim st, DXVA2_ValueRange        ; NSTRUCT 変数を確保