Win32 API 日本語リファレンス
ホームGraphics.Imaging › WICRawToneCurve

WICRawToneCurve

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

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

フィールド

フィールドサイズx64x86説明
cPointsDWORD4+0+0aPoints配列に含まれるトーンカーブ点の数。
aPointsWICRawToneCurvePoint16+8+8トーンカーブを構成する点の可変長配列の先頭要素(WICRawToneCurvePoint)。

各言語での定義

#include <windows.h>

// WICRawToneCurvePoint  (x64 16 / x86 16 バイト)
typedef struct WICRawToneCurvePoint {
    DOUBLE Input;
    DOUBLE Output;
} WICRawToneCurvePoint;

// WICRawToneCurve  (x64 24 / x86 24 バイト)
typedef struct WICRawToneCurve {
    DWORD cPoints;
    WICRawToneCurvePoint aPoints[1];
} WICRawToneCurve;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WICRawToneCurvePoint
{
    public double Input;
    public double Output;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WICRawToneCurve
{
    public uint cPoints;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public WICRawToneCurvePoint[] aPoints;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WICRawToneCurvePoint
    Public Input As Double
    Public Output As Double
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WICRawToneCurve
    Public cPoints As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public aPoints() As WICRawToneCurvePoint
End Structure
import ctypes
from ctypes import wintypes

class WICRawToneCurvePoint(ctypes.Structure):
    _fields_ = [
        ("Input", ctypes.c_double),
        ("Output", ctypes.c_double),
    ]

class WICRawToneCurve(ctypes.Structure):
    _fields_ = [
        ("cPoints", wintypes.DWORD),
        ("aPoints", WICRawToneCurvePoint * 1),
    ]
#[repr(C)]
pub struct WICRawToneCurvePoint {
    pub Input: f64,
    pub Output: f64,
}

#[repr(C)]
pub struct WICRawToneCurve {
    pub cPoints: u32,
    pub aPoints: [WICRawToneCurvePoint; 1],
}
import "golang.org/x/sys/windows"

type WICRawToneCurvePoint struct {
	Input float64
	Output float64
}

type WICRawToneCurve struct {
	cPoints uint32
	aPoints [1]WICRawToneCurvePoint
}
type
  WICRawToneCurvePoint = record
    Input: Double;
    Output: Double;
  end;

  WICRawToneCurve = record
    cPoints: DWORD;
    aPoints: array[0..0] of WICRawToneCurvePoint;
  end;
const WICRawToneCurvePoint = extern struct {
    Input: f64,
    Output: f64,
};

const WICRawToneCurve = extern struct {
    cPoints: u32,
    aPoints: [1]WICRawToneCurvePoint,
};
type
  WICRawToneCurvePoint {.bycopy.} = object
    Input: float64
    Output: float64

  WICRawToneCurve {.bycopy.} = object
    cPoints: uint32
    aPoints: array[1, WICRawToneCurvePoint]
struct WICRawToneCurvePoint
{
    double Input;
    double Output;
}

struct WICRawToneCurve
{
    uint cPoints;
    WICRawToneCurvePoint[1] aPoints;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WICRawToneCurve サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; cPoints : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; aPoints : WICRawToneCurvePoint (+8, 16byte)  varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global WICRawToneCurvePoint
    #field double Input
    #field double Output
#endstruct

#defstruct global WICRawToneCurve
    #field int cPoints
    #field WICRawToneCurvePoint aPoints 1
#endstruct

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