ホーム › Devices.Display › GAMMA_RAMP_DXGI_1
GAMMA_RAMP_DXGI_1
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Scale | GAMMA_RAMP_RGB | 12 | +0 | +0 | 各RGBチャネルに乗じるスケール係数を保持するGAMMA_RAMP_RGB。 |
| Offset | GAMMA_RAMP_RGB | 12 | +12 | +12 | 各RGBチャネルに加算するオフセット値を保持するGAMMA_RAMP_RGB。 |
| GammaCurve | GAMMA_RAMP_RGB | 12300 | +24 | +24 | 各RGBチャネルに適用するガンマカーブ値を保持するGAMMA_RAMP_RGB。 |
各言語での定義
#include <windows.h>
// GAMMA_RAMP_RGB (x64 12 / x86 12 バイト)
typedef struct GAMMA_RAMP_RGB {
FLOAT Red;
FLOAT Green;
FLOAT Blue;
} GAMMA_RAMP_RGB;
// GAMMA_RAMP_DXGI_1 (x64 12324 / x86 12324 バイト)
typedef struct GAMMA_RAMP_DXGI_1 {
GAMMA_RAMP_RGB Scale;
GAMMA_RAMP_RGB Offset;
GAMMA_RAMP_RGB GammaCurve[1025];
} GAMMA_RAMP_DXGI_1;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GAMMA_RAMP_RGB
{
public float Red;
public float Green;
public float Blue;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GAMMA_RAMP_DXGI_1
{
public GAMMA_RAMP_RGB Scale;
public GAMMA_RAMP_RGB Offset;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1025)] public GAMMA_RAMP_RGB[] GammaCurve;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GAMMA_RAMP_RGB
Public Red As Single
Public Green As Single
Public Blue As Single
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GAMMA_RAMP_DXGI_1
Public Scale As GAMMA_RAMP_RGB
Public Offset As GAMMA_RAMP_RGB
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1025)> Public GammaCurve() As GAMMA_RAMP_RGB
End Structureimport ctypes
from ctypes import wintypes
class GAMMA_RAMP_RGB(ctypes.Structure):
_fields_ = [
("Red", ctypes.c_float),
("Green", ctypes.c_float),
("Blue", ctypes.c_float),
]
class GAMMA_RAMP_DXGI_1(ctypes.Structure):
_fields_ = [
("Scale", GAMMA_RAMP_RGB),
("Offset", GAMMA_RAMP_RGB),
("GammaCurve", GAMMA_RAMP_RGB * 1025),
]#[repr(C)]
pub struct GAMMA_RAMP_RGB {
pub Red: f32,
pub Green: f32,
pub Blue: f32,
}
#[repr(C)]
pub struct GAMMA_RAMP_DXGI_1 {
pub Scale: GAMMA_RAMP_RGB,
pub Offset: GAMMA_RAMP_RGB,
pub GammaCurve: [GAMMA_RAMP_RGB; 1025],
}import "golang.org/x/sys/windows"
type GAMMA_RAMP_RGB struct {
Red float32
Green float32
Blue float32
}
type GAMMA_RAMP_DXGI_1 struct {
Scale GAMMA_RAMP_RGB
Offset GAMMA_RAMP_RGB
GammaCurve [1025]GAMMA_RAMP_RGB
}type
GAMMA_RAMP_RGB = record
Red: Single;
Green: Single;
Blue: Single;
end;
GAMMA_RAMP_DXGI_1 = record
Scale: GAMMA_RAMP_RGB;
Offset: GAMMA_RAMP_RGB;
GammaCurve: array[0..1024] of GAMMA_RAMP_RGB;
end;const GAMMA_RAMP_RGB = extern struct {
Red: f32,
Green: f32,
Blue: f32,
};
const GAMMA_RAMP_DXGI_1 = extern struct {
Scale: GAMMA_RAMP_RGB,
Offset: GAMMA_RAMP_RGB,
GammaCurve: [1025]GAMMA_RAMP_RGB,
};type
GAMMA_RAMP_RGB {.bycopy.} = object
Red: float32
Green: float32
Blue: float32
GAMMA_RAMP_DXGI_1 {.bycopy.} = object
Scale: GAMMA_RAMP_RGB
Offset: GAMMA_RAMP_RGB
GammaCurve: array[1025, GAMMA_RAMP_RGB]struct GAMMA_RAMP_RGB
{
float Red;
float Green;
float Blue;
}
struct GAMMA_RAMP_DXGI_1
{
GAMMA_RAMP_RGB Scale;
GAMMA_RAMP_RGB Offset;
GAMMA_RAMP_RGB[1025] GammaCurve;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GAMMA_RAMP_DXGI_1 サイズ: 12324 バイト(x64)
dim st, 3081 ; 4byte整数×3081(構造体サイズ 12324 / 4 切り上げ)
; Scale : GAMMA_RAMP_RGB (+0, 12byte) varptr(st)+0 を基点に操作(12byte:入れ子/配列)
; Offset : GAMMA_RAMP_RGB (+12, 12byte) varptr(st)+12 を基点に操作(12byte:入れ子/配列)
; GammaCurve : GAMMA_RAMP_RGB (+24, 12300byte) varptr(st)+24 を基点に操作(12300byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GAMMA_RAMP_RGB
#field float Red
#field float Green
#field float Blue
#endstruct
#defstruct global GAMMA_RAMP_DXGI_1
#field GAMMA_RAMP_RGB Scale
#field GAMMA_RAMP_RGB Offset
#field GAMMA_RAMP_RGB GammaCurve 1025
#endstruct
stdim st, GAMMA_RAMP_DXGI_1 ; NSTRUCT 変数を確保