ホーム › UI.ColorSystem › GetPS2ColorRenderingIntent
GetPS2ColorRenderingIntent
関数プロファイルからPostScript2色再現インテントを取得する。
シグネチャ
// mscms.dll
#include <windows.h>
BOOL GetPS2ColorRenderingIntent(
INT_PTR hProfile,
DWORD dwIntent,
BYTE* pBuffer, // optional
DWORD* pcbPS2ColorRenderingIntent
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hProfile | INT_PTR | in |
| dwIntent | DWORD | in |
| pBuffer | BYTE* | outoptional |
| pcbPS2ColorRenderingIntent | DWORD* | inout |
戻り値の型: BOOL
各言語での呼び出し定義
// mscms.dll
#include <windows.h>
BOOL GetPS2ColorRenderingIntent(
INT_PTR hProfile,
DWORD dwIntent,
BYTE* pBuffer, // optional
DWORD* pcbPS2ColorRenderingIntent
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("mscms.dll", ExactSpelling = true)]
static extern bool GetPS2ColorRenderingIntent(
IntPtr hProfile, // INT_PTR
uint dwIntent, // DWORD
IntPtr pBuffer, // BYTE* optional, out
ref uint pcbPS2ColorRenderingIntent // DWORD* in/out
);<DllImport("mscms.dll", ExactSpelling:=True)>
Public Shared Function GetPS2ColorRenderingIntent(
hProfile As IntPtr, ' INT_PTR
dwIntent As UInteger, ' DWORD
pBuffer As IntPtr, ' BYTE* optional, out
ByRef pcbPS2ColorRenderingIntent As UInteger ' DWORD* in/out
) As Boolean
End Function' hProfile : INT_PTR
' dwIntent : DWORD
' pBuffer : BYTE* optional, out
' pcbPS2ColorRenderingIntent : DWORD* in/out
Declare PtrSafe Function GetPS2ColorRenderingIntent Lib "mscms" ( _
ByVal hProfile As LongPtr, _
ByVal dwIntent As Long, _
ByVal pBuffer As LongPtr, _
ByRef pcbPS2ColorRenderingIntent As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetPS2ColorRenderingIntent = ctypes.windll.mscms.GetPS2ColorRenderingIntent
GetPS2ColorRenderingIntent.restype = wintypes.BOOL
GetPS2ColorRenderingIntent.argtypes = [
ctypes.c_ssize_t, # hProfile : INT_PTR
wintypes.DWORD, # dwIntent : DWORD
ctypes.POINTER(ctypes.c_ubyte), # pBuffer : BYTE* optional, out
ctypes.POINTER(wintypes.DWORD), # pcbPS2ColorRenderingIntent : DWORD* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('mscms.dll')
GetPS2ColorRenderingIntent = Fiddle::Function.new(
lib['GetPS2ColorRenderingIntent'],
[
Fiddle::TYPE_INTPTR_T, # hProfile : INT_PTR
-Fiddle::TYPE_INT, # dwIntent : DWORD
Fiddle::TYPE_VOIDP, # pBuffer : BYTE* optional, out
Fiddle::TYPE_VOIDP, # pcbPS2ColorRenderingIntent : DWORD* in/out
],
Fiddle::TYPE_INT)#[link(name = "mscms")]
extern "system" {
fn GetPS2ColorRenderingIntent(
hProfile: isize, // INT_PTR
dwIntent: u32, // DWORD
pBuffer: *mut u8, // BYTE* optional, out
pcbPS2ColorRenderingIntent: *mut u32 // DWORD* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("mscms.dll")]
public static extern bool GetPS2ColorRenderingIntent(IntPtr hProfile, uint dwIntent, IntPtr pBuffer, ref uint pcbPS2ColorRenderingIntent);
"@
$api = Add-Type -MemberDefinition $sig -Name 'mscms_GetPS2ColorRenderingIntent' -Namespace Win32 -PassThru
# $api::GetPS2ColorRenderingIntent(hProfile, dwIntent, pBuffer, pcbPS2ColorRenderingIntent)#uselib "mscms.dll"
#func global GetPS2ColorRenderingIntent "GetPS2ColorRenderingIntent" sptr, sptr, sptr, sptr
; GetPS2ColorRenderingIntent hProfile, dwIntent, varptr(pBuffer), varptr(pcbPS2ColorRenderingIntent) ; 戻り値は stat
; hProfile : INT_PTR -> "sptr"
; dwIntent : DWORD -> "sptr"
; pBuffer : BYTE* optional, out -> "sptr"
; pcbPS2ColorRenderingIntent : DWORD* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "mscms.dll" #cfunc global GetPS2ColorRenderingIntent "GetPS2ColorRenderingIntent" sptr, int, var, var ; res = GetPS2ColorRenderingIntent(hProfile, dwIntent, pBuffer, pcbPS2ColorRenderingIntent) ; hProfile : INT_PTR -> "sptr" ; dwIntent : DWORD -> "int" ; pBuffer : BYTE* optional, out -> "var" ; pcbPS2ColorRenderingIntent : DWORD* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "mscms.dll" #cfunc global GetPS2ColorRenderingIntent "GetPS2ColorRenderingIntent" sptr, int, sptr, sptr ; res = GetPS2ColorRenderingIntent(hProfile, dwIntent, varptr(pBuffer), varptr(pcbPS2ColorRenderingIntent)) ; hProfile : INT_PTR -> "sptr" ; dwIntent : DWORD -> "int" ; pBuffer : BYTE* optional, out -> "sptr" ; pcbPS2ColorRenderingIntent : DWORD* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; BOOL GetPS2ColorRenderingIntent(INT_PTR hProfile, DWORD dwIntent, BYTE* pBuffer, DWORD* pcbPS2ColorRenderingIntent) #uselib "mscms.dll" #cfunc global GetPS2ColorRenderingIntent "GetPS2ColorRenderingIntent" intptr, int, var, var ; res = GetPS2ColorRenderingIntent(hProfile, dwIntent, pBuffer, pcbPS2ColorRenderingIntent) ; hProfile : INT_PTR -> "intptr" ; dwIntent : DWORD -> "int" ; pBuffer : BYTE* optional, out -> "var" ; pcbPS2ColorRenderingIntent : DWORD* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL GetPS2ColorRenderingIntent(INT_PTR hProfile, DWORD dwIntent, BYTE* pBuffer, DWORD* pcbPS2ColorRenderingIntent) #uselib "mscms.dll" #cfunc global GetPS2ColorRenderingIntent "GetPS2ColorRenderingIntent" intptr, int, intptr, intptr ; res = GetPS2ColorRenderingIntent(hProfile, dwIntent, varptr(pBuffer), varptr(pcbPS2ColorRenderingIntent)) ; hProfile : INT_PTR -> "intptr" ; dwIntent : DWORD -> "int" ; pBuffer : BYTE* optional, out -> "intptr" ; pcbPS2ColorRenderingIntent : DWORD* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
mscms = windows.NewLazySystemDLL("mscms.dll")
procGetPS2ColorRenderingIntent = mscms.NewProc("GetPS2ColorRenderingIntent")
)
// hProfile (INT_PTR), dwIntent (DWORD), pBuffer (BYTE* optional, out), pcbPS2ColorRenderingIntent (DWORD* in/out)
r1, _, err := procGetPS2ColorRenderingIntent.Call(
uintptr(hProfile),
uintptr(dwIntent),
uintptr(pBuffer),
uintptr(pcbPS2ColorRenderingIntent),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction GetPS2ColorRenderingIntent(
hProfile: NativeInt; // INT_PTR
dwIntent: DWORD; // DWORD
pBuffer: Pointer; // BYTE* optional, out
pcbPS2ColorRenderingIntent: Pointer // DWORD* in/out
): BOOL; stdcall;
external 'mscms.dll' name 'GetPS2ColorRenderingIntent';result := DllCall("mscms\GetPS2ColorRenderingIntent"
, "Ptr", hProfile ; INT_PTR
, "UInt", dwIntent ; DWORD
, "Ptr", pBuffer ; BYTE* optional, out
, "Ptr", pcbPS2ColorRenderingIntent ; DWORD* in/out
, "Int") ; return: BOOL●GetPS2ColorRenderingIntent(hProfile, dwIntent, pBuffer, pcbPS2ColorRenderingIntent) = DLL("mscms.dll", "bool GetPS2ColorRenderingIntent(int, dword, void*, void*)")
# 呼び出し: GetPS2ColorRenderingIntent(hProfile, dwIntent, pBuffer, pcbPS2ColorRenderingIntent)
# hProfile : INT_PTR -> "int"
# dwIntent : DWORD -> "dword"
# pBuffer : BYTE* optional, out -> "void*"
# pcbPS2ColorRenderingIntent : DWORD* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。