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

DXVAHD_COLOR_RGBA

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

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

フィールド

フィールドサイズx64x86説明
RFLOAT4+0+0赤成分の値(0.0〜1.0の正規化値)を示す。
GFLOAT4+4+4緑成分の値(0.0〜1.0の正規化値)を示す。
BFLOAT4+8+8青成分の値(0.0〜1.0の正規化値)を示す。
AFLOAT4+12+12アルファ(不透明度)成分の値(0.0〜1.0)を示す。

各言語での定義

#include <windows.h>

// DXVAHD_COLOR_RGBA  (x64 16 / x86 16 バイト)
typedef struct DXVAHD_COLOR_RGBA {
    FLOAT R;
    FLOAT G;
    FLOAT B;
    FLOAT A;
} DXVAHD_COLOR_RGBA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXVAHD_COLOR_RGBA
{
    public float R;
    public float G;
    public float B;
    public float A;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXVAHD_COLOR_RGBA
    Public R As Single
    Public G As Single
    Public B As Single
    Public A As Single
End Structure
import ctypes
from ctypes import wintypes

class DXVAHD_COLOR_RGBA(ctypes.Structure):
    _fields_ = [
        ("R", ctypes.c_float),
        ("G", ctypes.c_float),
        ("B", ctypes.c_float),
        ("A", ctypes.c_float),
    ]
#[repr(C)]
pub struct DXVAHD_COLOR_RGBA {
    pub R: f32,
    pub G: f32,
    pub B: f32,
    pub A: f32,
}
import "golang.org/x/sys/windows"

type DXVAHD_COLOR_RGBA struct {
	R float32
	G float32
	B float32
	A float32
}
type
  DXVAHD_COLOR_RGBA = record
    R: Single;
    G: Single;
    B: Single;
    A: Single;
  end;
const DXVAHD_COLOR_RGBA = extern struct {
    R: f32,
    G: f32,
    B: f32,
    A: f32,
};
type
  DXVAHD_COLOR_RGBA {.bycopy.} = object
    R: float32
    G: float32
    B: float32
    A: float32
struct DXVAHD_COLOR_RGBA
{
    float R;
    float G;
    float B;
    float A;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXVAHD_COLOR_RGBA サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; R : FLOAT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; G : FLOAT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; B : FLOAT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; A : FLOAT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DXVAHD_COLOR_RGBA
    #field float R
    #field float G
    #field float B
    #field float A
#endstruct

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