다음을 통해 공유


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 Compression
Nikon의 압축된 NEF 및 압축 팩스 전송에 사용되는 헤더 없는 압축 데이터(그룹 3.1, 3.2d, 4)와 같은 압축된 원시 형식을 허용합니다. 이 필드의 값은 WIA_IPA_COMPRESSION 상수로, 특수 애플리케이션에 대한 공급업체별 값일 수 있습니다. 기본값은 WIA_COMPRESSION_NONE.

Compression Examples:

G4 압축 데이터(WIA_COMPRESSION_G4)는 TIFF 파일(WiaImgFmt_TIFF) 내에서 또는 원시 형식(WiaImgFmt_RAW)을 사용하여 전송할 수 있습니다.

JFIF 형식(WiaImgFmt_JPEG), EEXIF 형식(WiaImgFmt_EXIF) 또는 TIFF 형식(WiaImgFmt_TIFF)을 사용하여 JPEG 압축 데이터(WIA_COMPRESSION_JPEG)를 전송할 수 있습니다. 원시 형식(WiaImgFmt_RAW)을 사용하여 전송 내에서 교환 형식(JFIF, EEXIF) 중 하나로 형식이 지정된 JPEG 데이터를 전송할 수 없습니다. 대신 다른 JPEG 호환 형식 중 하나를 사용해야 합니다.

For more information on the WIA compression constants, see the WIA_IPA_COMPRESSION property.

DWORD PhotometricInterp
전송되는 이미지의 사진 메트릭 해석에 대해 설명합니다. 이 필드는 흑백(1bpp) 및 회색조(4bpp 이상) 이미지에 필요합니다. 이러한 이미지는 WIA_PHOTO_WHITE_1(흰색은 1, 검은색은 0) 또는 WIA_PHOTO_WHITE_0(여기서 흰색은 0, 검은색은 1)에 대한 값을 나타내야 합니다. 이 필드는 색 이미지에 대해 선택 사항입니다.

DWORD LineOrder
이미지 데이터의 줄/행이 위에서 아래로 정렬되는지 아니면 맨 위에서 위로 정렬되는지를 설명합니다. Two new constants were defined in wiadef.h for this:

#define  WIA_LINE_ORDER_TOP_TO_BOTTOM        0x00000001 
#define  WIA_LINE_ORDER_BOTTOM_TO_TOP        0x00000002

이에 대해 정의된 새 속성이 없습니다. 이는 구성 가능한 검사 설정이 아닙니다. LingOrder only matters when executing image data transfers.

DWORD RawDataSize
머리글 뒤의 원시 데이터의 크기(바이트)를 나타냅니다(선택적 색상표 포함 안 됨). 애플리케이션은 이 필드를 사용하여 성공적인 이미지 전송이 완료되었는지 확인할 수 있습니다. 전송이 시작될 때(및 헤더가 스트림에 기록됨) 미니 드라이버에 이 정보를 알 수 없는 경우(예: 자동 테두리 검색을 사용하여 이미지를 스캔할 때) XExtent 및 YExtent 필드가 처리되는 방식과 유사하게 이미지 데이터 전송의 끝에 이 필드를 입력하려면 미니 드라이버가 필요합니다.

DWORD PaletteOffset
데이터 스트림에서 색상표가 시작되는 오프셋(바이트)을 포함합니다. 이 오프셋은 헤더가 끝나는 위치 0에서 시작됩니다. 색상표 및 원시 이미지 데이터는 임의의 순서로 원시 헤더를 따를 수 있으며 필요하지 않은 경우 색상표를 생략할 수 있습니다.

DWORD PaletteSize
색상표의 크기(바이트)를 포함합니다. 원시 이미지 데이터에 연결해야 하는 색상표가 없는 경우 미니 드라이버는 이 필드를 0으로 설정해야 합니다. 이 필드는 색상표의 항목 수와 관련이 없습니다.

Black and white and grayscale data can omit the palette (because the information required to build the palette is contained in the PhotometricInterpretation field) or supply an optimized palette along with the PhotometricInterpretation field.

For indexed images, the number of entries in the color palette is dictated by the current BitsPerPixel value (2 ^ BitsPerPixel. For example, 2 entries for 1bpp, 16 entries for 4bpp, 256 entries for 8bpp). The format of the palette entries would be dictated by the number of entries in BitsPerChannel field (the number of fields/channels in each palette entry) and BitsPerChannel values (each field would contain exactly the value specified in the BitsPerChannel field for the respective channel). 각 색상표 항목 필드는 BYTE에 맞춰야 합니다.