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

MT_CUSTOM_VIDEO_PRIMARIES

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

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

フィールド

フィールドサイズx64x86説明
fRxFLOAT4+0+0赤の x 座標です。
fRyFLOAT4+4+4赤の y 座標です。
fGxFLOAT4+8+8緑の x 座標です。
fGyFLOAT4+12+12緑の y 座標です。
fBxFLOAT4+16+16青の x 座標です。
fByFLOAT4+20+20青の y 座標です。
fWxFLOAT4+24+24白色点の x 座標です。
fWyFLOAT4+28+28白色点の y 座標です。

公式ドキュメント

ビデオ ソースのカスタム カラー プライマリを定義します。カラー プライマリは、RGB 色空間から CIE XYZ 色空間へ色を変換する方法を定義します。

解説(Remarks)

この構造体は、MF_MT_CUSTOM_VIDEO_PRIMARIES 属性と共に使用します。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// MT_CUSTOM_VIDEO_PRIMARIES  (x64 32 / x86 32 バイト)
typedef struct MT_CUSTOM_VIDEO_PRIMARIES {
    FLOAT fRx;
    FLOAT fRy;
    FLOAT fGx;
    FLOAT fGy;
    FLOAT fBx;
    FLOAT fBy;
    FLOAT fWx;
    FLOAT fWy;
} MT_CUSTOM_VIDEO_PRIMARIES;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MT_CUSTOM_VIDEO_PRIMARIES
{
    public float fRx;
    public float fRy;
    public float fGx;
    public float fGy;
    public float fBx;
    public float fBy;
    public float fWx;
    public float fWy;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MT_CUSTOM_VIDEO_PRIMARIES
    Public fRx As Single
    Public fRy As Single
    Public fGx As Single
    Public fGy As Single
    Public fBx As Single
    Public fBy As Single
    Public fWx As Single
    Public fWy As Single
End Structure
import ctypes
from ctypes import wintypes

class MT_CUSTOM_VIDEO_PRIMARIES(ctypes.Structure):
    _fields_ = [
        ("fRx", ctypes.c_float),
        ("fRy", ctypes.c_float),
        ("fGx", ctypes.c_float),
        ("fGy", ctypes.c_float),
        ("fBx", ctypes.c_float),
        ("fBy", ctypes.c_float),
        ("fWx", ctypes.c_float),
        ("fWy", ctypes.c_float),
    ]
#[repr(C)]
pub struct MT_CUSTOM_VIDEO_PRIMARIES {
    pub fRx: f32,
    pub fRy: f32,
    pub fGx: f32,
    pub fGy: f32,
    pub fBx: f32,
    pub fBy: f32,
    pub fWx: f32,
    pub fWy: f32,
}
import "golang.org/x/sys/windows"

type MT_CUSTOM_VIDEO_PRIMARIES struct {
	fRx float32
	fRy float32
	fGx float32
	fGy float32
	fBx float32
	fBy float32
	fWx float32
	fWy float32
}
type
  MT_CUSTOM_VIDEO_PRIMARIES = record
    fRx: Single;
    fRy: Single;
    fGx: Single;
    fGy: Single;
    fBx: Single;
    fBy: Single;
    fWx: Single;
    fWy: Single;
  end;
const MT_CUSTOM_VIDEO_PRIMARIES = extern struct {
    fRx: f32,
    fRy: f32,
    fGx: f32,
    fGy: f32,
    fBx: f32,
    fBy: f32,
    fWx: f32,
    fWy: f32,
};
type
  MT_CUSTOM_VIDEO_PRIMARIES {.bycopy.} = object
    fRx: float32
    fRy: float32
    fGx: float32
    fGy: float32
    fBx: float32
    fBy: float32
    fWx: float32
    fWy: float32
struct MT_CUSTOM_VIDEO_PRIMARIES
{
    float fRx;
    float fRy;
    float fGx;
    float fGy;
    float fBx;
    float fBy;
    float fWx;
    float fWy;
}

HSP用 定義

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

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

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