Win32 API 日本語リファレンス
ホームGraphics.Dxgi.Common › DXGI_GAMMA_CONTROL

DXGI_GAMMA_CONTROL

構造体
サイズx64: 12324 バイト / x86: 12324 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
ScaleDXGI_RGB12+0+0各色成分に適用するスケール(倍率)を表すDXGI_RGB。
OffsetDXGI_RGB12+12+12各色成分に適用するオフセット(加算値)を表すDXGI_RGB。
GammaCurveDXGI_RGB12300+24+24ガンマ曲線を構成する制御点の配列を表すDXGI_RGB。

各言語での定義

#include <windows.h>

// DXGI_RGB  (x64 12 / x86 12 バイト)
typedef struct DXGI_RGB {
    FLOAT Red;
    FLOAT Green;
    FLOAT Blue;
} DXGI_RGB;

// DXGI_GAMMA_CONTROL  (x64 12324 / x86 12324 バイト)
typedef struct DXGI_GAMMA_CONTROL {
    DXGI_RGB Scale;
    DXGI_RGB Offset;
    DXGI_RGB GammaCurve[1025];
} DXGI_GAMMA_CONTROL;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXGI_RGB
{
    public float Red;
    public float Green;
    public float Blue;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXGI_GAMMA_CONTROL
{
    public DXGI_RGB Scale;
    public DXGI_RGB Offset;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1025)] public DXGI_RGB[] GammaCurve;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXGI_RGB
    Public Red As Single
    Public Green As Single
    Public Blue As Single
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXGI_GAMMA_CONTROL
    Public Scale As DXGI_RGB
    Public Offset As DXGI_RGB
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1025)> Public GammaCurve() As DXGI_RGB
End Structure
import ctypes
from ctypes import wintypes

class DXGI_RGB(ctypes.Structure):
    _fields_ = [
        ("Red", ctypes.c_float),
        ("Green", ctypes.c_float),
        ("Blue", ctypes.c_float),
    ]

class DXGI_GAMMA_CONTROL(ctypes.Structure):
    _fields_ = [
        ("Scale", DXGI_RGB),
        ("Offset", DXGI_RGB),
        ("GammaCurve", DXGI_RGB * 1025),
    ]
#[repr(C)]
pub struct DXGI_RGB {
    pub Red: f32,
    pub Green: f32,
    pub Blue: f32,
}

#[repr(C)]
pub struct DXGI_GAMMA_CONTROL {
    pub Scale: DXGI_RGB,
    pub Offset: DXGI_RGB,
    pub GammaCurve: [DXGI_RGB; 1025],
}
import "golang.org/x/sys/windows"

type DXGI_RGB struct {
	Red float32
	Green float32
	Blue float32
}

type DXGI_GAMMA_CONTROL struct {
	Scale DXGI_RGB
	Offset DXGI_RGB
	GammaCurve [1025]DXGI_RGB
}
type
  DXGI_RGB = record
    Red: Single;
    Green: Single;
    Blue: Single;
  end;

  DXGI_GAMMA_CONTROL = record
    Scale: DXGI_RGB;
    Offset: DXGI_RGB;
    GammaCurve: array[0..1024] of DXGI_RGB;
  end;
const DXGI_RGB = extern struct {
    Red: f32,
    Green: f32,
    Blue: f32,
};

const DXGI_GAMMA_CONTROL = extern struct {
    Scale: DXGI_RGB,
    Offset: DXGI_RGB,
    GammaCurve: [1025]DXGI_RGB,
};
type
  DXGI_RGB {.bycopy.} = object
    Red: float32
    Green: float32
    Blue: float32

  DXGI_GAMMA_CONTROL {.bycopy.} = object
    Scale: DXGI_RGB
    Offset: DXGI_RGB
    GammaCurve: array[1025, DXGI_RGB]
struct DXGI_RGB
{
    float Red;
    float Green;
    float Blue;
}

struct DXGI_GAMMA_CONTROL
{
    DXGI_RGB Scale;
    DXGI_RGB Offset;
    DXGI_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 レイアウト)
; DXGI_GAMMA_CONTROL サイズ: 12324 バイト(x64)
dim st, 3081    ; 4byte整数×3081(構造体サイズ 12324 / 4 切り上げ)
; Scale : DXGI_RGB (+0, 12byte)  varptr(st)+0 を基点に操作(12byte:入れ子/配列)
; Offset : DXGI_RGB (+12, 12byte)  varptr(st)+12 を基点に操作(12byte:入れ子/配列)
; GammaCurve : DXGI_RGB (+24, 12300byte)  varptr(st)+24 を基点に操作(12300byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DXGI_RGB
    #field float Red
    #field float Green
    #field float Blue
#endstruct

#defstruct global DXGI_GAMMA_CONTROL
    #field DXGI_RGB Scale
    #field DXGI_RGB Offset
    #field DXGI_RGB GammaCurve 1025
#endstruct

stdim st, DXGI_GAMMA_CONTROL        ; NSTRUCT 変数を確保