Jump to content

BITMAPINFO2: Difference between revisions

From EDM2
Created page with "Bit-map information structure. Each bit plane logically contains (cx * cy * cBitCount) bits, although the actual length can be greater because of padding. ; Note: Many fun..."
 
Ak120 (talk | contribs)
m hs
Line 1: Line 1:
Bit-map information structure.  
Bit-map information structure.


Each bit plane logically contains (cx * cy * cBitCount) bits, although the actual length can be greater because of padding.  
Each bit plane logically contains (cx * cy * cBitCount) bits, although the actual length can be greater because of padding.


; Note: Many functions can accept either this structure or the [[BITMAPINFO]] structure. Where possible, BITMAPINFO2 should be used.  
;Note: Many functions can accept either this structure or the [[BITMAPINFO]] structure. Where possible, BITMAPINFO2 should be used.


The cbFix field is used to find the color table, if any, that goes with the information in this structure. A color table is an array of color (RGB2) values. If there are N bits per pel (N = cPlanes * cBitCount), the array contains 2**N color values. However, if N = 24, the color table is not required (because the standard-format bit map, with 24 bits per pel, is assumed to contain RGB values), unless either cclrUsed or cclrImportant is non-zero.  
The cbFix field is used to find the color table, if any, that goes with the information in this structure. A color table is an array of color (RGB2) values. If there are N bits per pel (N = cPlanes * cBitCount), the array contains 2**N color values. However, if N = 24, the color table is not required (because the standard-format bit map, with 24 bits per pel, is assumed to contain RGB values), unless either cclrUsed or cclrImportant is non-zero.


==Type==
==Type==
  typedef struct _BITMAPINFO2 {
  typedef struct _BITMAPINFO2 {
   ULONG     cbFix;           /* Length of fixed portion of structure. */
   ULONG   cbFix;           /* Length of fixed portion of structure. */
   ULONG     cx;               /* Bit-map width in pels. */
   ULONG   cx;             /* Bit-map width in pels. */
   ULONG     cy;               /* Bit-map height in pels. */
   ULONG   cy;             /* Bit-map height in pels. */
   USHORT     cPlanes;         /* Number of bit planes. */
   USHORT cPlanes;         /* Number of bit planes. */
   USHORT     cBitCount;       /* Number of bits per pel within a plane. */
   USHORT cBitCount;       /* Number of bits per pel within a plane. */
   ULONG     ulCompression;   /* Compression scheme used to store the bit map. */
   ULONG   ulCompression;   /* Compression scheme used to store the bit map. */
   ULONG     cbImage;         /* Length of bit-map storage data, in bytes. */
   ULONG   cbImage;         /* Length of bit-map storage data, in bytes. */
   ULONG     cxResolution;     /* Horizontal component of the resolution of target device. */
   ULONG   cxResolution;   /* Horizontal component of the resolution of target device. */
   ULONG     cyResolution;     /* Vertical component of the resolution of the target device. */
   ULONG   cyResolution;   /* Vertical component of the resolution of the target device. */
   ULONG     cclrUsed;         /* Number of color indexes used. */
   ULONG   cclrUsed;       /* Number of color indexes used. */
   ULONG     cclrImportant;   /* Minimum number of color indexes for satisfactory appearance of the bit map. */
   ULONG   cclrImportant;   /* Minimum number of color indexes for satisfactory appearance of the bit map. */
   USHORT     usUnits;         /* Units of measure. */
   USHORT usUnits;         /* Units of measure. */
   USHORT     usReserved;       /* Reserved. */
   USHORT usReserved;     /* Reserved. */
   USHORT     usRecording;     /* Recording algorithm. */
   USHORT usRecording;     /* Recording algorithm. */
   USHORT     usRendering;     /* Halftoning algorithm. */
   USHORT usRendering;     /* Halftoning algorithm. */
   ULONG     cSize1;           /* Size value 1. */
   ULONG   cSize1;         /* Size value 1. */
   ULONG     cSize2;           /* Size value 2. */
   ULONG   cSize2;         /* Size value 2. */
   ULONG     ulColorEncoding; /* Color encoding. */
   ULONG   ulColorEncoding; /* Color encoding. */
   ULONG     ulIdentifier;     /* Reserved for application use. */
   ULONG   ulIdentifier;   /* Reserved for application use. */
   RGB2       argbColor[1];     /* Array of RGB values. */
   RGB2   argbColor[1];   /* Array of RGB values. */
  } BITMAPINFO2;
  } BITMAPINFO2;


==C Declaration Method==
==C Declaration Method==
typedef BITMAPINFO2 *PBITMAPINFO2;
typedef BITMAPINFO2 *PBITMAPINFO2;
 


[[Category:Data type]]
[[Category:Data type]]

Revision as of 16:52, 8 February 2020

Bit-map information structure.

Each bit plane logically contains (cx * cy * cBitCount) bits, although the actual length can be greater because of padding.

Note
Many functions can accept either this structure or the BITMAPINFO structure. Where possible, BITMAPINFO2 should be used.

The cbFix field is used to find the color table, if any, that goes with the information in this structure. A color table is an array of color (RGB2) values. If there are N bits per pel (N = cPlanes * cBitCount), the array contains 2**N color values. However, if N = 24, the color table is not required (because the standard-format bit map, with 24 bits per pel, is assumed to contain RGB values), unless either cclrUsed or cclrImportant is non-zero.

Type

typedef struct _BITMAPINFO2 {
 ULONG   cbFix;           /* Length of fixed portion of structure. */
 ULONG   cx;              /* Bit-map width in pels. */
 ULONG   cy;              /* Bit-map height in pels. */
 USHORT  cPlanes;         /* Number of bit planes. */
 USHORT  cBitCount;       /* Number of bits per pel within a plane. */
 ULONG   ulCompression;   /* Compression scheme used to store the bit map. */
 ULONG   cbImage;         /* Length of bit-map storage data, in bytes. */
 ULONG   cxResolution;    /* Horizontal component of the resolution of target device. */
 ULONG   cyResolution;    /* Vertical component of the resolution of the target device. */
 ULONG   cclrUsed;        /* Number of color indexes used. */
 ULONG   cclrImportant;   /* Minimum number of color indexes for satisfactory appearance of the bit map. */
 USHORT  usUnits;         /* Units of measure. */
 USHORT  usReserved;      /* Reserved. */
 USHORT  usRecording;     /* Recording algorithm. */
 USHORT  usRendering;     /* Halftoning algorithm. */
 ULONG   cSize1;          /* Size value 1. */
 ULONG   cSize2;          /* Size value 2. */
 ULONG   ulColorEncoding; /* Color encoding. */
 ULONG   ulIdentifier;    /* Reserved for application use. */
 RGB2    argbColor[1];    /* Array of RGB values. */
} BITMAPINFO2;

C Declaration Method

typedef BITMAPINFO2 *PBITMAPINFO2;