PICTools Programmer's Reference
BITMAPINFOHEADER

The PIC_PARM Head field is a BITMAPINFOHEADER. This is the identical structure defined in Windows. The PICTools operations have extended the values available for biCompression and they have slightly overloaded the meaning of biClrImportant as it is related to biClrUsed.  PICTools operations also fully initialize the BITMAPINFOHEADER fields. Windows allows some fields to be 0 if the correct value can then be computed using other fields. Therefore, a BITMAPINFOHEADER in a file not created by PICTools operations might have values that are not fully consistent with the following descriptions.

 
Copy Code
typedef struct {
   DWORD       biSize;
   LONG        biWidth;
   LONG        biHeight;
   WORD        biPlanes;
   WORD        biBitCount;
   DWORD       biCompression;
   DWORD       biSizeImage;
   LONG        biXPelsPerMeter;
   LONG        biYPelsPerMeter;
   DWORD       biClrUsed;
   DWORD       biClrImportant;
} BITMAPINFOHEADER;

Fields:

Name Description

biSize

Set to sizeof(BITMAPINFOHEADER).

biWidth

Width of the image in pixels.

biHeight

Height of the image in pixel lines.

biPlanes

Always 1.

biBitCount

The number of bits per pixel.  Standard Windows .BMP files allow values of 1, 4, 8, 16, 24, and 32.  16-bit Windows has difficulty with 16 and 32.  Not all values are permitted by all PICTools operations.  The number of bits per pixel is directly related to the maximum possible number of colors per pixel.  As each bit can represent 2 colors, the maximum number of colors is 2 raised to the biBitCount power - except the 32-bits/pixel format reserves the high-order 8 bits for other purposes which are not standardized.  Thus the number of colors for 32 bits per pixel is ordinarily regarded as the same as the number of colors for 24 bits per pixel.

biCompression

This value indicates the format of the image.  The possible values as extended by the PICTools operations are:

Value

Meaning

BI_BMPO

Old-style BMP uncompressed (and OS/2 1.x)

BI_BMPR

New-style BMP RLE

BI_CALS

CALS image

BI_C4

C4 image

BI_CMYK

CMYK 4-byte interlaced

BI_DCX

Generic DCX

BI_DCXZ

DCX multi-image

BI_EMF

Enhanced Windows Metafile

BI_G3

Raw G3 Fax 1D

BI_G32D

Raw G3 Fax 2D

BI_GIFI

GIF interlaced

BI_GIFN

GIF non-interlaced

BI_GIFu

GIF unknown

BI_GR12

Gray 12 bpp, uncompressed, low-order bits in 16 bit field

BI_HDP

JPEG XR/ HDPhoto File

BI_IYUV

MS Video IYUV subtype

BI_I420

MS Video I420 subtype

BI_ICON

.ICO image

BI_IOCA

IOCA image

BI_J2K

JPEG2000 image

BI_JB2

JBIG2 image

BI_JLS

JPEG-LS

BI_picJPEG

Sequential JPEG compressed

BI_JPEG is provided as a synonym for BI_picJPEG when not defined by the operating system (e.g., later versions of Windows). It is provided for compatibility with older applications and should not be used in new development.

BI_JPGE

Sequential JPEG PIC-enhanced compression

BI_JPGL

Lossless JPEG

BI_MDCA

MO:DCA

BI_OS2

OS2 2.x+ uncompressed

BI_PCD

PhotoCD generic

BI_PCX

PCX generic

BI_PCX1

PCX 1-bit

BI_PCX2

PCX 2-bit (CGA) (color map)

BI_PCX3

PCX 3-bit (EGA) (color map)

BI_PCX4

PCX 4-bit (color map)

BI_PCX8

PCX 8-bit (color map)

BI_PCXT

PCX 24-bit

BI_PBM

Portable Bitmap 1bpp

BI_PBMA

ASCII Portable Bit Map up to 1bpp

BI_PDF

PDF wrapper around images

PI_PGM

Portable Bit Map up to 8bpp Gray

PI_PGMA

ASCII Portable Bit Map up to 8bpp Gray

BI_PIC1

PIC-format IM1 compressed

BI_PIC4

PIC-format IM4 compressed

BI_PIC8

PIC-format IM8 compressed

BI_PICG

G3/G4

BI_PICJ

PIC-format sequential JPEG

BI_PICL

PIC-format IMStar compressed

BI_PICP

PIC-format progressive JPEG

BI_PJPG

Progressive JPEG compressed

BI_PNG1

PNG monochrome non-interlaced

BI_PNG2

PNG gray scale non-interlaced

BI_PNG3

PNG color map non-interlaced

BI_PNG4

PNG rgb non-interlaced

BI_PNG5

PNG monochrome interlaced

BI_PNG6

PNG gray scale interlaced

BI_PNG7

PNG color map interlaced

BI_PNG8

PNG rgb interlaced

BI_PNM

Portable Any Map (generic name)

BI_PPM

Portable Bit Map 24bpp RGB

BI_RGB

Windows .BMP uncompressed

BI_RGBA

RGBA ordered B/G/R/A

BI_RGB565

RGB 5-6-5

BI_TGA

Targa generic

BI_TGA1

Targa type 1 (color map) uncompressed

BI_TGA2

Targa type 2 (bgr) uncompressed

BI_TGA3

Targa type 3 (gray)  uncompressed

BI_TGA9

Targa type 9 (color map) RLE

BI_TGAA

Targa type 10 (bgr) RLE

BI_TGAB

Targa type 11 (gray) RLE

BI_TIF

TIFF generic

BI_TIF1

TIFF 1-bit

BI_TIFC

TIFF 24-bit (rgb)

BI_TIFG

TIFF up to 8-bit (gray scale)

BI_TIFJ

TIFF JPEG

BI_TIFK

TIFF CMYK

BI_TIFL

TIFF LZW

BI_TIFM

TIFF up to 8-bit (color map)

BI_TIFu

TIFF unknown

BI_TIFZ

TIFF multi-image

BI_UYVY

MS Video UYVY subtype

BI_YUY2

MS Video YUY2 subtype

BI_YV12

MS Video YV12 subtype

BI_WAVE

Wavelet

BI_WAVP

Progressive Wavelet

BI_WBMP

Wireless Bitmap

BI_WMF

Windows Metafile

BI_WSQ

WSQ compressed

biSizeImage

This value is the size in bytes of the image data.  Each pixel line may be padded out to some boundary, frequently a DWORD boundary, so computing the biSizeImage, even for a DIB, is not necessarily as straightforward as multiplying the width times the height times the bits per pixel and dividing by 8 bits per byte.

biXPelsPerMeter

This value is stored and retrieved by the PICTools operations.

biYPelsPerMeter

This value is stored and retrieved by the PICTools operations.

biClrUsed

This is the number of RGBQUAD elements in the ColorTable associated with the image.  If there is no ColorTable associated with the image, this will be 0.

biClrImportant

This is the number of RGBQUAD elements in the ColorTable which are used in the image.  The first biClrImportant elements of ColorTable are used. biClrImportant is always less than or equal to biClrUsed.

Some PICTools operations overload the meaning slightly.  If biClrImportant is less than biClrUsed, then the colors from the ColorTable element whose index is biClrImportant and extending to the end of the ColorTable, can be used as a secondary ColorTable.  This allows optimal color tables to be determined based on two different image bit depths and allows both to be embedded in the image.

 

 


©2022. Accusoft Corporation. All Rights Reserved.

Send Feedback