ホーム › Media.KernelStreaming › KS_DVD_YUV
KS_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 | 輝度(Y)成分の値を示す。 |
| V | BYTE | 1 | +2 | +2 | 色差(V)成分の値を示す。 |
| U | BYTE | 1 | +3 | +3 | 色差(U)成分の値を示す。 |
各言語での定義
#include <windows.h>
// KS_DVD_YUV (x64 4 / x86 4 バイト)
typedef struct KS_DVD_YUV {
BYTE Reserved;
BYTE Y;
BYTE V;
BYTE U;
} KS_DVD_YUV;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KS_DVD_YUV
{
public byte Reserved;
public byte Y;
public byte V;
public byte U;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KS_DVD_YUV
Public Reserved As Byte
Public Y As Byte
Public V As Byte
Public U As Byte
End Structureimport ctypes
from ctypes import wintypes
class KS_DVD_YUV(ctypes.Structure):
_fields_ = [
("Reserved", ctypes.c_ubyte),
("Y", ctypes.c_ubyte),
("V", ctypes.c_ubyte),
("U", ctypes.c_ubyte),
]#[repr(C)]
pub struct KS_DVD_YUV {
pub Reserved: u8,
pub Y: u8,
pub V: u8,
pub U: u8,
}import "golang.org/x/sys/windows"
type KS_DVD_YUV struct {
Reserved byte
Y byte
V byte
U byte
}type
KS_DVD_YUV = record
Reserved: Byte;
Y: Byte;
V: Byte;
U: Byte;
end;const KS_DVD_YUV = extern struct {
Reserved: u8,
Y: u8,
V: u8,
U: u8,
};type
KS_DVD_YUV {.bycopy.} = object
Reserved: uint8
Y: uint8
V: uint8
U: uint8struct KS_DVD_YUV
{
ubyte Reserved;
ubyte Y;
ubyte V;
ubyte U;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KS_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)
; V : BYTE (+2, 1byte) poke st,2,値 / 値 = peek(st,2)
; U : BYTE (+3, 1byte) poke st,3,値 / 値 = peek(st,3)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global KS_DVD_YUV
#field byte Reserved
#field byte Y
#field byte V
#field byte U
#endstruct
stdim st, KS_DVD_YUV ; NSTRUCT 変数を確保
st->Reserved = 100
mes "Reserved=" + st->Reserved