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

D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1

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

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

フィールド

フィールドサイズx64x86説明
EnableBOOL4+0+0デコード時の色変換/スケーリングを有効にするか否かを示すBOOL。
pReferenceTexture2DID3D12Resource*8/4+8+4変換出力先となる参照テクスチャ(ID3D12Resource)へのポインタ。
ReferenceSubresourceDWORD4+16+8参照テクスチャのサブリソースインデックス。
OutputColorSpaceDXGI_COLOR_SPACE_TYPE4+20+12変換後出力の色空間を示すDXGI_COLOR_SPACE_TYPE。
DecodeColorSpaceDXGI_COLOR_SPACE_TYPE4+24+16デコード結果の色空間を示すDXGI_COLOR_SPACE_TYPE。
OutputWidthDWORD4+28+20変換後の出力幅(ピクセル単位)。
OutputHeightDWORD4+32+24変換後の出力高さ(ピクセル単位)。

各言語での定義

#include <windows.h>

// D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1  (x64 40 / x86 28 バイト)
typedef struct D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1 {
    BOOL Enable;
    ID3D12Resource* pReferenceTexture2D;
    DWORD ReferenceSubresource;
    DXGI_COLOR_SPACE_TYPE OutputColorSpace;
    DXGI_COLOR_SPACE_TYPE DecodeColorSpace;
    DWORD OutputWidth;
    DWORD OutputHeight;
} D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1
{
    [MarshalAs(UnmanagedType.Bool)] public bool Enable;
    public IntPtr pReferenceTexture2D;
    public uint ReferenceSubresource;
    public int OutputColorSpace;
    public int DecodeColorSpace;
    public uint OutputWidth;
    public uint OutputHeight;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1
    <MarshalAs(UnmanagedType.Bool)> Public Enable As Boolean
    Public pReferenceTexture2D As IntPtr
    Public ReferenceSubresource As UInteger
    Public OutputColorSpace As Integer
    Public DecodeColorSpace As Integer
    Public OutputWidth As UInteger
    Public OutputHeight As UInteger
End Structure
import ctypes
from ctypes import wintypes

class D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1(ctypes.Structure):
    _fields_ = [
        ("Enable", wintypes.BOOL),
        ("pReferenceTexture2D", ctypes.c_void_p),
        ("ReferenceSubresource", wintypes.DWORD),
        ("OutputColorSpace", ctypes.c_int),
        ("DecodeColorSpace", ctypes.c_int),
        ("OutputWidth", wintypes.DWORD),
        ("OutputHeight", wintypes.DWORD),
    ]
#[repr(C)]
pub struct D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1 {
    pub Enable: i32,
    pub pReferenceTexture2D: *mut core::ffi::c_void,
    pub ReferenceSubresource: u32,
    pub OutputColorSpace: i32,
    pub DecodeColorSpace: i32,
    pub OutputWidth: u32,
    pub OutputHeight: u32,
}
import "golang.org/x/sys/windows"

type D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1 struct {
	Enable int32
	pReferenceTexture2D uintptr
	ReferenceSubresource uint32
	OutputColorSpace int32
	DecodeColorSpace int32
	OutputWidth uint32
	OutputHeight uint32
}
type
  D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1 = record
    Enable: BOOL;
    pReferenceTexture2D: Pointer;
    ReferenceSubresource: DWORD;
    OutputColorSpace: Integer;
    DecodeColorSpace: Integer;
    OutputWidth: DWORD;
    OutputHeight: DWORD;
  end;
const D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1 = extern struct {
    Enable: i32,
    pReferenceTexture2D: ?*anyopaque,
    ReferenceSubresource: u32,
    OutputColorSpace: i32,
    DecodeColorSpace: i32,
    OutputWidth: u32,
    OutputHeight: u32,
};
type
  D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1 {.bycopy.} = object
    Enable: int32
    pReferenceTexture2D: pointer
    ReferenceSubresource: uint32
    OutputColorSpace: int32
    DecodeColorSpace: int32
    OutputWidth: uint32
    OutputHeight: uint32
struct D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1
{
    int Enable;
    void* pReferenceTexture2D;
    uint ReferenceSubresource;
    int OutputColorSpace;
    int DecodeColorSpace;
    uint OutputWidth;
    uint OutputHeight;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1 サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; Enable : BOOL (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; pReferenceTexture2D : ID3D12Resource* (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ReferenceSubresource : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; OutputColorSpace : DXGI_COLOR_SPACE_TYPE (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; DecodeColorSpace : DXGI_COLOR_SPACE_TYPE (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; OutputWidth : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; OutputHeight : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1 サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; Enable : BOOL (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; pReferenceTexture2D : ID3D12Resource* (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; ReferenceSubresource : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; OutputColorSpace : DXGI_COLOR_SPACE_TYPE (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; DecodeColorSpace : DXGI_COLOR_SPACE_TYPE (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; OutputWidth : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; OutputHeight : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1
    #field bool Enable
    #field intptr pReferenceTexture2D
    #field int ReferenceSubresource
    #field int OutputColorSpace
    #field int DecodeColorSpace
    #field int OutputWidth
    #field int OutputHeight
#endstruct

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