Win32 API 日本語リファレンス
ホームUI.ColorSystem › WCS_DEVICE_MHC2_CAPABILITIES

WCS_DEVICE_MHC2_CAPABILITIES

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

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

フィールド

フィールドサイズx64x86説明
SizeDWORD4+0+0この構造体のサイズ(バイト)。
SupportsMhc2BOOL4+4+4デバイスがMHC2(高度な色制御)を対応するかを示すフラグ。
RegammaLutEntryCountDWORD4+8+8再ガンマLUTのエントリ数。
CscXyzMatrixRowsDWORD4+12+12色変換XYZマトリックスの行数。
CscXyzMatrixColumnsDWORD4+16+16色変換XYZマトリックスの列数。

各言語での定義

#include <windows.h>

// WCS_DEVICE_MHC2_CAPABILITIES  (x64 20 / x86 20 バイト)
typedef struct WCS_DEVICE_MHC2_CAPABILITIES {
    DWORD Size;
    BOOL SupportsMhc2;
    DWORD RegammaLutEntryCount;
    DWORD CscXyzMatrixRows;
    DWORD CscXyzMatrixColumns;
} WCS_DEVICE_MHC2_CAPABILITIES;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WCS_DEVICE_MHC2_CAPABILITIES
{
    public uint Size;
    [MarshalAs(UnmanagedType.Bool)] public bool SupportsMhc2;
    public uint RegammaLutEntryCount;
    public uint CscXyzMatrixRows;
    public uint CscXyzMatrixColumns;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WCS_DEVICE_MHC2_CAPABILITIES
    Public Size As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public SupportsMhc2 As Boolean
    Public RegammaLutEntryCount As UInteger
    Public CscXyzMatrixRows As UInteger
    Public CscXyzMatrixColumns As UInteger
End Structure
import ctypes
from ctypes import wintypes

class WCS_DEVICE_MHC2_CAPABILITIES(ctypes.Structure):
    _fields_ = [
        ("Size", wintypes.DWORD),
        ("SupportsMhc2", wintypes.BOOL),
        ("RegammaLutEntryCount", wintypes.DWORD),
        ("CscXyzMatrixRows", wintypes.DWORD),
        ("CscXyzMatrixColumns", wintypes.DWORD),
    ]
#[repr(C)]
pub struct WCS_DEVICE_MHC2_CAPABILITIES {
    pub Size: u32,
    pub SupportsMhc2: i32,
    pub RegammaLutEntryCount: u32,
    pub CscXyzMatrixRows: u32,
    pub CscXyzMatrixColumns: u32,
}
import "golang.org/x/sys/windows"

type WCS_DEVICE_MHC2_CAPABILITIES struct {
	Size uint32
	SupportsMhc2 int32
	RegammaLutEntryCount uint32
	CscXyzMatrixRows uint32
	CscXyzMatrixColumns uint32
}
type
  WCS_DEVICE_MHC2_CAPABILITIES = record
    Size: DWORD;
    SupportsMhc2: BOOL;
    RegammaLutEntryCount: DWORD;
    CscXyzMatrixRows: DWORD;
    CscXyzMatrixColumns: DWORD;
  end;
const WCS_DEVICE_MHC2_CAPABILITIES = extern struct {
    Size: u32,
    SupportsMhc2: i32,
    RegammaLutEntryCount: u32,
    CscXyzMatrixRows: u32,
    CscXyzMatrixColumns: u32,
};
type
  WCS_DEVICE_MHC2_CAPABILITIES {.bycopy.} = object
    Size: uint32
    SupportsMhc2: int32
    RegammaLutEntryCount: uint32
    CscXyzMatrixRows: uint32
    CscXyzMatrixColumns: uint32
struct WCS_DEVICE_MHC2_CAPABILITIES
{
    uint Size;
    int SupportsMhc2;
    uint RegammaLutEntryCount;
    uint CscXyzMatrixRows;
    uint CscXyzMatrixColumns;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WCS_DEVICE_MHC2_CAPABILITIES サイズ: 20 バイト(x64)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; Size : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; SupportsMhc2 : BOOL (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; RegammaLutEntryCount : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; CscXyzMatrixRows : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; CscXyzMatrixColumns : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WCS_DEVICE_MHC2_CAPABILITIES
    #field int Size
    #field bool SupportsMhc2
    #field int RegammaLutEntryCount
    #field int CscXyzMatrixRows
    #field int CscXyzMatrixColumns
#endstruct

stdim st, WCS_DEVICE_MHC2_CAPABILITIES        ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size