Win32 API 日本語リファレンス
ホームGraphics.Direct3D11 › D3D11_FEATURE_DATA_VIDEO_DECODER_HISTOGRAM

D3D11_FEATURE_DATA_VIDEO_DECODER_HISTOGRAM

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

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

フィールド

フィールドサイズx64x86説明
DecoderDescD3D11_VIDEO_DECODER_DESC28+0+0対象デコーダーの構成を示すD3D11_VIDEO_DECODER_DESC。
ComponentsD3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_FLAGS4+28+28ヒストグラム生成対象の色成分を示すD3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_FLAGSビットフラグ。
BinCountDWORD4+32+32ヒストグラムのビン(階級)数。
CounterBitDepthDWORD4+36+36各ビンのカウンタのビット深度。

各言語での定義

#include <windows.h>

// D3D11_VIDEO_DECODER_DESC  (x64 28 / x86 28 バイト)
typedef struct D3D11_VIDEO_DECODER_DESC {
    GUID Guid;
    DWORD SampleWidth;
    DWORD SampleHeight;
    DXGI_FORMAT OutputFormat;
} D3D11_VIDEO_DECODER_DESC;

// D3D11_FEATURE_DATA_VIDEO_DECODER_HISTOGRAM  (x64 40 / x86 40 バイト)
typedef struct D3D11_FEATURE_DATA_VIDEO_DECODER_HISTOGRAM {
    D3D11_VIDEO_DECODER_DESC DecoderDesc;
    D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_FLAGS Components;
    DWORD BinCount;
    DWORD CounterBitDepth;
} D3D11_FEATURE_DATA_VIDEO_DECODER_HISTOGRAM;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_VIDEO_DECODER_DESC
{
    public Guid Guid;
    public uint SampleWidth;
    public uint SampleHeight;
    public int OutputFormat;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_FEATURE_DATA_VIDEO_DECODER_HISTOGRAM
{
    public D3D11_VIDEO_DECODER_DESC DecoderDesc;
    public int Components;
    public uint BinCount;
    public uint CounterBitDepth;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_VIDEO_DECODER_DESC
    Public Guid As Guid
    Public SampleWidth As UInteger
    Public SampleHeight As UInteger
    Public OutputFormat As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_FEATURE_DATA_VIDEO_DECODER_HISTOGRAM
    Public DecoderDesc As D3D11_VIDEO_DECODER_DESC
    Public Components As Integer
    Public BinCount As UInteger
    Public CounterBitDepth As UInteger
End Structure
import ctypes
from ctypes import wintypes

class D3D11_VIDEO_DECODER_DESC(ctypes.Structure):
    _fields_ = [
        ("Guid", GUID),
        ("SampleWidth", wintypes.DWORD),
        ("SampleHeight", wintypes.DWORD),
        ("OutputFormat", ctypes.c_int),
    ]

class D3D11_FEATURE_DATA_VIDEO_DECODER_HISTOGRAM(ctypes.Structure):
    _fields_ = [
        ("DecoderDesc", D3D11_VIDEO_DECODER_DESC),
        ("Components", ctypes.c_int),
        ("BinCount", wintypes.DWORD),
        ("CounterBitDepth", wintypes.DWORD),
    ]
#[repr(C)]
pub struct D3D11_VIDEO_DECODER_DESC {
    pub Guid: GUID,
    pub SampleWidth: u32,
    pub SampleHeight: u32,
    pub OutputFormat: i32,
}

#[repr(C)]
pub struct D3D11_FEATURE_DATA_VIDEO_DECODER_HISTOGRAM {
    pub DecoderDesc: D3D11_VIDEO_DECODER_DESC,
    pub Components: i32,
    pub BinCount: u32,
    pub CounterBitDepth: u32,
}
import "golang.org/x/sys/windows"

type D3D11_VIDEO_DECODER_DESC struct {
	Guid windows.GUID
	SampleWidth uint32
	SampleHeight uint32
	OutputFormat int32
}

type D3D11_FEATURE_DATA_VIDEO_DECODER_HISTOGRAM struct {
	DecoderDesc D3D11_VIDEO_DECODER_DESC
	Components int32
	BinCount uint32
	CounterBitDepth uint32
}
type
  D3D11_VIDEO_DECODER_DESC = record
    Guid: TGUID;
    SampleWidth: DWORD;
    SampleHeight: DWORD;
    OutputFormat: Integer;
  end;

  D3D11_FEATURE_DATA_VIDEO_DECODER_HISTOGRAM = record
    DecoderDesc: D3D11_VIDEO_DECODER_DESC;
    Components: Integer;
    BinCount: DWORD;
    CounterBitDepth: DWORD;
  end;
const D3D11_VIDEO_DECODER_DESC = extern struct {
    Guid: GUID,
    SampleWidth: u32,
    SampleHeight: u32,
    OutputFormat: i32,
};

const D3D11_FEATURE_DATA_VIDEO_DECODER_HISTOGRAM = extern struct {
    DecoderDesc: D3D11_VIDEO_DECODER_DESC,
    Components: i32,
    BinCount: u32,
    CounterBitDepth: u32,
};
type
  D3D11_VIDEO_DECODER_DESC {.bycopy.} = object
    Guid: GUID
    SampleWidth: uint32
    SampleHeight: uint32
    OutputFormat: int32

  D3D11_FEATURE_DATA_VIDEO_DECODER_HISTOGRAM {.bycopy.} = object
    DecoderDesc: D3D11_VIDEO_DECODER_DESC
    Components: int32
    BinCount: uint32
    CounterBitDepth: uint32
struct D3D11_VIDEO_DECODER_DESC
{
    GUID Guid;
    uint SampleWidth;
    uint SampleHeight;
    int OutputFormat;
}

struct D3D11_FEATURE_DATA_VIDEO_DECODER_HISTOGRAM
{
    D3D11_VIDEO_DECODER_DESC DecoderDesc;
    int Components;
    uint BinCount;
    uint CounterBitDepth;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D11_FEATURE_DATA_VIDEO_DECODER_HISTOGRAM サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; DecoderDesc : D3D11_VIDEO_DECODER_DESC (+0, 28byte)  varptr(st)+0 を基点に操作(28byte:入れ子/配列)
; Components : D3D11_VIDEO_DECODER_HISTOGRAM_COMPONENT_FLAGS (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; BinCount : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; CounterBitDepth : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
    #field int Data1
    #field short Data2
    #field short Data3
    #field byte Data4 8
#endstruct

#defstruct global D3D11_VIDEO_DECODER_DESC
    #field GUID Guid
    #field int SampleWidth
    #field int SampleHeight
    #field int OutputFormat
#endstruct

#defstruct global D3D11_FEATURE_DATA_VIDEO_DECODER_HISTOGRAM
    #field D3D11_VIDEO_DECODER_DESC DecoderDesc
    #field int Components
    #field int BinCount
    #field int CounterBitDepth
#endstruct

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