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

WICBitmapPattern

構造体
サイズx64: 40 バイト / x86: 24 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
PositionULONGLONG8+0+0ストリーム内でパターンを照合する開始位置(バイトオフセット)。64ビット値。
LengthDWORD4+8+8PatternおよびMaskのバイト長。
PatternBYTE*8/4+16+12照合に用いるバイトパターンへのポインタ。
MaskBYTE*8/4+24+16Patternの各バイトに適用するマスク。比較対象ビットを選択する。
EndOfStreamBOOL4+32+20パターンがストリーム末尾を基準に照合されるかを示すBOOL値。

各言語での定義

#include <windows.h>

// WICBitmapPattern  (x64 40 / x86 24 バイト)
typedef struct WICBitmapPattern {
    ULONGLONG Position;
    DWORD Length;
    BYTE* Pattern;
    BYTE* Mask;
    BOOL EndOfStream;
} WICBitmapPattern;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WICBitmapPattern
{
    public ulong Position;
    public uint Length;
    public IntPtr Pattern;
    public IntPtr Mask;
    [MarshalAs(UnmanagedType.Bool)] public bool EndOfStream;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WICBitmapPattern
    Public Position As ULong
    Public Length As UInteger
    Public Pattern As IntPtr
    Public Mask As IntPtr
    <MarshalAs(UnmanagedType.Bool)> Public EndOfStream As Boolean
End Structure
import ctypes
from ctypes import wintypes

class WICBitmapPattern(ctypes.Structure):
    _fields_ = [
        ("Position", ctypes.c_ulonglong),
        ("Length", wintypes.DWORD),
        ("Pattern", ctypes.c_void_p),
        ("Mask", ctypes.c_void_p),
        ("EndOfStream", wintypes.BOOL),
    ]
#[repr(C)]
pub struct WICBitmapPattern {
    pub Position: u64,
    pub Length: u32,
    pub Pattern: *mut core::ffi::c_void,
    pub Mask: *mut core::ffi::c_void,
    pub EndOfStream: i32,
}
import "golang.org/x/sys/windows"

type WICBitmapPattern struct {
	Position uint64
	Length uint32
	Pattern uintptr
	Mask uintptr
	EndOfStream int32
}
type
  WICBitmapPattern = record
    Position: UInt64;
    Length: DWORD;
    Pattern: Pointer;
    Mask: Pointer;
    EndOfStream: BOOL;
  end;
const WICBitmapPattern = extern struct {
    Position: u64,
    Length: u32,
    Pattern: ?*anyopaque,
    Mask: ?*anyopaque,
    EndOfStream: i32,
};
type
  WICBitmapPattern {.bycopy.} = object
    Position: uint64
    Length: uint32
    Pattern: pointer
    Mask: pointer
    EndOfStream: int32
struct WICBitmapPattern
{
    ulong Position;
    uint Length;
    void* Pattern;
    void* Mask;
    int EndOfStream;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WICBitmapPattern サイズ: 24 バイト(x86)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Position : ULONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; Length : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Pattern : BYTE* (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Mask : BYTE* (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; EndOfStream : BOOL (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WICBitmapPattern サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; Position : ULONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; Length : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Pattern : BYTE* (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; Mask : BYTE* (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; EndOfStream : BOOL (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WICBitmapPattern
    #field int64 Position
    #field int Length
    #field intptr Pattern
    #field intptr Mask
    #field bool EndOfStream
#endstruct

stdim st, WICBitmapPattern        ; NSTRUCT 変数を確保
st->Position = 100
mes "Position=" + st->Position