ホーム › Graphics.OpenGL › gluScaleImage
gluScaleImage
関数画像データを指定サイズへ拡大縮小して変換する。
シグネチャ
// GLU32.dll
#include <windows.h>
INT gluScaleImage(
DWORD format,
INT widthin,
INT heightin,
DWORD typein,
const void* datain,
INT widthout,
INT heightout,
DWORD typeout,
void* dataout
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| format | DWORD | in |
| widthin | INT | in |
| heightin | INT | in |
| typein | DWORD | in |
| datain | void* | in |
| widthout | INT | in |
| heightout | INT | in |
| typeout | DWORD | in |
| dataout | void* | inout |
戻り値の型: INT
各言語での呼び出し定義
// GLU32.dll
#include <windows.h>
INT gluScaleImage(
DWORD format,
INT widthin,
INT heightin,
DWORD typein,
const void* datain,
INT widthout,
INT heightout,
DWORD typeout,
void* dataout
);[DllImport("GLU32.dll", ExactSpelling = true)]
static extern int gluScaleImage(
uint format, // DWORD
int widthin, // INT
int heightin, // INT
uint typein, // DWORD
IntPtr datain, // void*
int widthout, // INT
int heightout, // INT
uint typeout, // DWORD
IntPtr dataout // void* in/out
);<DllImport("GLU32.dll", ExactSpelling:=True)>
Public Shared Function gluScaleImage(
format As UInteger, ' DWORD
widthin As Integer, ' INT
heightin As Integer, ' INT
typein As UInteger, ' DWORD
datain As IntPtr, ' void*
widthout As Integer, ' INT
heightout As Integer, ' INT
typeout As UInteger, ' DWORD
dataout As IntPtr ' void* in/out
) As Integer
End Function' format : DWORD
' widthin : INT
' heightin : INT
' typein : DWORD
' datain : void*
' widthout : INT
' heightout : INT
' typeout : DWORD
' dataout : void* in/out
Declare PtrSafe Function gluScaleImage Lib "glu32" ( _
ByVal format As Long, _
ByVal widthin As Long, _
ByVal heightin As Long, _
ByVal typein As Long, _
ByVal datain As LongPtr, _
ByVal widthout As Long, _
ByVal heightout As Long, _
ByVal typeout As Long, _
ByVal dataout As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
gluScaleImage = ctypes.windll.glu32.gluScaleImage
gluScaleImage.restype = ctypes.c_int
gluScaleImage.argtypes = [
wintypes.DWORD, # format : DWORD
ctypes.c_int, # widthin : INT
ctypes.c_int, # heightin : INT
wintypes.DWORD, # typein : DWORD
ctypes.POINTER(None), # datain : void*
ctypes.c_int, # widthout : INT
ctypes.c_int, # heightout : INT
wintypes.DWORD, # typeout : DWORD
ctypes.POINTER(None), # dataout : void* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('GLU32.dll')
gluScaleImage = Fiddle::Function.new(
lib['gluScaleImage'],
[
-Fiddle::TYPE_INT, # format : DWORD
Fiddle::TYPE_INT, # widthin : INT
Fiddle::TYPE_INT, # heightin : INT
-Fiddle::TYPE_INT, # typein : DWORD
Fiddle::TYPE_VOIDP, # datain : void*
Fiddle::TYPE_INT, # widthout : INT
Fiddle::TYPE_INT, # heightout : INT
-Fiddle::TYPE_INT, # typeout : DWORD
Fiddle::TYPE_VOIDP, # dataout : void* in/out
],
Fiddle::TYPE_INT)#[link(name = "glu32")]
extern "system" {
fn gluScaleImage(
format: u32, // DWORD
widthin: i32, // INT
heightin: i32, // INT
typein: u32, // DWORD
datain: *const (), // void*
widthout: i32, // INT
heightout: i32, // INT
typeout: u32, // DWORD
dataout: *mut () // void* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("GLU32.dll")]
public static extern int gluScaleImage(uint format, int widthin, int heightin, uint typein, IntPtr datain, int widthout, int heightout, uint typeout, IntPtr dataout);
"@
$api = Add-Type -MemberDefinition $sig -Name 'GLU32_gluScaleImage' -Namespace Win32 -PassThru
# $api::gluScaleImage(format, widthin, heightin, typein, datain, widthout, heightout, typeout, dataout)#uselib "GLU32.dll"
#func global gluScaleImage "gluScaleImage" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; gluScaleImage format, widthin, heightin, typein, datain, widthout, heightout, typeout, dataout ; 戻り値は stat
; format : DWORD -> "sptr"
; widthin : INT -> "sptr"
; heightin : INT -> "sptr"
; typein : DWORD -> "sptr"
; datain : void* -> "sptr"
; widthout : INT -> "sptr"
; heightout : INT -> "sptr"
; typeout : DWORD -> "sptr"
; dataout : void* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "GLU32.dll"
#cfunc global gluScaleImage "gluScaleImage" int, int, int, int, sptr, int, int, int, sptr
; res = gluScaleImage(format, widthin, heightin, typein, datain, widthout, heightout, typeout, dataout)
; format : DWORD -> "int"
; widthin : INT -> "int"
; heightin : INT -> "int"
; typein : DWORD -> "int"
; datain : void* -> "sptr"
; widthout : INT -> "int"
; heightout : INT -> "int"
; typeout : DWORD -> "int"
; dataout : void* in/out -> "sptr"; INT gluScaleImage(DWORD format, INT widthin, INT heightin, DWORD typein, void* datain, INT widthout, INT heightout, DWORD typeout, void* dataout)
#uselib "GLU32.dll"
#cfunc global gluScaleImage "gluScaleImage" int, int, int, int, intptr, int, int, int, intptr
; res = gluScaleImage(format, widthin, heightin, typein, datain, widthout, heightout, typeout, dataout)
; format : DWORD -> "int"
; widthin : INT -> "int"
; heightin : INT -> "int"
; typein : DWORD -> "int"
; datain : void* -> "intptr"
; widthout : INT -> "int"
; heightout : INT -> "int"
; typeout : DWORD -> "int"
; dataout : void* in/out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
glu32 = windows.NewLazySystemDLL("GLU32.dll")
procgluScaleImage = glu32.NewProc("gluScaleImage")
)
// format (DWORD), widthin (INT), heightin (INT), typein (DWORD), datain (void*), widthout (INT), heightout (INT), typeout (DWORD), dataout (void* in/out)
r1, _, err := procgluScaleImage.Call(
uintptr(format),
uintptr(widthin),
uintptr(heightin),
uintptr(typein),
uintptr(datain),
uintptr(widthout),
uintptr(heightout),
uintptr(typeout),
uintptr(dataout),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction gluScaleImage(
format: DWORD; // DWORD
widthin: Integer; // INT
heightin: Integer; // INT
typein: DWORD; // DWORD
datain: Pointer; // void*
widthout: Integer; // INT
heightout: Integer; // INT
typeout: DWORD; // DWORD
dataout: Pointer // void* in/out
): Integer; stdcall;
external 'GLU32.dll' name 'gluScaleImage';result := DllCall("GLU32\gluScaleImage"
, "UInt", format ; DWORD
, "Int", widthin ; INT
, "Int", heightin ; INT
, "UInt", typein ; DWORD
, "Ptr", datain ; void*
, "Int", widthout ; INT
, "Int", heightout ; INT
, "UInt", typeout ; DWORD
, "Ptr", dataout ; void* in/out
, "Int") ; return: INT●gluScaleImage(format, widthin, heightin, typein, datain, widthout, heightout, typeout, dataout) = DLL("GLU32.dll", "int gluScaleImage(dword, int, int, dword, void*, int, int, dword, void*)")
# 呼び出し: gluScaleImage(format, widthin, heightin, typein, datain, widthout, heightout, typeout, dataout)
# format : DWORD -> "dword"
# widthin : INT -> "int"
# heightin : INT -> "int"
# typein : DWORD -> "dword"
# datain : void* -> "void*"
# widthout : INT -> "int"
# heightout : INT -> "int"
# typeout : DWORD -> "dword"
# dataout : void* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。