ホーム › Media.DirectShow › AM_PROPERTY_SPPAL
AM_PROPERTY_SPPAL
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| sppal | AM_DVD_YUV | 64 | +0 | +0 | サブピクチャ用YUVパレット配列(AM_DVD_YUV、16色)。 |
各言語での定義
#include <windows.h>
// AM_DVD_YUV (x64 4 / x86 4 バイト)
typedef struct AM_DVD_YUV {
BYTE Reserved;
BYTE Y;
BYTE U;
BYTE V;
} AM_DVD_YUV;
// AM_PROPERTY_SPPAL (x64 64 / x86 64 バイト)
typedef struct AM_PROPERTY_SPPAL {
AM_DVD_YUV sppal[16];
} AM_PROPERTY_SPPAL;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AM_DVD_YUV
{
public byte Reserved;
public byte Y;
public byte U;
public byte V;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AM_PROPERTY_SPPAL
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public AM_DVD_YUV[] sppal;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AM_DVD_YUV
Public Reserved As Byte
Public Y As Byte
Public U As Byte
Public V As Byte
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AM_PROPERTY_SPPAL
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public sppal() As AM_DVD_YUV
End Structureimport ctypes
from ctypes import wintypes
class AM_DVD_YUV(ctypes.Structure):
_fields_ = [
("Reserved", ctypes.c_ubyte),
("Y", ctypes.c_ubyte),
("U", ctypes.c_ubyte),
("V", ctypes.c_ubyte),
]
class AM_PROPERTY_SPPAL(ctypes.Structure):
_fields_ = [
("sppal", AM_DVD_YUV * 16),
]#[repr(C)]
pub struct AM_DVD_YUV {
pub Reserved: u8,
pub Y: u8,
pub U: u8,
pub V: u8,
}
#[repr(C)]
pub struct AM_PROPERTY_SPPAL {
pub sppal: [AM_DVD_YUV; 16],
}import "golang.org/x/sys/windows"
type AM_DVD_YUV struct {
Reserved byte
Y byte
U byte
V byte
}
type AM_PROPERTY_SPPAL struct {
sppal [16]AM_DVD_YUV
}type
AM_DVD_YUV = record
Reserved: Byte;
Y: Byte;
U: Byte;
V: Byte;
end;
AM_PROPERTY_SPPAL = record
sppal: array[0..15] of AM_DVD_YUV;
end;const AM_DVD_YUV = extern struct {
Reserved: u8,
Y: u8,
U: u8,
V: u8,
};
const AM_PROPERTY_SPPAL = extern struct {
sppal: [16]AM_DVD_YUV,
};type
AM_DVD_YUV {.bycopy.} = object
Reserved: uint8
Y: uint8
U: uint8
V: uint8
AM_PROPERTY_SPPAL {.bycopy.} = object
sppal: array[16, AM_DVD_YUV]struct AM_DVD_YUV
{
ubyte Reserved;
ubyte Y;
ubyte U;
ubyte V;
}
struct AM_PROPERTY_SPPAL
{
AM_DVD_YUV[16] sppal;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; AM_PROPERTY_SPPAL サイズ: 64 バイト(x64)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; sppal : AM_DVD_YUV (+0, 64byte) varptr(st)+0 を基点に操作(64byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global AM_DVD_YUV
#field byte Reserved
#field byte Y
#field byte U
#field byte V
#endstruct
#defstruct global AM_PROPERTY_SPPAL
#field AM_DVD_YUV sppal 16
#endstruct
stdim st, AM_PROPERTY_SPPAL ; NSTRUCT 変数を確保