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

TA_CUBIC_BEZIER

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

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

フィールド

フィールドサイズx64x86説明
headerTA_TIMINGFUNCTION4+0+0基本タイミング関数情報(TA_TIMINGFUNCTION)。
rX0FLOAT4+4+41番目の制御点のX座標。
rY0FLOAT4+8+81番目の制御点のY座標。
rX1FLOAT4+12+122番目の制御点のX座標。
rY1FLOAT4+16+162番目の制御点のY座標。

各言語での定義

#include <windows.h>

// TA_TIMINGFUNCTION  (x64 4 / x86 4 バイト)
typedef struct TA_TIMINGFUNCTION {
    TA_TIMINGFUNCTION_TYPE eTimingFunctionType;
} TA_TIMINGFUNCTION;

// TA_CUBIC_BEZIER  (x64 20 / x86 20 バイト)
typedef struct TA_CUBIC_BEZIER {
    TA_TIMINGFUNCTION header;
    FLOAT rX0;
    FLOAT rY0;
    FLOAT rX1;
    FLOAT rY1;
} TA_CUBIC_BEZIER;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TA_TIMINGFUNCTION
{
    public int eTimingFunctionType;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TA_CUBIC_BEZIER
{
    public TA_TIMINGFUNCTION header;
    public float rX0;
    public float rY0;
    public float rX1;
    public float rY1;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TA_TIMINGFUNCTION
    Public eTimingFunctionType As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TA_CUBIC_BEZIER
    Public header As TA_TIMINGFUNCTION
    Public rX0 As Single
    Public rY0 As Single
    Public rX1 As Single
    Public rY1 As Single
End Structure
import ctypes
from ctypes import wintypes

class TA_TIMINGFUNCTION(ctypes.Structure):
    _fields_ = [
        ("eTimingFunctionType", ctypes.c_int),
    ]

class TA_CUBIC_BEZIER(ctypes.Structure):
    _fields_ = [
        ("header", TA_TIMINGFUNCTION),
        ("rX0", ctypes.c_float),
        ("rY0", ctypes.c_float),
        ("rX1", ctypes.c_float),
        ("rY1", ctypes.c_float),
    ]
#[repr(C)]
pub struct TA_TIMINGFUNCTION {
    pub eTimingFunctionType: i32,
}

#[repr(C)]
pub struct TA_CUBIC_BEZIER {
    pub header: TA_TIMINGFUNCTION,
    pub rX0: f32,
    pub rY0: f32,
    pub rX1: f32,
    pub rY1: f32,
}
import "golang.org/x/sys/windows"

type TA_TIMINGFUNCTION struct {
	eTimingFunctionType int32
}

type TA_CUBIC_BEZIER struct {
	header TA_TIMINGFUNCTION
	rX0 float32
	rY0 float32
	rX1 float32
	rY1 float32
}
type
  TA_TIMINGFUNCTION = record
    eTimingFunctionType: Integer;
  end;

  TA_CUBIC_BEZIER = record
    header: TA_TIMINGFUNCTION;
    rX0: Single;
    rY0: Single;
    rX1: Single;
    rY1: Single;
  end;
const TA_TIMINGFUNCTION = extern struct {
    eTimingFunctionType: i32,
};

const TA_CUBIC_BEZIER = extern struct {
    header: TA_TIMINGFUNCTION,
    rX0: f32,
    rY0: f32,
    rX1: f32,
    rY1: f32,
};
type
  TA_TIMINGFUNCTION {.bycopy.} = object
    eTimingFunctionType: int32

  TA_CUBIC_BEZIER {.bycopy.} = object
    header: TA_TIMINGFUNCTION
    rX0: float32
    rY0: float32
    rX1: float32
    rY1: float32
struct TA_TIMINGFUNCTION
{
    int eTimingFunctionType;
}

struct TA_CUBIC_BEZIER
{
    TA_TIMINGFUNCTION header;
    float rX0;
    float rY0;
    float rX1;
    float rY1;
}

HSP用 定義

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

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

#defstruct global TA_CUBIC_BEZIER
    #field TA_TIMINGFUNCTION header
    #field float rX0
    #field float rY0
    #field float rX1
    #field float rY1
#endstruct

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