WIA RAW 資料標頭
RAW 資料的標頭如下所示:
DWORD Tag; // must contain 'WRAW' (single byte ASCII characters)
DWORD Version; // must contain 0x00010000
DWORD HeaderSize; // contains amount of valid bytes in header
DWORD XRes; // X (horizontal) resolution, in DPI
DWORD YRes; // Y (vertical) resolution, in DPI
DWORD XExtent; // image width, in pixels
DWORD YExtent; // image height, in pixels
DWORD BytesPerLine; // used only for uncompressed image data, 0 (unknown) for compressed data
DWORD BitsPerPixel; // number of bits per pixel (all channels)
DWORD ChannelsPerPixel; // number of color channels (samples) within a pixel
DWORD DataType; // current WIA_IPA_DATATYPE value describing the image
BYTE BitsPerChannel[8]; // up to 8 channels per pixel, use as many as needed
DWORD Compression; // current WIA_IPA_COMPRESSION value
DWORD PhotometricInterp; // current WIA_IPS_PHOTOMETRIC_INTERP value
DWORD LineOrder; // image line order as a WIA_LINE_ORDER value
DWORD RawDataOffset; // offset position (in bytes, starting from 0) for the raw image data
DWORD RawDataSize; // size of raw image data, in bytes
DWORD PaletteOffset; // offset position (in bytes, starting from 0) for the palette (0 if none)
DWORD PaletteSize; // size, in bytes, of color palette table (0 if no palette is required)
其他標頭欄位描述
DWORD 壓縮
允許壓縮的原始格式,例如 Nikon 的壓縮 NEF 和用於壓縮傳真傳輸的無標頭壓縮資料, (Group 3.1、3.2d、4) 。 此欄位的值會WIA_IPA_COMPRESSION常數,可能是特定應用程式的特定廠商。 預設值為 WIA_COMPRESSION_NONE。
壓縮範例:
G4 壓縮的資料 (WIA_COMPRESSION_G4) 可以在 TIFF 檔案 (WiaImgFmt_TIFF) 或使用原始格式 (WiaImgFmt_RAW) 傳輸。
JPEG 壓縮資料 (WIA_COMPRESSION_JPEG) 可以使用 JFIF 格式 (WiaImgFmt_JPEG) 、EEXIF 格式 (WiaImgFmt_EXIF) 或 TIFF 格式 (WiaImgFmt_TIFF) 傳輸。 您無法使用原始格式 (WiaImgFmt_RAW) 傳輸其中一種交換格式 (JFIF、EEXIF) 格式格式化的 JPEG 資料,而是必須使用其他其中一種 JPEG 相容格式。
如需 WIA 壓縮常數的詳細資訊,請參閱 WIA_IPA_COMPRESSION 屬性。
DWORD PhotometricInterp
描述傳輸之影像的相片對稱解譯。 此欄位是 (1bpp) 和灰階 (4bpp 或更多) 影像所需的欄位。 這些影像必須指出白色和黑色的值,其中 WIA_PHOTO_WHITE_1 (白色為 1、黑色為 1、黑色為 0) 或WIA_PHOTO_WHITE_0 (白色為 0、黑色為 1) 。 此欄位是色彩影像的選擇性欄位。
DWORD LineOrder
描述影像資料中的行/列是依上至下或由下至上排序。 這兩個新的常數是在 wiadef.h 中定義:
#define WIA_LINE_ORDER_TOP_TO_BOTTOM 0x00000001
#define WIA_LINE_ORDER_BOTTOM_TO_TOP 0x00000002
沒有為此定義的新屬性。 這不是可設定的掃描設定。 LingOrder 只有在執行影像資料傳輸時才重要。
DWORD RawDataSize
指出標頭之後原始資料的大小,以位元組為單位, (不包含選擇性調色盤) 。 應用程式可以使用此欄位來驗證假設成功傳輸影像的完成。 當 minidriver 在傳輸開始 (且標頭寫入資料流程) 時-例如,使用自動框線偵測掃描影像時,應該需要 minidriver 才能在影像資料傳輸結束時填入此欄位,類似于 XExtent 和 YExtent 欄位的處理方式。
DWORD 調色盤Offset
包含位移,以位元組為單位,其中調色盤會在資料流程中啟動;這個位移會在標頭結尾的位置) 位置零開始 (。 調色盤和原始影像資料可以依照任何順序追蹤原始標頭,而且不需要時可以省略調色盤。
DWORD 調色盤大小
包含調色盤的大小,以位元組為單位。 當不需要將調色盤附加至原始影像資料時,minidriver 應該將此欄位設定為 0。 此欄位與調色盤中的專案數目無關。
黑白和灰階資料可以省略調色盤 (,因為建置調色盤所需的資訊包含在 PhotometricInterpretation 欄位中) 或提供優化的調色盤以及 PhotometricInterpretation 欄位。
針對索引影像,調色盤中的專案數目是由目前的 BitsPerPixel 值所決定, (2 ^ BitsPerPixel。例如,1bpp 的 2 個專案、4bpp 的 16 個專案、8bpp) 256 個專案。 調色盤專案的格式是由 BitsPerChannel 欄位中的專案數所決定, (每個調色盤專案中的欄位/通道數目) 和 BitsPerChannel 值, (每個欄位會包含個別通道的 BitsPerChannel 欄位中所指定的值) 。 每個調色盤專案欄位都必須對齊 BYTE。