ホーム › Media.DirectShow › AM_DVD_YUV
AM_DVD_YUV
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Reserved | BYTE | 1 | +0 | +0 | 予約フィールド。将来の拡張用で通常は0。 |
| Y | BYTE | 1 | +1 | +1 | YUV色のY(輝度)成分値。 |
| U | BYTE | 1 | +2 | +2 | YUV色のU(青色差)成分値。 |
| V | BYTE | 1 | +3 | +3 | YUV色のV(赤色差)成分値。 |
各言語での定義
#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;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;
}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 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),
]#[repr(C)]
pub struct AM_DVD_YUV {
pub Reserved: u8,
pub Y: u8,
pub U: u8,
pub V: u8,
}import "golang.org/x/sys/windows"
type AM_DVD_YUV struct {
Reserved byte
Y byte
U byte
V byte
}type
AM_DVD_YUV = record
Reserved: Byte;
Y: Byte;
U: Byte;
V: Byte;
end;const AM_DVD_YUV = extern struct {
Reserved: u8,
Y: u8,
U: u8,
V: u8,
};type
AM_DVD_YUV {.bycopy.} = object
Reserved: uint8
Y: uint8
U: uint8
V: uint8struct AM_DVD_YUV
{
ubyte Reserved;
ubyte Y;
ubyte U;
ubyte V;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; AM_DVD_YUV サイズ: 4 バイト(x64)
dim st, 1 ; 4byte整数×1(構造体サイズ 4 / 4 切り上げ)
; Reserved : BYTE (+0, 1byte) poke st,0,値 / 値 = peek(st,0)
; Y : BYTE (+1, 1byte) poke st,1,値 / 値 = peek(st,1)
; U : BYTE (+2, 1byte) poke st,2,値 / 値 = peek(st,2)
; V : BYTE (+3, 1byte) poke st,3,値 / 値 = peek(st,3)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global AM_DVD_YUV
#field byte Reserved
#field byte Y
#field byte U
#field byte V
#endstruct
stdim st, AM_DVD_YUV ; NSTRUCT 変数を確保
st->Reserved = 100
mes "Reserved=" + st->Reserved