ホーム › Media.MediaFoundation › MFSampleExtensionPsnrYuv
MFSampleExtensionPsnrYuv
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| psnrY | FLOAT | 4 | +0 | +0 | Y(輝度)成分のPSNR値(dB)。 |
| psnrU | FLOAT | 4 | +4 | +4 | U(青色差)成分のPSNR値(dB)。 |
| psnrV | FLOAT | 4 | +8 | +8 | V(赤色差)成分のPSNR値(dB)。 |
各言語での定義
#include <windows.h>
// MFSampleExtensionPsnrYuv (x64 12 / x86 12 バイト)
typedef struct MFSampleExtensionPsnrYuv {
FLOAT psnrY;
FLOAT psnrU;
FLOAT psnrV;
} MFSampleExtensionPsnrYuv;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MFSampleExtensionPsnrYuv
{
public float psnrY;
public float psnrU;
public float psnrV;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MFSampleExtensionPsnrYuv
Public psnrY As Single
Public psnrU As Single
Public psnrV As Single
End Structureimport ctypes
from ctypes import wintypes
class MFSampleExtensionPsnrYuv(ctypes.Structure):
_fields_ = [
("psnrY", ctypes.c_float),
("psnrU", ctypes.c_float),
("psnrV", ctypes.c_float),
]#[repr(C)]
pub struct MFSampleExtensionPsnrYuv {
pub psnrY: f32,
pub psnrU: f32,
pub psnrV: f32,
}import "golang.org/x/sys/windows"
type MFSampleExtensionPsnrYuv struct {
psnrY float32
psnrU float32
psnrV float32
}type
MFSampleExtensionPsnrYuv = record
psnrY: Single;
psnrU: Single;
psnrV: Single;
end;const MFSampleExtensionPsnrYuv = extern struct {
psnrY: f32,
psnrU: f32,
psnrV: f32,
};type
MFSampleExtensionPsnrYuv {.bycopy.} = object
psnrY: float32
psnrU: float32
psnrV: float32struct MFSampleExtensionPsnrYuv
{
float psnrY;
float psnrU;
float psnrV;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MFSampleExtensionPsnrYuv サイズ: 12 バイト(x64)
dim st, 3 ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; psnrY : FLOAT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; psnrU : FLOAT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; psnrV : FLOAT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MFSampleExtensionPsnrYuv
#field float psnrY
#field float psnrU
#field float psnrV
#endstruct
stdim st, MFSampleExtensionPsnrYuv ; NSTRUCT 変数を確保
st->psnrY = 100
mes "psnrY=" + st->psnrY