ホーム › Media.MediaFoundation › DXVAHD_COLOR_YCbCrA
DXVAHD_COLOR_YCbCrA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Y | FLOAT | 4 | +0 | +0 | 輝度(Y)成分の値(0.0〜1.0の正規化値)を示す。 |
| Cb | FLOAT | 4 | +4 | +4 | 青色差(Cb)成分の値(0.0〜1.0の正規化値)を示す。 |
| Cr | FLOAT | 4 | +8 | +8 | 赤色差(Cr)成分の値(0.0〜1.0の正規化値)を示す。 |
| A | FLOAT | 4 | +12 | +12 | アルファ(不透明度)成分の値(0.0〜1.0)を示す。 |
各言語での定義
#include <windows.h>
// DXVAHD_COLOR_YCbCrA (x64 16 / x86 16 バイト)
typedef struct DXVAHD_COLOR_YCbCrA {
FLOAT Y;
FLOAT Cb;
FLOAT Cr;
FLOAT A;
} DXVAHD_COLOR_YCbCrA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXVAHD_COLOR_YCbCrA
{
public float Y;
public float Cb;
public float Cr;
public float A;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXVAHD_COLOR_YCbCrA
Public Y As Single
Public Cb As Single
Public Cr As Single
Public A As Single
End Structureimport ctypes
from ctypes import wintypes
class DXVAHD_COLOR_YCbCrA(ctypes.Structure):
_fields_ = [
("Y", ctypes.c_float),
("Cb", ctypes.c_float),
("Cr", ctypes.c_float),
("A", ctypes.c_float),
]#[repr(C)]
pub struct DXVAHD_COLOR_YCbCrA {
pub Y: f32,
pub Cb: f32,
pub Cr: f32,
pub A: f32,
}import "golang.org/x/sys/windows"
type DXVAHD_COLOR_YCbCrA struct {
Y float32
Cb float32
Cr float32
A float32
}type
DXVAHD_COLOR_YCbCrA = record
Y: Single;
Cb: Single;
Cr: Single;
A: Single;
end;const DXVAHD_COLOR_YCbCrA = extern struct {
Y: f32,
Cb: f32,
Cr: f32,
A: f32,
};type
DXVAHD_COLOR_YCbCrA {.bycopy.} = object
Y: float32
Cb: float32
Cr: float32
A: float32struct DXVAHD_COLOR_YCbCrA
{
float Y;
float Cb;
float Cr;
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_YCbCrA サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; Y : FLOAT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Cb : FLOAT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Cr : 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_YCbCrA
#field float Y
#field float Cb
#field float Cr
#field float A
#endstruct
stdim st, DXVAHD_COLOR_YCbCrA ; NSTRUCT 変数を確保
st->Y = 100
mes "Y=" + st->Y