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

GetPS2ColorRenderingDictionary

関数
プロファイルからPostScript2色再現辞書を取得する。
DLLmscms.dll呼出規約winapi

シグネチャ

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

BOOL GetPS2ColorRenderingDictionary(
    INT_PTR hProfile,
    DWORD dwIntent,
    BYTE* pPS2ColorRenderingDictionary,   // optional
    DWORD* pcbPS2ColorRenderingDictionary,
    BOOL* pbBinary
);

パラメーター

名前方向
hProfileINT_PTRin
dwIntentDWORDin
pPS2ColorRenderingDictionaryBYTE*outoptional
pcbPS2ColorRenderingDictionaryDWORD*inout
pbBinaryBOOL*inout

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL GetPS2ColorRenderingDictionary(
    INT_PTR hProfile,
    DWORD dwIntent,
    BYTE* pPS2ColorRenderingDictionary,   // optional
    DWORD* pcbPS2ColorRenderingDictionary,
    BOOL* pbBinary
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("mscms.dll", ExactSpelling = true)]
static extern bool GetPS2ColorRenderingDictionary(
    IntPtr hProfile,   // INT_PTR
    uint dwIntent,   // DWORD
    IntPtr pPS2ColorRenderingDictionary,   // BYTE* optional, out
    ref uint pcbPS2ColorRenderingDictionary,   // DWORD* in/out
    ref int pbBinary   // BOOL* in/out
);
<DllImport("mscms.dll", ExactSpelling:=True)>
Public Shared Function GetPS2ColorRenderingDictionary(
    hProfile As IntPtr,   ' INT_PTR
    dwIntent As UInteger,   ' DWORD
    pPS2ColorRenderingDictionary As IntPtr,   ' BYTE* optional, out
    ByRef pcbPS2ColorRenderingDictionary As UInteger,   ' DWORD* in/out
    ByRef pbBinary As Integer   ' BOOL* in/out
) As Boolean
End Function
' hProfile : INT_PTR
' dwIntent : DWORD
' pPS2ColorRenderingDictionary : BYTE* optional, out
' pcbPS2ColorRenderingDictionary : DWORD* in/out
' pbBinary : BOOL* in/out
Declare PtrSafe Function GetPS2ColorRenderingDictionary Lib "mscms" ( _
    ByVal hProfile As LongPtr, _
    ByVal dwIntent As Long, _
    ByVal pPS2ColorRenderingDictionary As LongPtr, _
    ByRef pcbPS2ColorRenderingDictionary As Long, _
    ByRef pbBinary As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GetPS2ColorRenderingDictionary = ctypes.windll.mscms.GetPS2ColorRenderingDictionary
GetPS2ColorRenderingDictionary.restype = wintypes.BOOL
GetPS2ColorRenderingDictionary.argtypes = [
    ctypes.c_ssize_t,  # hProfile : INT_PTR
    wintypes.DWORD,  # dwIntent : DWORD
    ctypes.POINTER(ctypes.c_ubyte),  # pPS2ColorRenderingDictionary : BYTE* optional, out
    ctypes.POINTER(wintypes.DWORD),  # pcbPS2ColorRenderingDictionary : DWORD* in/out
    ctypes.c_void_p,  # pbBinary : BOOL* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('mscms.dll')
GetPS2ColorRenderingDictionary = Fiddle::Function.new(
  lib['GetPS2ColorRenderingDictionary'],
  [
    Fiddle::TYPE_INTPTR_T,  # hProfile : INT_PTR
    -Fiddle::TYPE_INT,  # dwIntent : DWORD
    Fiddle::TYPE_VOIDP,  # pPS2ColorRenderingDictionary : BYTE* optional, out
    Fiddle::TYPE_VOIDP,  # pcbPS2ColorRenderingDictionary : DWORD* in/out
    Fiddle::TYPE_VOIDP,  # pbBinary : BOOL* in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "mscms")]
extern "system" {
    fn GetPS2ColorRenderingDictionary(
        hProfile: isize,  // INT_PTR
        dwIntent: u32,  // DWORD
        pPS2ColorRenderingDictionary: *mut u8,  // BYTE* optional, out
        pcbPS2ColorRenderingDictionary: *mut u32,  // DWORD* in/out
        pbBinary: *mut i32  // BOOL* 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 GetPS2ColorRenderingDictionary(IntPtr hProfile, uint dwIntent, IntPtr pPS2ColorRenderingDictionary, ref uint pcbPS2ColorRenderingDictionary, ref int pbBinary);
"@
$api = Add-Type -MemberDefinition $sig -Name 'mscms_GetPS2ColorRenderingDictionary' -Namespace Win32 -PassThru
# $api::GetPS2ColorRenderingDictionary(hProfile, dwIntent, pPS2ColorRenderingDictionary, pcbPS2ColorRenderingDictionary, pbBinary)
#uselib "mscms.dll"
#func global GetPS2ColorRenderingDictionary "GetPS2ColorRenderingDictionary" sptr, sptr, sptr, sptr, sptr
; GetPS2ColorRenderingDictionary hProfile, dwIntent, varptr(pPS2ColorRenderingDictionary), varptr(pcbPS2ColorRenderingDictionary), pbBinary   ; 戻り値は stat
; hProfile : INT_PTR -> "sptr"
; dwIntent : DWORD -> "sptr"
; pPS2ColorRenderingDictionary : BYTE* optional, out -> "sptr"
; pcbPS2ColorRenderingDictionary : DWORD* in/out -> "sptr"
; pbBinary : BOOL* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "mscms.dll"
#cfunc global GetPS2ColorRenderingDictionary "GetPS2ColorRenderingDictionary" sptr, int, var, var, int
; res = GetPS2ColorRenderingDictionary(hProfile, dwIntent, pPS2ColorRenderingDictionary, pcbPS2ColorRenderingDictionary, pbBinary)
; hProfile : INT_PTR -> "sptr"
; dwIntent : DWORD -> "int"
; pPS2ColorRenderingDictionary : BYTE* optional, out -> "var"
; pcbPS2ColorRenderingDictionary : DWORD* in/out -> "var"
; pbBinary : BOOL* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; BOOL GetPS2ColorRenderingDictionary(INT_PTR hProfile, DWORD dwIntent, BYTE* pPS2ColorRenderingDictionary, DWORD* pcbPS2ColorRenderingDictionary, BOOL* pbBinary)
#uselib "mscms.dll"
#cfunc global GetPS2ColorRenderingDictionary "GetPS2ColorRenderingDictionary" intptr, int, var, var, int
; res = GetPS2ColorRenderingDictionary(hProfile, dwIntent, pPS2ColorRenderingDictionary, pcbPS2ColorRenderingDictionary, pbBinary)
; hProfile : INT_PTR -> "intptr"
; dwIntent : DWORD -> "int"
; pPS2ColorRenderingDictionary : BYTE* optional, out -> "var"
; pcbPS2ColorRenderingDictionary : DWORD* in/out -> "var"
; pbBinary : BOOL* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mscms = windows.NewLazySystemDLL("mscms.dll")
	procGetPS2ColorRenderingDictionary = mscms.NewProc("GetPS2ColorRenderingDictionary")
)

// hProfile (INT_PTR), dwIntent (DWORD), pPS2ColorRenderingDictionary (BYTE* optional, out), pcbPS2ColorRenderingDictionary (DWORD* in/out), pbBinary (BOOL* in/out)
r1, _, err := procGetPS2ColorRenderingDictionary.Call(
	uintptr(hProfile),
	uintptr(dwIntent),
	uintptr(pPS2ColorRenderingDictionary),
	uintptr(pcbPS2ColorRenderingDictionary),
	uintptr(pbBinary),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function GetPS2ColorRenderingDictionary(
  hProfile: NativeInt;   // INT_PTR
  dwIntent: DWORD;   // DWORD
  pPS2ColorRenderingDictionary: Pointer;   // BYTE* optional, out
  pcbPS2ColorRenderingDictionary: Pointer;   // DWORD* in/out
  pbBinary: Pointer   // BOOL* in/out
): BOOL; stdcall;
  external 'mscms.dll' name 'GetPS2ColorRenderingDictionary';
result := DllCall("mscms\GetPS2ColorRenderingDictionary"
    , "Ptr", hProfile   ; INT_PTR
    , "UInt", dwIntent   ; DWORD
    , "Ptr", pPS2ColorRenderingDictionary   ; BYTE* optional, out
    , "Ptr", pcbPS2ColorRenderingDictionary   ; DWORD* in/out
    , "Ptr", pbBinary   ; BOOL* in/out
    , "Int")   ; return: BOOL
●GetPS2ColorRenderingDictionary(hProfile, dwIntent, pPS2ColorRenderingDictionary, pcbPS2ColorRenderingDictionary, pbBinary) = DLL("mscms.dll", "bool GetPS2ColorRenderingDictionary(int, dword, void*, void*, void*)")
# 呼び出し: GetPS2ColorRenderingDictionary(hProfile, dwIntent, pPS2ColorRenderingDictionary, pcbPS2ColorRenderingDictionary, pbBinary)
# hProfile : INT_PTR -> "int"
# dwIntent : DWORD -> "dword"
# pPS2ColorRenderingDictionary : BYTE* optional, out -> "void*"
# pcbPS2ColorRenderingDictionary : DWORD* in/out -> "void*"
# pbBinary : BOOL* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。