ホーム › Devices.ImageAcquisition › SCANINFO
SCANINFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ADF | INT | 4 | +0 | +0 | 自動給紙装置(ADF)の有無や状態を示す値。 |
| TPA | INT | 4 | +4 | +4 | 透過原稿アダプタ(TPA)の有無や状態を示す値。 |
| Endorser | INT | 4 | +8 | +8 | エンドーサ(押印機構)の有無や状態を示す値。 |
| OpticalXResolution | INT | 4 | +12 | +12 | スキャナの光学的なX方向解像度をDPIで表す。 |
| OpticalYResolution | INT | 4 | +16 | +16 | スキャナの光学的なY方向解像度をDPIで表す。 |
| BedWidth | INT | 4 | +20 | +20 | 原稿台の幅を1000分の1インチ単位で表す。 |
| BedHeight | INT | 4 | +24 | +24 | 原稿台の高さを1000分の1インチ単位で表す。 |
| IntensityRange | RANGEVALUE | 12 | +28 | +28 | 明度(輝度)設定の取り得る範囲を表すRANGEVALUE。 |
| ContrastRange | RANGEVALUE | 12 | +40 | +40 | コントラスト設定の取り得る範囲を表すRANGEVALUE。 |
| SupportedCompressionType | INT | 4 | +52 | +52 | サポートする圧縮方式を示すフラグの組み合わせ。 |
| SupportedDataTypes | INT | 4 | +56 | +56 | サポートするデータ型(白黒/グレー/カラー等)のフラグ。 |
| WidthPixels | INT | 4 | +60 | +60 | 走査ラインの幅をピクセル数で表す。 |
| WidthBytes | INT | 4 | +64 | +64 | 走査ライン1行のデータ長をバイト数で表す。 |
| Lines | INT | 4 | +68 | +68 | 取得する走査ラインの総数を表す。 |
| DataType | INT | 4 | +72 | +72 | 現在のピクセルデータ型(白黒/グレー/RGB等)を表す。 |
| PixelBits | INT | 4 | +76 | +76 | 1ピクセルあたりのビット数を表す。 |
| Intensity | INT | 4 | +80 | +80 | 現在の明度(輝度)設定値を表す。 |
| Contrast | INT | 4 | +84 | +84 | 現在のコントラスト設定値を表す。 |
| Xresolution | INT | 4 | +88 | +88 | 現在のX方向走査解像度をDPIで表す。 |
| Yresolution | INT | 4 | +92 | +92 | 現在のY方向走査解像度をDPIで表す。 |
| Window | SCANWINDOW | 16 | +96 | +96 | 現在のスキャン領域を表すSCANWINDOW構造体。 |
| DitherPattern | INT | 4 | +112 | +112 | 白黒出力に用いるディザリングパターンを示す値。 |
| Negative | INT | 4 | +116 | +116 | ネガ(階調反転)出力か否かを示す値。 |
| Mirror | INT | 4 | +120 | +120 | 左右反転(ミラー)出力か否かを示す値。 |
| AutoBack | INT | 4 | +124 | +124 | 自動背景処理(白色化)の有無を示す値。 |
| ColorDitherPattern | INT | 4 | +128 | +128 | カラー出力に用いるディザリングパターンを示す値。 |
| ToneMap | INT | 4 | +132 | +132 | トーンマップ(階調補正)の適用設定を示す値。 |
| Compression | INT | 4 | +136 | +136 | 現在使用する圧縮方式を示す値。 |
| RawDataFormat | INT | 4 | +140 | +140 | ハードウェアから読み出す生データの形式を示す値。 |
| RawPixelOrder | INT | 4 | +144 | +144 | 生データ内のピクセル/色成分の並び順を示す値。 |
| bNeedDataAlignment | INT | 4 | +148 | +148 | データのアライメント調整が必要かを示すフラグ。 |
| DelayBetweenRead | INT | 4 | +152 | +152 | 読み出し間に挿入する遅延時間を表す。 |
| MaxBufferSize | INT | 4 | +156 | +156 | 1回の転送で扱える最大バッファサイズをバイトで表す。 |
| DeviceIOHandles | HANDLE | 128/64 | +160 | +160 | デバイスI/Oに用いるハンドル。 |
| lReserved | INT | 16 | +288 | +224 | 予約フィールド。0を設定する。 |
| pMicroDriverContext | void* | 8/4 | +304 | +240 | マイクロドライバ固有のコンテキストへのポインタ。 |
各言語での定義
#include <windows.h>
// RANGEVALUE (x64 12 / x86 12 バイト)
typedef struct RANGEVALUE {
INT lMin;
INT lMax;
INT lStep;
} RANGEVALUE;
// SCANWINDOW (x64 16 / x86 16 バイト)
typedef struct SCANWINDOW {
INT xPos;
INT yPos;
INT xExtent;
INT yExtent;
} SCANWINDOW;
// SCANINFO (x64 312 / x86 244 バイト)
typedef struct SCANINFO {
INT ADF;
INT TPA;
INT Endorser;
INT OpticalXResolution;
INT OpticalYResolution;
INT BedWidth;
INT BedHeight;
RANGEVALUE IntensityRange;
RANGEVALUE ContrastRange;
INT SupportedCompressionType;
INT SupportedDataTypes;
INT WidthPixels;
INT WidthBytes;
INT Lines;
INT DataType;
INT PixelBits;
INT Intensity;
INT Contrast;
INT Xresolution;
INT Yresolution;
SCANWINDOW Window;
INT DitherPattern;
INT Negative;
INT Mirror;
INT AutoBack;
INT ColorDitherPattern;
INT ToneMap;
INT Compression;
INT RawDataFormat;
INT RawPixelOrder;
INT bNeedDataAlignment;
INT DelayBetweenRead;
INT MaxBufferSize;
HANDLE DeviceIOHandles[16];
INT lReserved[4];
void* pMicroDriverContext;
} SCANINFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RANGEVALUE
{
public int lMin;
public int lMax;
public int lStep;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SCANWINDOW
{
public int xPos;
public int yPos;
public int xExtent;
public int yExtent;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SCANINFO
{
public int ADF;
public int TPA;
public int Endorser;
public int OpticalXResolution;
public int OpticalYResolution;
public int BedWidth;
public int BedHeight;
public RANGEVALUE IntensityRange;
public RANGEVALUE ContrastRange;
public int SupportedCompressionType;
public int SupportedDataTypes;
public int WidthPixels;
public int WidthBytes;
public int Lines;
public int DataType;
public int PixelBits;
public int Intensity;
public int Contrast;
public int Xresolution;
public int Yresolution;
public SCANWINDOW Window;
public int DitherPattern;
public int Negative;
public int Mirror;
public int AutoBack;
public int ColorDitherPattern;
public int ToneMap;
public int Compression;
public int RawDataFormat;
public int RawPixelOrder;
public int bNeedDataAlignment;
public int DelayBetweenRead;
public int MaxBufferSize;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public IntPtr[] DeviceIOHandles;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public int[] lReserved;
public IntPtr pMicroDriverContext;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RANGEVALUE
Public lMin As Integer
Public lMax As Integer
Public lStep As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SCANWINDOW
Public xPos As Integer
Public yPos As Integer
Public xExtent As Integer
Public yExtent As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SCANINFO
Public ADF As Integer
Public TPA As Integer
Public Endorser As Integer
Public OpticalXResolution As Integer
Public OpticalYResolution As Integer
Public BedWidth As Integer
Public BedHeight As Integer
Public IntensityRange As RANGEVALUE
Public ContrastRange As RANGEVALUE
Public SupportedCompressionType As Integer
Public SupportedDataTypes As Integer
Public WidthPixels As Integer
Public WidthBytes As Integer
Public Lines As Integer
Public DataType As Integer
Public PixelBits As Integer
Public Intensity As Integer
Public Contrast As Integer
Public Xresolution As Integer
Public Yresolution As Integer
Public Window As SCANWINDOW
Public DitherPattern As Integer
Public Negative As Integer
Public Mirror As Integer
Public AutoBack As Integer
Public ColorDitherPattern As Integer
Public ToneMap As Integer
Public Compression As Integer
Public RawDataFormat As Integer
Public RawPixelOrder As Integer
Public bNeedDataAlignment As Integer
Public DelayBetweenRead As Integer
Public MaxBufferSize As Integer
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public DeviceIOHandles() As IntPtr
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public lReserved() As Integer
Public pMicroDriverContext As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class RANGEVALUE(ctypes.Structure):
_fields_ = [
("lMin", ctypes.c_int),
("lMax", ctypes.c_int),
("lStep", ctypes.c_int),
]
class SCANWINDOW(ctypes.Structure):
_fields_ = [
("xPos", ctypes.c_int),
("yPos", ctypes.c_int),
("xExtent", ctypes.c_int),
("yExtent", ctypes.c_int),
]
class SCANINFO(ctypes.Structure):
_fields_ = [
("ADF", ctypes.c_int),
("TPA", ctypes.c_int),
("Endorser", ctypes.c_int),
("OpticalXResolution", ctypes.c_int),
("OpticalYResolution", ctypes.c_int),
("BedWidth", ctypes.c_int),
("BedHeight", ctypes.c_int),
("IntensityRange", RANGEVALUE),
("ContrastRange", RANGEVALUE),
("SupportedCompressionType", ctypes.c_int),
("SupportedDataTypes", ctypes.c_int),
("WidthPixels", ctypes.c_int),
("WidthBytes", ctypes.c_int),
("Lines", ctypes.c_int),
("DataType", ctypes.c_int),
("PixelBits", ctypes.c_int),
("Intensity", ctypes.c_int),
("Contrast", ctypes.c_int),
("Xresolution", ctypes.c_int),
("Yresolution", ctypes.c_int),
("Window", SCANWINDOW),
("DitherPattern", ctypes.c_int),
("Negative", ctypes.c_int),
("Mirror", ctypes.c_int),
("AutoBack", ctypes.c_int),
("ColorDitherPattern", ctypes.c_int),
("ToneMap", ctypes.c_int),
("Compression", ctypes.c_int),
("RawDataFormat", ctypes.c_int),
("RawPixelOrder", ctypes.c_int),
("bNeedDataAlignment", ctypes.c_int),
("DelayBetweenRead", ctypes.c_int),
("MaxBufferSize", ctypes.c_int),
("DeviceIOHandles", ctypes.c_void_p * 16),
("lReserved", ctypes.c_int * 4),
("pMicroDriverContext", ctypes.c_void_p),
]#[repr(C)]
pub struct RANGEVALUE {
pub lMin: i32,
pub lMax: i32,
pub lStep: i32,
}
#[repr(C)]
pub struct SCANWINDOW {
pub xPos: i32,
pub yPos: i32,
pub xExtent: i32,
pub yExtent: i32,
}
#[repr(C)]
pub struct SCANINFO {
pub ADF: i32,
pub TPA: i32,
pub Endorser: i32,
pub OpticalXResolution: i32,
pub OpticalYResolution: i32,
pub BedWidth: i32,
pub BedHeight: i32,
pub IntensityRange: RANGEVALUE,
pub ContrastRange: RANGEVALUE,
pub SupportedCompressionType: i32,
pub SupportedDataTypes: i32,
pub WidthPixels: i32,
pub WidthBytes: i32,
pub Lines: i32,
pub DataType: i32,
pub PixelBits: i32,
pub Intensity: i32,
pub Contrast: i32,
pub Xresolution: i32,
pub Yresolution: i32,
pub Window: SCANWINDOW,
pub DitherPattern: i32,
pub Negative: i32,
pub Mirror: i32,
pub AutoBack: i32,
pub ColorDitherPattern: i32,
pub ToneMap: i32,
pub Compression: i32,
pub RawDataFormat: i32,
pub RawPixelOrder: i32,
pub bNeedDataAlignment: i32,
pub DelayBetweenRead: i32,
pub MaxBufferSize: i32,
pub DeviceIOHandles: [*mut core::ffi::c_void; 16],
pub lReserved: [i32; 4],
pub pMicroDriverContext: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type RANGEVALUE struct {
lMin int32
lMax int32
lStep int32
}
type SCANWINDOW struct {
xPos int32
yPos int32
xExtent int32
yExtent int32
}
type SCANINFO struct {
ADF int32
TPA int32
Endorser int32
OpticalXResolution int32
OpticalYResolution int32
BedWidth int32
BedHeight int32
IntensityRange RANGEVALUE
ContrastRange RANGEVALUE
SupportedCompressionType int32
SupportedDataTypes int32
WidthPixels int32
WidthBytes int32
Lines int32
DataType int32
PixelBits int32
Intensity int32
Contrast int32
Xresolution int32
Yresolution int32
Window SCANWINDOW
DitherPattern int32
Negative int32
Mirror int32
AutoBack int32
ColorDitherPattern int32
ToneMap int32
Compression int32
RawDataFormat int32
RawPixelOrder int32
bNeedDataAlignment int32
DelayBetweenRead int32
MaxBufferSize int32
DeviceIOHandles [16]uintptr
lReserved [4]int32
pMicroDriverContext uintptr
}type
RANGEVALUE = record
lMin: Integer;
lMax: Integer;
lStep: Integer;
end;
SCANWINDOW = record
xPos: Integer;
yPos: Integer;
xExtent: Integer;
yExtent: Integer;
end;
SCANINFO = record
ADF: Integer;
TPA: Integer;
Endorser: Integer;
OpticalXResolution: Integer;
OpticalYResolution: Integer;
BedWidth: Integer;
BedHeight: Integer;
IntensityRange: RANGEVALUE;
ContrastRange: RANGEVALUE;
SupportedCompressionType: Integer;
SupportedDataTypes: Integer;
WidthPixels: Integer;
WidthBytes: Integer;
Lines: Integer;
DataType: Integer;
PixelBits: Integer;
Intensity: Integer;
Contrast: Integer;
Xresolution: Integer;
Yresolution: Integer;
Window: SCANWINDOW;
DitherPattern: Integer;
Negative: Integer;
Mirror: Integer;
AutoBack: Integer;
ColorDitherPattern: Integer;
ToneMap: Integer;
Compression: Integer;
RawDataFormat: Integer;
RawPixelOrder: Integer;
bNeedDataAlignment: Integer;
DelayBetweenRead: Integer;
MaxBufferSize: Integer;
DeviceIOHandles: array[0..15] of Pointer;
lReserved: array[0..3] of Integer;
pMicroDriverContext: Pointer;
end;const RANGEVALUE = extern struct {
lMin: i32,
lMax: i32,
lStep: i32,
};
const SCANWINDOW = extern struct {
xPos: i32,
yPos: i32,
xExtent: i32,
yExtent: i32,
};
const SCANINFO = extern struct {
ADF: i32,
TPA: i32,
Endorser: i32,
OpticalXResolution: i32,
OpticalYResolution: i32,
BedWidth: i32,
BedHeight: i32,
IntensityRange: RANGEVALUE,
ContrastRange: RANGEVALUE,
SupportedCompressionType: i32,
SupportedDataTypes: i32,
WidthPixels: i32,
WidthBytes: i32,
Lines: i32,
DataType: i32,
PixelBits: i32,
Intensity: i32,
Contrast: i32,
Xresolution: i32,
Yresolution: i32,
Window: SCANWINDOW,
DitherPattern: i32,
Negative: i32,
Mirror: i32,
AutoBack: i32,
ColorDitherPattern: i32,
ToneMap: i32,
Compression: i32,
RawDataFormat: i32,
RawPixelOrder: i32,
bNeedDataAlignment: i32,
DelayBetweenRead: i32,
MaxBufferSize: i32,
DeviceIOHandles: [16]?*anyopaque,
lReserved: [4]i32,
pMicroDriverContext: ?*anyopaque,
};type
RANGEVALUE {.bycopy.} = object
lMin: int32
lMax: int32
lStep: int32
SCANWINDOW {.bycopy.} = object
xPos: int32
yPos: int32
xExtent: int32
yExtent: int32
SCANINFO {.bycopy.} = object
ADF: int32
TPA: int32
Endorser: int32
OpticalXResolution: int32
OpticalYResolution: int32
BedWidth: int32
BedHeight: int32
IntensityRange: RANGEVALUE
ContrastRange: RANGEVALUE
SupportedCompressionType: int32
SupportedDataTypes: int32
WidthPixels: int32
WidthBytes: int32
Lines: int32
DataType: int32
PixelBits: int32
Intensity: int32
Contrast: int32
Xresolution: int32
Yresolution: int32
Window: SCANWINDOW
DitherPattern: int32
Negative: int32
Mirror: int32
AutoBack: int32
ColorDitherPattern: int32
ToneMap: int32
Compression: int32
RawDataFormat: int32
RawPixelOrder: int32
bNeedDataAlignment: int32
DelayBetweenRead: int32
MaxBufferSize: int32
DeviceIOHandles: array[16, pointer]
lReserved: array[4, int32]
pMicroDriverContext: pointerstruct RANGEVALUE
{
int lMin;
int lMax;
int lStep;
}
struct SCANWINDOW
{
int xPos;
int yPos;
int xExtent;
int yExtent;
}
struct SCANINFO
{
int ADF;
int TPA;
int Endorser;
int OpticalXResolution;
int OpticalYResolution;
int BedWidth;
int BedHeight;
RANGEVALUE IntensityRange;
RANGEVALUE ContrastRange;
int SupportedCompressionType;
int SupportedDataTypes;
int WidthPixels;
int WidthBytes;
int Lines;
int DataType;
int PixelBits;
int Intensity;
int Contrast;
int Xresolution;
int Yresolution;
SCANWINDOW Window;
int DitherPattern;
int Negative;
int Mirror;
int AutoBack;
int ColorDitherPattern;
int ToneMap;
int Compression;
int RawDataFormat;
int RawPixelOrder;
int bNeedDataAlignment;
int DelayBetweenRead;
int MaxBufferSize;
void*[16] DeviceIOHandles;
int[4] lReserved;
void* pMicroDriverContext;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SCANINFO サイズ: 244 バイト(x86)
dim st, 61 ; 4byte整数×61(構造体サイズ 244 / 4 切り上げ)
; ADF : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; TPA : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Endorser : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; OpticalXResolution : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; OpticalYResolution : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; BedWidth : INT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; BedHeight : INT (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; IntensityRange : RANGEVALUE (+28, 12byte) varptr(st)+28 を基点に操作(12byte:入れ子/配列)
; ContrastRange : RANGEVALUE (+40, 12byte) varptr(st)+40 を基点に操作(12byte:入れ子/配列)
; SupportedCompressionType : INT (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; SupportedDataTypes : INT (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; WidthPixels : INT (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; WidthBytes : INT (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; Lines : INT (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; DataType : INT (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; PixelBits : INT (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; Intensity : INT (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; Contrast : INT (+84, 4byte) st.21 = 値 / 値 = st.21 (lpoke/lpeek も可)
; Xresolution : INT (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; Yresolution : INT (+92, 4byte) st.23 = 値 / 値 = st.23 (lpoke/lpeek も可)
; Window : SCANWINDOW (+96, 16byte) varptr(st)+96 を基点に操作(16byte:入れ子/配列)
; DitherPattern : INT (+112, 4byte) st.28 = 値 / 値 = st.28 (lpoke/lpeek も可)
; Negative : INT (+116, 4byte) st.29 = 値 / 値 = st.29 (lpoke/lpeek も可)
; Mirror : INT (+120, 4byte) st.30 = 値 / 値 = st.30 (lpoke/lpeek も可)
; AutoBack : INT (+124, 4byte) st.31 = 値 / 値 = st.31 (lpoke/lpeek も可)
; ColorDitherPattern : INT (+128, 4byte) st.32 = 値 / 値 = st.32 (lpoke/lpeek も可)
; ToneMap : INT (+132, 4byte) st.33 = 値 / 値 = st.33 (lpoke/lpeek も可)
; Compression : INT (+136, 4byte) st.34 = 値 / 値 = st.34 (lpoke/lpeek も可)
; RawDataFormat : INT (+140, 4byte) st.35 = 値 / 値 = st.35 (lpoke/lpeek も可)
; RawPixelOrder : INT (+144, 4byte) st.36 = 値 / 値 = st.36 (lpoke/lpeek も可)
; bNeedDataAlignment : INT (+148, 4byte) st.37 = 値 / 値 = st.37 (lpoke/lpeek も可)
; DelayBetweenRead : INT (+152, 4byte) st.38 = 値 / 値 = st.38 (lpoke/lpeek も可)
; MaxBufferSize : INT (+156, 4byte) st.39 = 値 / 値 = st.39 (lpoke/lpeek も可)
; DeviceIOHandles : HANDLE (+160, 64byte) varptr(st)+160 を基点に操作(64byte:入れ子/配列)
; lReserved : INT (+224, 16byte) varptr(st)+224 を基点に操作(16byte:入れ子/配列)
; pMicroDriverContext : void* (+240, 4byte) st.60 = 値 / 値 = st.60 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SCANINFO サイズ: 312 バイト(x64)
dim st, 78 ; 4byte整数×78(構造体サイズ 312 / 4 切り上げ)
; ADF : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; TPA : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Endorser : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; OpticalXResolution : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; OpticalYResolution : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; BedWidth : INT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; BedHeight : INT (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; IntensityRange : RANGEVALUE (+28, 12byte) varptr(st)+28 を基点に操作(12byte:入れ子/配列)
; ContrastRange : RANGEVALUE (+40, 12byte) varptr(st)+40 を基点に操作(12byte:入れ子/配列)
; SupportedCompressionType : INT (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; SupportedDataTypes : INT (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; WidthPixels : INT (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; WidthBytes : INT (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; Lines : INT (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; DataType : INT (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; PixelBits : INT (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; Intensity : INT (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; Contrast : INT (+84, 4byte) st.21 = 値 / 値 = st.21 (lpoke/lpeek も可)
; Xresolution : INT (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; Yresolution : INT (+92, 4byte) st.23 = 値 / 値 = st.23 (lpoke/lpeek も可)
; Window : SCANWINDOW (+96, 16byte) varptr(st)+96 を基点に操作(16byte:入れ子/配列)
; DitherPattern : INT (+112, 4byte) st.28 = 値 / 値 = st.28 (lpoke/lpeek も可)
; Negative : INT (+116, 4byte) st.29 = 値 / 値 = st.29 (lpoke/lpeek も可)
; Mirror : INT (+120, 4byte) st.30 = 値 / 値 = st.30 (lpoke/lpeek も可)
; AutoBack : INT (+124, 4byte) st.31 = 値 / 値 = st.31 (lpoke/lpeek も可)
; ColorDitherPattern : INT (+128, 4byte) st.32 = 値 / 値 = st.32 (lpoke/lpeek も可)
; ToneMap : INT (+132, 4byte) st.33 = 値 / 値 = st.33 (lpoke/lpeek も可)
; Compression : INT (+136, 4byte) st.34 = 値 / 値 = st.34 (lpoke/lpeek も可)
; RawDataFormat : INT (+140, 4byte) st.35 = 値 / 値 = st.35 (lpoke/lpeek も可)
; RawPixelOrder : INT (+144, 4byte) st.36 = 値 / 値 = st.36 (lpoke/lpeek も可)
; bNeedDataAlignment : INT (+148, 4byte) st.37 = 値 / 値 = st.37 (lpoke/lpeek も可)
; DelayBetweenRead : INT (+152, 4byte) st.38 = 値 / 値 = st.38 (lpoke/lpeek も可)
; MaxBufferSize : INT (+156, 4byte) st.39 = 値 / 値 = st.39 (lpoke/lpeek も可)
; DeviceIOHandles : HANDLE (+160, 128byte) varptr(st)+160 を基点に操作(128byte:入れ子/配列)
; lReserved : INT (+288, 16byte) varptr(st)+288 を基点に操作(16byte:入れ子/配列)
; pMicroDriverContext : void* (+304, 8byte) qpoke st,304,値 / qpeek(st,304) ※IronHSPのみ。3.7/3.8は lpoke st,304,下位 : lpoke st,308,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global RANGEVALUE
#field int lMin
#field int lMax
#field int lStep
#endstruct
#defstruct global SCANWINDOW
#field int xPos
#field int yPos
#field int xExtent
#field int yExtent
#endstruct
#defstruct global SCANINFO
#field int ADF
#field int TPA
#field int Endorser
#field int OpticalXResolution
#field int OpticalYResolution
#field int BedWidth
#field int BedHeight
#field RANGEVALUE IntensityRange
#field RANGEVALUE ContrastRange
#field int SupportedCompressionType
#field int SupportedDataTypes
#field int WidthPixels
#field int WidthBytes
#field int Lines
#field int DataType
#field int PixelBits
#field int Intensity
#field int Contrast
#field int Xresolution
#field int Yresolution
#field SCANWINDOW Window
#field int DitherPattern
#field int Negative
#field int Mirror
#field int AutoBack
#field int ColorDitherPattern
#field int ToneMap
#field int Compression
#field int RawDataFormat
#field int RawPixelOrder
#field int bNeedDataAlignment
#field int DelayBetweenRead
#field int MaxBufferSize
#field intptr DeviceIOHandles 16
#field int lReserved 4
#field intptr pMicroDriverContext
#endstruct
stdim st, SCANINFO ; NSTRUCT 変数を確保
st->ADF = 100
mes "ADF=" + st->ADF