ホーム › Devices.Display › XFORMOBJ_bApplyXform
XFORMOBJ_bApplyXform
関数変換オブジェクトの行列を点群に適用して変換する。
シグネチャ
// GDI32.dll
#include <windows.h>
BOOL XFORMOBJ_bApplyXform(
XFORMOBJ* pxo,
DWORD iMode,
DWORD cPoints,
void* pvIn,
void* pvOut
);パラメーター
| 名前 | 型 | 方向 | 説明 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| pxo | XFORMOBJ* | inout | pvIn 配列に適用する変換を定義する XFORMOBJ 構造体へのポインターです。 | ||||||||||
| iMode | DWORD | in | 変換、ならびに入力および出力のデータ型を指定します。このパラメーターには、次のいずれかを指定できます。
| ||||||||||
| cPoints | DWORD | in | 変換する pvIn 内の点の個数を指定します。 | ||||||||||
| pvIn | void* | inout | 入力点の配列へのポインターです。点の形式は iMode パラメーターによって指定されます。 | ||||||||||
| pvOut | void* | inout | 変換後の点を受け取るバッファーへのポインターです。点の形式は iMode パラメーターによって指定されます。 |
戻り値の型: BOOL
公式ドキュメント
XFORMOBJ_bApplyXform 関数は、指定された変換またはその逆変換を、指定された点の配列に適用します。
戻り値
すべての点がオーバーフローなく変換された場合、戻り値は TRUE です。pxo、pvIn、または pvOut が null の場合、あるいは変換中にオーバーフローが発生した場合は FALSE が返されます。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// GDI32.dll
#include <windows.h>
BOOL XFORMOBJ_bApplyXform(
XFORMOBJ* pxo,
DWORD iMode,
DWORD cPoints,
void* pvIn,
void* pvOut
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("GDI32.dll", ExactSpelling = true)]
static extern bool XFORMOBJ_bApplyXform(
IntPtr pxo, // XFORMOBJ* in/out
uint iMode, // DWORD
uint cPoints, // DWORD
IntPtr pvIn, // void* in/out
IntPtr pvOut // void* in/out
);<DllImport("GDI32.dll", ExactSpelling:=True)>
Public Shared Function XFORMOBJ_bApplyXform(
pxo As IntPtr, ' XFORMOBJ* in/out
iMode As UInteger, ' DWORD
cPoints As UInteger, ' DWORD
pvIn As IntPtr, ' void* in/out
pvOut As IntPtr ' void* in/out
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function' pxo : XFORMOBJ* in/out
' iMode : DWORD
' cPoints : DWORD
' pvIn : void* in/out
' pvOut : void* in/out
Declare PtrSafe Function XFORMOBJ_bApplyXform Lib "gdi32" ( _
ByVal pxo As LongPtr, _
ByVal iMode As Long, _
ByVal cPoints As Long, _
ByVal pvIn As LongPtr, _
ByVal pvOut As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
XFORMOBJ_bApplyXform = ctypes.windll.gdi32.XFORMOBJ_bApplyXform
XFORMOBJ_bApplyXform.restype = wintypes.BOOL
XFORMOBJ_bApplyXform.argtypes = [
ctypes.c_void_p, # pxo : XFORMOBJ* in/out
wintypes.DWORD, # iMode : DWORD
wintypes.DWORD, # cPoints : DWORD
ctypes.POINTER(None), # pvIn : void* in/out
ctypes.POINTER(None), # pvOut : void* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('GDI32.dll')
XFORMOBJ_bApplyXform = Fiddle::Function.new(
lib['XFORMOBJ_bApplyXform'],
[
Fiddle::TYPE_VOIDP, # pxo : XFORMOBJ* in/out
-Fiddle::TYPE_INT, # iMode : DWORD
-Fiddle::TYPE_INT, # cPoints : DWORD
Fiddle::TYPE_VOIDP, # pvIn : void* in/out
Fiddle::TYPE_VOIDP, # pvOut : void* in/out
],
Fiddle::TYPE_INT)#[link(name = "gdi32")]
extern "system" {
fn XFORMOBJ_bApplyXform(
pxo: *mut XFORMOBJ, // XFORMOBJ* in/out
iMode: u32, // DWORD
cPoints: u32, // DWORD
pvIn: *mut (), // void* in/out
pvOut: *mut () // void* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("GDI32.dll")]
public static extern bool XFORMOBJ_bApplyXform(IntPtr pxo, uint iMode, uint cPoints, IntPtr pvIn, IntPtr pvOut);
"@
$api = Add-Type -MemberDefinition $sig -Name 'GDI32_XFORMOBJ_bApplyXform' -Namespace Win32 -PassThru
# $api::XFORMOBJ_bApplyXform(pxo, iMode, cPoints, pvIn, pvOut)#uselib "GDI32.dll"
#func global XFORMOBJ_bApplyXform "XFORMOBJ_bApplyXform" sptr, sptr, sptr, sptr, sptr
; XFORMOBJ_bApplyXform varptr(pxo), iMode, cPoints, pvIn, pvOut ; 戻り値は stat
; pxo : XFORMOBJ* in/out -> "sptr"
; iMode : DWORD -> "sptr"
; cPoints : DWORD -> "sptr"
; pvIn : void* in/out -> "sptr"
; pvOut : void* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "GDI32.dll" #cfunc global XFORMOBJ_bApplyXform "XFORMOBJ_bApplyXform" var, int, int, sptr, sptr ; res = XFORMOBJ_bApplyXform(pxo, iMode, cPoints, pvIn, pvOut) ; pxo : XFORMOBJ* in/out -> "var" ; iMode : DWORD -> "int" ; cPoints : DWORD -> "int" ; pvIn : void* in/out -> "sptr" ; pvOut : void* in/out -> "sptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "GDI32.dll" #cfunc global XFORMOBJ_bApplyXform "XFORMOBJ_bApplyXform" sptr, int, int, sptr, sptr ; res = XFORMOBJ_bApplyXform(varptr(pxo), iMode, cPoints, pvIn, pvOut) ; pxo : XFORMOBJ* in/out -> "sptr" ; iMode : DWORD -> "int" ; cPoints : DWORD -> "int" ; pvIn : void* in/out -> "sptr" ; pvOut : void* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; BOOL XFORMOBJ_bApplyXform(XFORMOBJ* pxo, DWORD iMode, DWORD cPoints, void* pvIn, void* pvOut) #uselib "GDI32.dll" #cfunc global XFORMOBJ_bApplyXform "XFORMOBJ_bApplyXform" var, int, int, intptr, intptr ; res = XFORMOBJ_bApplyXform(pxo, iMode, cPoints, pvIn, pvOut) ; pxo : XFORMOBJ* in/out -> "var" ; iMode : DWORD -> "int" ; cPoints : DWORD -> "int" ; pvIn : void* in/out -> "intptr" ; pvOut : void* in/out -> "intptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL XFORMOBJ_bApplyXform(XFORMOBJ* pxo, DWORD iMode, DWORD cPoints, void* pvIn, void* pvOut) #uselib "GDI32.dll" #cfunc global XFORMOBJ_bApplyXform "XFORMOBJ_bApplyXform" intptr, int, int, intptr, intptr ; res = XFORMOBJ_bApplyXform(varptr(pxo), iMode, cPoints, pvIn, pvOut) ; pxo : XFORMOBJ* in/out -> "intptr" ; iMode : DWORD -> "int" ; cPoints : DWORD -> "int" ; pvIn : void* in/out -> "intptr" ; pvOut : void* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdi32 = windows.NewLazySystemDLL("GDI32.dll")
procXFORMOBJ_bApplyXform = gdi32.NewProc("XFORMOBJ_bApplyXform")
)
// pxo (XFORMOBJ* in/out), iMode (DWORD), cPoints (DWORD), pvIn (void* in/out), pvOut (void* in/out)
r1, _, err := procXFORMOBJ_bApplyXform.Call(
uintptr(pxo),
uintptr(iMode),
uintptr(cPoints),
uintptr(pvIn),
uintptr(pvOut),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction XFORMOBJ_bApplyXform(
pxo: Pointer; // XFORMOBJ* in/out
iMode: DWORD; // DWORD
cPoints: DWORD; // DWORD
pvIn: Pointer; // void* in/out
pvOut: Pointer // void* in/out
): BOOL; stdcall;
external 'GDI32.dll' name 'XFORMOBJ_bApplyXform';result := DllCall("GDI32\XFORMOBJ_bApplyXform"
, "Ptr", pxo ; XFORMOBJ* in/out
, "UInt", iMode ; DWORD
, "UInt", cPoints ; DWORD
, "Ptr", pvIn ; void* in/out
, "Ptr", pvOut ; void* in/out
, "Int") ; return: BOOL●XFORMOBJ_bApplyXform(pxo, iMode, cPoints, pvIn, pvOut) = DLL("GDI32.dll", "bool XFORMOBJ_bApplyXform(void*, dword, dword, void*, void*)")
# 呼び出し: XFORMOBJ_bApplyXform(pxo, iMode, cPoints, pvIn, pvOut)
# pxo : XFORMOBJ* in/out -> "void*"
# iMode : DWORD -> "dword"
# cPoints : DWORD -> "dword"
# pvIn : void* in/out -> "void*"
# pvOut : void* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "gdi32" fn XFORMOBJ_bApplyXform(
pxo: [*c]XFORMOBJ, // XFORMOBJ* in/out
iMode: u32, // DWORD
cPoints: u32, // DWORD
pvIn: ?*anyopaque, // void* in/out
pvOut: ?*anyopaque // void* in/out
) callconv(std.os.windows.WINAPI) i32;proc XFORMOBJ_bApplyXform(
pxo: ptr XFORMOBJ, # XFORMOBJ* in/out
iMode: uint32, # DWORD
cPoints: uint32, # DWORD
pvIn: pointer, # void* in/out
pvOut: pointer # void* in/out
): int32 {.importc: "XFORMOBJ_bApplyXform", stdcall, dynlib: "GDI32.dll".}pragma(lib, "gdi32");
extern(Windows)
int XFORMOBJ_bApplyXform(
XFORMOBJ* pxo, // XFORMOBJ* in/out
uint iMode, // DWORD
uint cPoints, // DWORD
void* pvIn, // void* in/out
void* pvOut // void* in/out
);ccall((:XFORMOBJ_bApplyXform, "GDI32.dll"), stdcall, Int32,
(Ptr{XFORMOBJ}, UInt32, UInt32, Ptr{Cvoid}, Ptr{Cvoid}),
pxo, iMode, cPoints, pvIn, pvOut)
# pxo : XFORMOBJ* in/out -> Ptr{XFORMOBJ}
# iMode : DWORD -> UInt32
# cPoints : DWORD -> UInt32
# pvIn : void* in/out -> Ptr{Cvoid}
# pvOut : void* in/out -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t XFORMOBJ_bApplyXform(
void* pxo,
uint32_t iMode,
uint32_t cPoints,
void* pvIn,
void* pvOut);
]]
local gdi32 = ffi.load("gdi32")
-- gdi32.XFORMOBJ_bApplyXform(pxo, iMode, cPoints, pvIn, pvOut)
-- pxo : XFORMOBJ* in/out
-- iMode : DWORD
-- cPoints : DWORD
-- pvIn : void* in/out
-- pvOut : void* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('GDI32.dll');
const XFORMOBJ_bApplyXform = lib.func('__stdcall', 'XFORMOBJ_bApplyXform', 'int32_t', ['void *', 'uint32_t', 'uint32_t', 'void *', 'void *']);
// XFORMOBJ_bApplyXform(pxo, iMode, cPoints, pvIn, pvOut)
// pxo : XFORMOBJ* in/out -> 'void *'
// iMode : DWORD -> 'uint32_t'
// cPoints : DWORD -> 'uint32_t'
// pvIn : void* in/out -> 'void *'
// pvOut : void* in/out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("GDI32.dll", {
XFORMOBJ_bApplyXform: { parameters: ["pointer", "u32", "u32", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.XFORMOBJ_bApplyXform(pxo, iMode, cPoints, pvIn, pvOut)
// pxo : XFORMOBJ* in/out -> "pointer"
// iMode : DWORD -> "u32"
// cPoints : DWORD -> "u32"
// pvIn : void* in/out -> "pointer"
// pvOut : void* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t XFORMOBJ_bApplyXform(
void* pxo,
uint32_t iMode,
uint32_t cPoints,
void* pvIn,
void* pvOut);
C, "GDI32.dll");
// $ffi->XFORMOBJ_bApplyXform(pxo, iMode, cPoints, pvIn, pvOut);
// pxo : XFORMOBJ* in/out
// iMode : DWORD
// cPoints : DWORD
// pvIn : void* in/out
// pvOut : void* in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Gdi32 extends StdCallLibrary {
Gdi32 INSTANCE = Native.load("gdi32", Gdi32.class);
boolean XFORMOBJ_bApplyXform(
Pointer pxo, // XFORMOBJ* in/out
int iMode, // DWORD
int cPoints, // DWORD
Pointer pvIn, // void* in/out
Pointer pvOut // void* in/out
);
}@[Link("gdi32")]
lib LibGDI32
fun XFORMOBJ_bApplyXform = XFORMOBJ_bApplyXform(
pxo : XFORMOBJ*, # XFORMOBJ* in/out
iMode : UInt32, # DWORD
cPoints : UInt32, # DWORD
pvIn : Void*, # void* in/out
pvOut : Void* # void* in/out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef XFORMOBJ_bApplyXformNative = Int32 Function(Pointer<Void>, Uint32, Uint32, Pointer<Void>, Pointer<Void>);
typedef XFORMOBJ_bApplyXformDart = int Function(Pointer<Void>, int, int, Pointer<Void>, Pointer<Void>);
final XFORMOBJ_bApplyXform = DynamicLibrary.open('GDI32.dll')
.lookupFunction<XFORMOBJ_bApplyXformNative, XFORMOBJ_bApplyXformDart>('XFORMOBJ_bApplyXform');
// pxo : XFORMOBJ* in/out -> Pointer<Void>
// iMode : DWORD -> Uint32
// cPoints : DWORD -> Uint32
// pvIn : void* in/out -> Pointer<Void>
// pvOut : void* in/out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function XFORMOBJ_bApplyXform(
pxo: Pointer; // XFORMOBJ* in/out
iMode: DWORD; // DWORD
cPoints: DWORD; // DWORD
pvIn: Pointer; // void* in/out
pvOut: Pointer // void* in/out
): BOOL; stdcall;
external 'GDI32.dll' name 'XFORMOBJ_bApplyXform';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "XFORMOBJ_bApplyXform"
c_XFORMOBJ_bApplyXform :: Ptr () -> Word32 -> Word32 -> Ptr () -> Ptr () -> IO CInt
-- pxo : XFORMOBJ* in/out -> Ptr ()
-- iMode : DWORD -> Word32
-- cPoints : DWORD -> Word32
-- pvIn : void* in/out -> Ptr ()
-- pvOut : void* in/out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let xformobj_bapplyxform =
foreign "XFORMOBJ_bApplyXform"
((ptr void) @-> uint32_t @-> uint32_t @-> (ptr void) @-> (ptr void) @-> returning int32_t)
(* pxo : XFORMOBJ* in/out -> (ptr void) *)
(* iMode : DWORD -> uint32_t *)
(* cPoints : DWORD -> uint32_t *)
(* pvIn : void* in/out -> (ptr void) *)
(* pvOut : void* in/out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library gdi32 (t "GDI32.dll"))
(cffi:use-foreign-library gdi32)
(cffi:defcfun ("XFORMOBJ_bApplyXform" xformobj-b-apply-xform :convention :stdcall) :int32
(pxo :pointer) ; XFORMOBJ* in/out
(i-mode :uint32) ; DWORD
(c-points :uint32) ; DWORD
(pv-in :pointer) ; void* in/out
(pv-out :pointer)) ; void* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $XFORMOBJ_bApplyXform = Win32::API::More->new('GDI32',
'BOOL XFORMOBJ_bApplyXform(LPVOID pxo, DWORD iMode, DWORD cPoints, LPVOID pvIn, LPVOID pvOut)');
# my $ret = $XFORMOBJ_bApplyXform->Call($pxo, $iMode, $cPoints, $pvIn, $pvOut);
# pxo : XFORMOBJ* in/out -> LPVOID
# iMode : DWORD -> DWORD
# cPoints : DWORD -> DWORD
# pvIn : void* in/out -> LPVOID
# pvOut : void* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
使用する型