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

glPixelTransferf

関数
ピクセル転送時の変換係数を浮動小数点値で設定する。
DLLOPENGL32.dll呼出規約winapi

シグネチャ

// OPENGL32.dll
#include <windows.h>

void glPixelTransferf(
    DWORD pname,
    FLOAT param1
);

パラメーター

名前方向
pnameDWORDin
param1FLOATin

戻り値の型: void

各言語での呼び出し定義

// OPENGL32.dll
#include <windows.h>

void glPixelTransferf(
    DWORD pname,
    FLOAT param1
);
[DllImport("OPENGL32.dll", ExactSpelling = true)]
static extern void glPixelTransferf(
    uint pname,   // DWORD
    float param1   // FLOAT
);
<DllImport("OPENGL32.dll", ExactSpelling:=True)>
Public Shared Sub glPixelTransferf(
    pname As UInteger,   ' DWORD
    param1 As Single   ' FLOAT
)
End Sub
' pname : DWORD
' param1 : FLOAT
Declare PtrSafe Sub glPixelTransferf Lib "opengl32" ( _
    ByVal pname As Long, _
    ByVal param1 As Single)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

glPixelTransferf = ctypes.windll.opengl32.glPixelTransferf
glPixelTransferf.restype = None
glPixelTransferf.argtypes = [
    wintypes.DWORD,  # pname : DWORD
    ctypes.c_float,  # param1 : FLOAT
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('OPENGL32.dll')
glPixelTransferf = Fiddle::Function.new(
  lib['glPixelTransferf'],
  [
    -Fiddle::TYPE_INT,  # pname : DWORD
    Fiddle::TYPE_FLOAT,  # param1 : FLOAT
  ],
  Fiddle::TYPE_VOID)
#[link(name = "opengl32")]
extern "system" {
    fn glPixelTransferf(
        pname: u32,  // DWORD
        param1: f32  // FLOAT
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("OPENGL32.dll")]
public static extern void glPixelTransferf(uint pname, float param1);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OPENGL32_glPixelTransferf' -Namespace Win32 -PassThru
# $api::glPixelTransferf(pname, param1)
#uselib "OPENGL32.dll"
#func global glPixelTransferf "glPixelTransferf" sptr, float
; glPixelTransferf pname, param1
; pname : DWORD -> "sptr"
; param1 : FLOAT -> "float"
#uselib "OPENGL32.dll"
#func global glPixelTransferf "glPixelTransferf" int, float
; glPixelTransferf pname, param1
; pname : DWORD -> "int"
; param1 : FLOAT -> "float"
; void glPixelTransferf(DWORD pname, FLOAT param1)
#uselib "OPENGL32.dll"
#func global glPixelTransferf "glPixelTransferf" int, float
; glPixelTransferf pname, param1
; pname : DWORD -> "int"
; param1 : FLOAT -> "float"
import (
	"math"
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procglPixelTransferf = opengl32.NewProc("glPixelTransferf")
)

// pname (DWORD), param1 (FLOAT)
r1, _, err := procglPixelTransferf.Call(
	uintptr(pname),
	uintptr(math.Float32bits(param1)),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
// 注意: float/double 引数は proc.Call では XMM レジスタに渡せません。
// windows.SyscallN(proc.Addr(), math.Float64bits(x), ...) もしくは cgo を使用してください。
procedure glPixelTransferf(
  pname: DWORD;   // DWORD
  param1: Single   // FLOAT
); stdcall;
  external 'OPENGL32.dll' name 'glPixelTransferf';
result := DllCall("OPENGL32\glPixelTransferf"
    , "UInt", pname   ; DWORD
    , "Float", param1   ; FLOAT
    , "Int")   ; return: void
●glPixelTransferf(pname, param1) = DLL("OPENGL32.dll", "int glPixelTransferf(dword, float)")
# 呼び出し: glPixelTransferf(pname, param1)
# pname : DWORD -> "dword"
# param1 : FLOAT -> "float"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。