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

CMTranslateRGBs

関数
CMMでRGBビットマップのビットを変換する。
DLLICM32.dll呼出規約winapi

シグネチャ

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

BOOL CMTranslateRGBs(
    INT_PTR hcmTransform,
    void* lpSrcBits,
    BMFORMAT bmInput,
    DWORD dwWidth,
    DWORD dwHeight,
    DWORD dwStride,
    void* lpDestBits,
    BMFORMAT bmOutput,
    DWORD dwTranslateDirection
);

パラメーター

名前方向説明
hcmTransformINT_PTRin適用するカラー変換のハンドル(CMM内部用)。
lpSrcBitsvoid*in変換元ビットマップのピクセルデータを指すポインタ。
bmInputBMFORMATin入力ビットマップのピクセルフォーマットを示す列挙値。
dwWidthDWORDinビットマップの幅(ピクセル数)。
dwHeightDWORDinビットマップの高さ(ピクセル数)。
dwStrideDWORDinビットマップ1走査線のバイト数(ストライド)。
lpDestBitsvoid*out変換後のピクセルデータを格納する出力バッファへのポインタ。
bmOutputBMFORMATin出力ビットマップのピクセルフォーマットを示す列挙値。
dwTranslateDirectionDWORDin色変換の方向(順方向/逆方向)を指定する値。

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL CMTranslateRGBs(
    INT_PTR hcmTransform,
    void* lpSrcBits,
    BMFORMAT bmInput,
    DWORD dwWidth,
    DWORD dwHeight,
    DWORD dwStride,
    void* lpDestBits,
    BMFORMAT bmOutput,
    DWORD dwTranslateDirection
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("ICM32.dll", ExactSpelling = true)]
static extern bool CMTranslateRGBs(
    IntPtr hcmTransform,   // INT_PTR
    IntPtr lpSrcBits,   // void*
    int bmInput,   // BMFORMAT
    uint dwWidth,   // DWORD
    uint dwHeight,   // DWORD
    uint dwStride,   // DWORD
    IntPtr lpDestBits,   // void* out
    int bmOutput,   // BMFORMAT
    uint dwTranslateDirection   // DWORD
);
<DllImport("ICM32.dll", ExactSpelling:=True)>
Public Shared Function CMTranslateRGBs(
    hcmTransform As IntPtr,   ' INT_PTR
    lpSrcBits As IntPtr,   ' void*
    bmInput As Integer,   ' BMFORMAT
    dwWidth As UInteger,   ' DWORD
    dwHeight As UInteger,   ' DWORD
    dwStride As UInteger,   ' DWORD
    lpDestBits As IntPtr,   ' void* out
    bmOutput As Integer,   ' BMFORMAT
    dwTranslateDirection As UInteger   ' DWORD
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
' hcmTransform : INT_PTR
' lpSrcBits : void*
' bmInput : BMFORMAT
' dwWidth : DWORD
' dwHeight : DWORD
' dwStride : DWORD
' lpDestBits : void* out
' bmOutput : BMFORMAT
' dwTranslateDirection : DWORD
Declare PtrSafe Function CMTranslateRGBs Lib "icm32" ( _
    ByVal hcmTransform As LongPtr, _
    ByVal lpSrcBits As LongPtr, _
    ByVal bmInput As Long, _
    ByVal dwWidth As Long, _
    ByVal dwHeight As Long, _
    ByVal dwStride As Long, _
    ByVal lpDestBits As LongPtr, _
    ByVal bmOutput As Long, _
    ByVal dwTranslateDirection As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

CMTranslateRGBs = ctypes.windll.icm32.CMTranslateRGBs
CMTranslateRGBs.restype = wintypes.BOOL
CMTranslateRGBs.argtypes = [
    ctypes.c_ssize_t,  # hcmTransform : INT_PTR
    ctypes.POINTER(None),  # lpSrcBits : void*
    ctypes.c_int,  # bmInput : BMFORMAT
    wintypes.DWORD,  # dwWidth : DWORD
    wintypes.DWORD,  # dwHeight : DWORD
    wintypes.DWORD,  # dwStride : DWORD
    ctypes.POINTER(None),  # lpDestBits : void* out
    ctypes.c_int,  # bmOutput : BMFORMAT
    wintypes.DWORD,  # dwTranslateDirection : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ICM32.dll')
CMTranslateRGBs = Fiddle::Function.new(
  lib['CMTranslateRGBs'],
  [
    Fiddle::TYPE_INTPTR_T,  # hcmTransform : INT_PTR
    Fiddle::TYPE_VOIDP,  # lpSrcBits : void*
    Fiddle::TYPE_INT,  # bmInput : BMFORMAT
    -Fiddle::TYPE_INT,  # dwWidth : DWORD
    -Fiddle::TYPE_INT,  # dwHeight : DWORD
    -Fiddle::TYPE_INT,  # dwStride : DWORD
    Fiddle::TYPE_VOIDP,  # lpDestBits : void* out
    Fiddle::TYPE_INT,  # bmOutput : BMFORMAT
    -Fiddle::TYPE_INT,  # dwTranslateDirection : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "icm32")]
extern "system" {
    fn CMTranslateRGBs(
        hcmTransform: isize,  // INT_PTR
        lpSrcBits: *mut (),  // void*
        bmInput: i32,  // BMFORMAT
        dwWidth: u32,  // DWORD
        dwHeight: u32,  // DWORD
        dwStride: u32,  // DWORD
        lpDestBits: *mut (),  // void* out
        bmOutput: i32,  // BMFORMAT
        dwTranslateDirection: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("ICM32.dll")]
public static extern bool CMTranslateRGBs(IntPtr hcmTransform, IntPtr lpSrcBits, int bmInput, uint dwWidth, uint dwHeight, uint dwStride, IntPtr lpDestBits, int bmOutput, uint dwTranslateDirection);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ICM32_CMTranslateRGBs' -Namespace Win32 -PassThru
# $api::CMTranslateRGBs(hcmTransform, lpSrcBits, bmInput, dwWidth, dwHeight, dwStride, lpDestBits, bmOutput, dwTranslateDirection)
#uselib "ICM32.dll"
#func global CMTranslateRGBs "CMTranslateRGBs" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; CMTranslateRGBs hcmTransform, lpSrcBits, bmInput, dwWidth, dwHeight, dwStride, lpDestBits, bmOutput, dwTranslateDirection   ; 戻り値は stat
; hcmTransform : INT_PTR -> "sptr"
; lpSrcBits : void* -> "sptr"
; bmInput : BMFORMAT -> "sptr"
; dwWidth : DWORD -> "sptr"
; dwHeight : DWORD -> "sptr"
; dwStride : DWORD -> "sptr"
; lpDestBits : void* out -> "sptr"
; bmOutput : BMFORMAT -> "sptr"
; dwTranslateDirection : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "ICM32.dll"
#cfunc global CMTranslateRGBs "CMTranslateRGBs" sptr, sptr, int, int, int, int, sptr, int, int
; res = CMTranslateRGBs(hcmTransform, lpSrcBits, bmInput, dwWidth, dwHeight, dwStride, lpDestBits, bmOutput, dwTranslateDirection)
; hcmTransform : INT_PTR -> "sptr"
; lpSrcBits : void* -> "sptr"
; bmInput : BMFORMAT -> "int"
; dwWidth : DWORD -> "int"
; dwHeight : DWORD -> "int"
; dwStride : DWORD -> "int"
; lpDestBits : void* out -> "sptr"
; bmOutput : BMFORMAT -> "int"
; dwTranslateDirection : DWORD -> "int"
; BOOL CMTranslateRGBs(INT_PTR hcmTransform, void* lpSrcBits, BMFORMAT bmInput, DWORD dwWidth, DWORD dwHeight, DWORD dwStride, void* lpDestBits, BMFORMAT bmOutput, DWORD dwTranslateDirection)
#uselib "ICM32.dll"
#cfunc global CMTranslateRGBs "CMTranslateRGBs" intptr, intptr, int, int, int, int, intptr, int, int
; res = CMTranslateRGBs(hcmTransform, lpSrcBits, bmInput, dwWidth, dwHeight, dwStride, lpDestBits, bmOutput, dwTranslateDirection)
; hcmTransform : INT_PTR -> "intptr"
; lpSrcBits : void* -> "intptr"
; bmInput : BMFORMAT -> "int"
; dwWidth : DWORD -> "int"
; dwHeight : DWORD -> "int"
; dwStride : DWORD -> "int"
; lpDestBits : void* out -> "intptr"
; bmOutput : BMFORMAT -> "int"
; dwTranslateDirection : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icm32 = windows.NewLazySystemDLL("ICM32.dll")
	procCMTranslateRGBs = icm32.NewProc("CMTranslateRGBs")
)

// hcmTransform (INT_PTR), lpSrcBits (void*), bmInput (BMFORMAT), dwWidth (DWORD), dwHeight (DWORD), dwStride (DWORD), lpDestBits (void* out), bmOutput (BMFORMAT), dwTranslateDirection (DWORD)
r1, _, err := procCMTranslateRGBs.Call(
	uintptr(hcmTransform),
	uintptr(lpSrcBits),
	uintptr(bmInput),
	uintptr(dwWidth),
	uintptr(dwHeight),
	uintptr(dwStride),
	uintptr(lpDestBits),
	uintptr(bmOutput),
	uintptr(dwTranslateDirection),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function CMTranslateRGBs(
  hcmTransform: NativeInt;   // INT_PTR
  lpSrcBits: Pointer;   // void*
  bmInput: Integer;   // BMFORMAT
  dwWidth: DWORD;   // DWORD
  dwHeight: DWORD;   // DWORD
  dwStride: DWORD;   // DWORD
  lpDestBits: Pointer;   // void* out
  bmOutput: Integer;   // BMFORMAT
  dwTranslateDirection: DWORD   // DWORD
): BOOL; stdcall;
  external 'ICM32.dll' name 'CMTranslateRGBs';
result := DllCall("ICM32\CMTranslateRGBs"
    , "Ptr", hcmTransform   ; INT_PTR
    , "Ptr", lpSrcBits   ; void*
    , "Int", bmInput   ; BMFORMAT
    , "UInt", dwWidth   ; DWORD
    , "UInt", dwHeight   ; DWORD
    , "UInt", dwStride   ; DWORD
    , "Ptr", lpDestBits   ; void* out
    , "Int", bmOutput   ; BMFORMAT
    , "UInt", dwTranslateDirection   ; DWORD
    , "Int")   ; return: BOOL
●CMTranslateRGBs(hcmTransform, lpSrcBits, bmInput, dwWidth, dwHeight, dwStride, lpDestBits, bmOutput, dwTranslateDirection) = DLL("ICM32.dll", "bool CMTranslateRGBs(int, void*, int, dword, dword, dword, void*, int, dword)")
# 呼び出し: CMTranslateRGBs(hcmTransform, lpSrcBits, bmInput, dwWidth, dwHeight, dwStride, lpDestBits, bmOutput, dwTranslateDirection)
# hcmTransform : INT_PTR -> "int"
# lpSrcBits : void* -> "void*"
# bmInput : BMFORMAT -> "int"
# dwWidth : DWORD -> "dword"
# dwHeight : DWORD -> "dword"
# dwStride : DWORD -> "dword"
# lpDestBits : void* out -> "void*"
# bmOutput : BMFORMAT -> "int"
# dwTranslateDirection : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "icm32" fn CMTranslateRGBs(
    hcmTransform: isize, // INT_PTR
    lpSrcBits: ?*anyopaque, // void*
    bmInput: i32, // BMFORMAT
    dwWidth: u32, // DWORD
    dwHeight: u32, // DWORD
    dwStride: u32, // DWORD
    lpDestBits: ?*anyopaque, // void* out
    bmOutput: i32, // BMFORMAT
    dwTranslateDirection: u32 // DWORD
) callconv(std.os.windows.WINAPI) i32;
proc CMTranslateRGBs(
    hcmTransform: int,  # INT_PTR
    lpSrcBits: pointer,  # void*
    bmInput: int32,  # BMFORMAT
    dwWidth: uint32,  # DWORD
    dwHeight: uint32,  # DWORD
    dwStride: uint32,  # DWORD
    lpDestBits: pointer,  # void* out
    bmOutput: int32,  # BMFORMAT
    dwTranslateDirection: uint32  # DWORD
): int32 {.importc: "CMTranslateRGBs", stdcall, dynlib: "ICM32.dll".}
pragma(lib, "icm32");
extern(Windows)
int CMTranslateRGBs(
    ptrdiff_t hcmTransform,   // INT_PTR
    void* lpSrcBits,   // void*
    int bmInput,   // BMFORMAT
    uint dwWidth,   // DWORD
    uint dwHeight,   // DWORD
    uint dwStride,   // DWORD
    void* lpDestBits,   // void* out
    int bmOutput,   // BMFORMAT
    uint dwTranslateDirection   // DWORD
);
ccall((:CMTranslateRGBs, "ICM32.dll"), stdcall, Int32,
      (Int, Ptr{Cvoid}, Int32, UInt32, UInt32, UInt32, Ptr{Cvoid}, Int32, UInt32),
      hcmTransform, lpSrcBits, bmInput, dwWidth, dwHeight, dwStride, lpDestBits, bmOutput, dwTranslateDirection)
# hcmTransform : INT_PTR -> Int
# lpSrcBits : void* -> Ptr{Cvoid}
# bmInput : BMFORMAT -> Int32
# dwWidth : DWORD -> UInt32
# dwHeight : DWORD -> UInt32
# dwStride : DWORD -> UInt32
# lpDestBits : void* out -> Ptr{Cvoid}
# bmOutput : BMFORMAT -> Int32
# dwTranslateDirection : DWORD -> UInt32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t CMTranslateRGBs(
    intptr_t hcmTransform,
    void* lpSrcBits,
    int32_t bmInput,
    uint32_t dwWidth,
    uint32_t dwHeight,
    uint32_t dwStride,
    void* lpDestBits,
    int32_t bmOutput,
    uint32_t dwTranslateDirection);
]]
local icm32 = ffi.load("icm32")
-- icm32.CMTranslateRGBs(hcmTransform, lpSrcBits, bmInput, dwWidth, dwHeight, dwStride, lpDestBits, bmOutput, dwTranslateDirection)
-- hcmTransform : INT_PTR
-- lpSrcBits : void*
-- bmInput : BMFORMAT
-- dwWidth : DWORD
-- dwHeight : DWORD
-- dwStride : DWORD
-- lpDestBits : void* out
-- bmOutput : BMFORMAT
-- dwTranslateDirection : DWORD
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('ICM32.dll');
const CMTranslateRGBs = lib.func('__stdcall', 'CMTranslateRGBs', 'int32_t', ['intptr_t', 'void *', 'int32_t', 'uint32_t', 'uint32_t', 'uint32_t', 'void *', 'int32_t', 'uint32_t']);
// CMTranslateRGBs(hcmTransform, lpSrcBits, bmInput, dwWidth, dwHeight, dwStride, lpDestBits, bmOutput, dwTranslateDirection)
// hcmTransform : INT_PTR -> 'intptr_t'
// lpSrcBits : void* -> 'void *'
// bmInput : BMFORMAT -> 'int32_t'
// dwWidth : DWORD -> 'uint32_t'
// dwHeight : DWORD -> 'uint32_t'
// dwStride : DWORD -> 'uint32_t'
// lpDestBits : void* out -> 'void *'
// bmOutput : BMFORMAT -> 'int32_t'
// dwTranslateDirection : DWORD -> 'uint32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("ICM32.dll", {
  CMTranslateRGBs: { parameters: ["isize", "pointer", "i32", "u32", "u32", "u32", "pointer", "i32", "u32"], result: "i32" },
});
// lib.symbols.CMTranslateRGBs(hcmTransform, lpSrcBits, bmInput, dwWidth, dwHeight, dwStride, lpDestBits, bmOutput, dwTranslateDirection)
// hcmTransform : INT_PTR -> "isize"
// lpSrcBits : void* -> "pointer"
// bmInput : BMFORMAT -> "i32"
// dwWidth : DWORD -> "u32"
// dwHeight : DWORD -> "u32"
// dwStride : DWORD -> "u32"
// lpDestBits : void* out -> "pointer"
// bmOutput : BMFORMAT -> "i32"
// dwTranslateDirection : DWORD -> "u32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t CMTranslateRGBs(
    intptr_t hcmTransform,
    void* lpSrcBits,
    int32_t bmInput,
    uint32_t dwWidth,
    uint32_t dwHeight,
    uint32_t dwStride,
    void* lpDestBits,
    int32_t bmOutput,
    uint32_t dwTranslateDirection);
C, "ICM32.dll");
// $ffi->CMTranslateRGBs(hcmTransform, lpSrcBits, bmInput, dwWidth, dwHeight, dwStride, lpDestBits, bmOutput, dwTranslateDirection);
// hcmTransform : INT_PTR
// lpSrcBits : void*
// bmInput : BMFORMAT
// dwWidth : DWORD
// dwHeight : DWORD
// dwStride : DWORD
// lpDestBits : void* out
// bmOutput : BMFORMAT
// dwTranslateDirection : DWORD
// 構造体/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 Icm32 extends StdCallLibrary {
    Icm32 INSTANCE = Native.load("icm32", Icm32.class);
    boolean CMTranslateRGBs(
        long hcmTransform,   // INT_PTR
        Pointer lpSrcBits,   // void*
        int bmInput,   // BMFORMAT
        int dwWidth,   // DWORD
        int dwHeight,   // DWORD
        int dwStride,   // DWORD
        Pointer lpDestBits,   // void* out
        int bmOutput,   // BMFORMAT
        int dwTranslateDirection   // DWORD
    );
}
@[Link("icm32")]
lib LibICM32
  fun CMTranslateRGBs = CMTranslateRGBs(
    hcmTransform : LibC::SSizeT,   # INT_PTR
    lpSrcBits : Void*,   # void*
    bmInput : Int32,   # BMFORMAT
    dwWidth : UInt32,   # DWORD
    dwHeight : UInt32,   # DWORD
    dwStride : UInt32,   # DWORD
    lpDestBits : Void*,   # void* out
    bmOutput : Int32,   # BMFORMAT
    dwTranslateDirection : UInt32   # DWORD
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef CMTranslateRGBsNative = Int32 Function(IntPtr, Pointer<Void>, Int32, Uint32, Uint32, Uint32, Pointer<Void>, Int32, Uint32);
typedef CMTranslateRGBsDart = int Function(int, Pointer<Void>, int, int, int, int, Pointer<Void>, int, int);
final CMTranslateRGBs = DynamicLibrary.open('ICM32.dll')
    .lookupFunction<CMTranslateRGBsNative, CMTranslateRGBsDart>('CMTranslateRGBs');
// hcmTransform : INT_PTR -> IntPtr
// lpSrcBits : void* -> Pointer<Void>
// bmInput : BMFORMAT -> Int32
// dwWidth : DWORD -> Uint32
// dwHeight : DWORD -> Uint32
// dwStride : DWORD -> Uint32
// lpDestBits : void* out -> Pointer<Void>
// bmOutput : BMFORMAT -> Int32
// dwTranslateDirection : DWORD -> Uint32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function CMTranslateRGBs(
  hcmTransform: NativeInt;   // INT_PTR
  lpSrcBits: Pointer;   // void*
  bmInput: Integer;   // BMFORMAT
  dwWidth: DWORD;   // DWORD
  dwHeight: DWORD;   // DWORD
  dwStride: DWORD;   // DWORD
  lpDestBits: Pointer;   // void* out
  bmOutput: Integer;   // BMFORMAT
  dwTranslateDirection: DWORD   // DWORD
): BOOL; stdcall;
  external 'ICM32.dll' name 'CMTranslateRGBs';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "CMTranslateRGBs"
  c_CMTranslateRGBs :: CIntPtr -> Ptr () -> Int32 -> Word32 -> Word32 -> Word32 -> Ptr () -> Int32 -> Word32 -> IO CInt
-- hcmTransform : INT_PTR -> CIntPtr
-- lpSrcBits : void* -> Ptr ()
-- bmInput : BMFORMAT -> Int32
-- dwWidth : DWORD -> Word32
-- dwHeight : DWORD -> Word32
-- dwStride : DWORD -> Word32
-- lpDestBits : void* out -> Ptr ()
-- bmOutput : BMFORMAT -> Int32
-- dwTranslateDirection : DWORD -> Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let cmtranslatergbs =
  foreign "CMTranslateRGBs"
    (intptr_t @-> (ptr void) @-> int32_t @-> uint32_t @-> uint32_t @-> uint32_t @-> (ptr void) @-> int32_t @-> uint32_t @-> returning int32_t)
(* hcmTransform : INT_PTR -> intptr_t *)
(* lpSrcBits : void* -> (ptr void) *)
(* bmInput : BMFORMAT -> int32_t *)
(* dwWidth : DWORD -> uint32_t *)
(* dwHeight : DWORD -> uint32_t *)
(* dwStride : DWORD -> uint32_t *)
(* lpDestBits : void* out -> (ptr void) *)
(* bmOutput : BMFORMAT -> int32_t *)
(* dwTranslateDirection : DWORD -> uint32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library icm32 (t "ICM32.dll"))
(cffi:use-foreign-library icm32)

(cffi:defcfun ("CMTranslateRGBs" cmtranslate-rgbs :convention :stdcall) :int32
  (hcm-transform :int64)   ; INT_PTR
  (lp-src-bits :pointer)   ; void*
  (bm-input :int32)   ; BMFORMAT
  (dw-width :uint32)   ; DWORD
  (dw-height :uint32)   ; DWORD
  (dw-stride :uint32)   ; DWORD
  (lp-dest-bits :pointer)   ; void* out
  (bm-output :int32)   ; BMFORMAT
  (dw-translate-direction :uint32))   ; DWORD
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $CMTranslateRGBs = Win32::API::More->new('ICM32',
    'BOOL CMTranslateRGBs(LPARAM hcmTransform, LPVOID lpSrcBits, int bmInput, DWORD dwWidth, DWORD dwHeight, DWORD dwStride, LPVOID lpDestBits, int bmOutput, DWORD dwTranslateDirection)');
# my $ret = $CMTranslateRGBs->Call($hcmTransform, $lpSrcBits, $bmInput, $dwWidth, $dwHeight, $dwStride, $lpDestBits, $bmOutput, $dwTranslateDirection);
# hcmTransform : INT_PTR -> LPARAM
# lpSrcBits : void* -> LPVOID
# bmInput : BMFORMAT -> int
# dwWidth : DWORD -> DWORD
# dwHeight : DWORD -> DWORD
# dwStride : DWORD -> DWORD
# lpDestBits : void* out -> LPVOID
# bmOutput : BMFORMAT -> int
# dwTranslateDirection : DWORD -> DWORD
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型