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

D2D1_EFFECT_INPUT_DESCRIPTION

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

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

フィールド

フィールドサイズx64x86説明
effectID2D1Effect*8/4+0+0入力を記述する対象のエフェクト。
inputIndexDWORD4+8+4対象とする入力のインデックス。
inputRectangleD2D_RECT_F16+12+8その入力が描画される矩形領域。

各言語での定義

#include <windows.h>

// D2D_RECT_F  (x64 16 / x86 16 バイト)
typedef struct D2D_RECT_F {
    FLOAT left;
    FLOAT top;
    FLOAT right;
    FLOAT bottom;
} D2D_RECT_F;

// D2D1_EFFECT_INPUT_DESCRIPTION  (x64 32 / x86 24 バイト)
typedef struct D2D1_EFFECT_INPUT_DESCRIPTION {
    ID2D1Effect* effect;
    DWORD inputIndex;
    D2D_RECT_F inputRectangle;
} D2D1_EFFECT_INPUT_DESCRIPTION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D2D_RECT_F
{
    public float left;
    public float top;
    public float right;
    public float bottom;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D2D1_EFFECT_INPUT_DESCRIPTION
{
    public IntPtr effect;
    public uint inputIndex;
    public D2D_RECT_F inputRectangle;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D2D_RECT_F
    Public left As Single
    Public top As Single
    Public right As Single
    Public bottom As Single
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D2D1_EFFECT_INPUT_DESCRIPTION
    Public effect As IntPtr
    Public inputIndex As UInteger
    Public inputRectangle As D2D_RECT_F
End Structure
import ctypes
from ctypes import wintypes

class D2D_RECT_F(ctypes.Structure):
    _fields_ = [
        ("left", ctypes.c_float),
        ("top", ctypes.c_float),
        ("right", ctypes.c_float),
        ("bottom", ctypes.c_float),
    ]

class D2D1_EFFECT_INPUT_DESCRIPTION(ctypes.Structure):
    _fields_ = [
        ("effect", ctypes.c_void_p),
        ("inputIndex", wintypes.DWORD),
        ("inputRectangle", D2D_RECT_F),
    ]
#[repr(C)]
pub struct D2D_RECT_F {
    pub left: f32,
    pub top: f32,
    pub right: f32,
    pub bottom: f32,
}

#[repr(C)]
pub struct D2D1_EFFECT_INPUT_DESCRIPTION {
    pub effect: *mut core::ffi::c_void,
    pub inputIndex: u32,
    pub inputRectangle: D2D_RECT_F,
}
import "golang.org/x/sys/windows"

type D2D_RECT_F struct {
	left float32
	top float32
	right float32
	bottom float32
}

type D2D1_EFFECT_INPUT_DESCRIPTION struct {
	effect uintptr
	inputIndex uint32
	inputRectangle D2D_RECT_F
}
type
  D2D_RECT_F = record
    left: Single;
    top: Single;
    right: Single;
    bottom: Single;
  end;

  D2D1_EFFECT_INPUT_DESCRIPTION = record
    effect: Pointer;
    inputIndex: DWORD;
    inputRectangle: D2D_RECT_F;
  end;
const D2D_RECT_F = extern struct {
    left: f32,
    top: f32,
    right: f32,
    bottom: f32,
};

const D2D1_EFFECT_INPUT_DESCRIPTION = extern struct {
    effect: ?*anyopaque,
    inputIndex: u32,
    inputRectangle: D2D_RECT_F,
};
type
  D2D_RECT_F {.bycopy.} = object
    left: float32
    top: float32
    right: float32
    bottom: float32

  D2D1_EFFECT_INPUT_DESCRIPTION {.bycopy.} = object
    effect: pointer
    inputIndex: uint32
    inputRectangle: D2D_RECT_F
struct D2D_RECT_F
{
    float left;
    float top;
    float right;
    float bottom;
}

struct D2D1_EFFECT_INPUT_DESCRIPTION
{
    void* effect;
    uint inputIndex;
    D2D_RECT_F inputRectangle;
}

HSP用 定義

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

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

#defstruct global D2D1_EFFECT_INPUT_DESCRIPTION
    #field intptr effect
    #field int inputIndex
    #field D2D_RECT_F inputRectangle
#endstruct

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