Bitmap Functions, Macros, and Data

The Wxutil.h header file in the Microsoft® DirectShow® base classes provides functions and macros to help convert between VIDEOINFOHEADER and BITMAPINFO structures.

BIT_MASKS_MATCH Compares the masks of two video images.
BITMASKS Retrieves a pointer to the array of bitmasks for the specified VIDEOINFOHEADER structure.
COLORS Retrieves a pointer to an array of RGBQUAD structures that describes the color palette for the specified VIDEOINFOHEADER structure.
ContainsPalette Checks if the video image contains a color palette.
DIBSIZE Calculates the byte size of the specified bitmap
GetBitCount Finds the number of bits per pixel.
GetBitmapFormatSize Finds the size (in bytes) needed to build a VIDEOINFOHEADER structure and related data.
GetBitmapPalette Finds the first palette entry in a VIDEOINFOHEADER structure.
GetBitmapSize Finds the size (in bytes) needed to hold an image.
GetBitmapSubtype Finds the GUID subtype for a given bitmap info header structure.
GetSubtypeName Finds the (debug) name for a given GUID subtype.
GetTrueColorType Finds the GUID subtype for a given bitmap header.
HEADER Retrieves a pointer to the image data from the specified video image.
MPEG1_SEQUENCE_INFO Retrieves the sequence header for the specified MPEG-1 video image.
PALETTISED Checks if the video image's color palette is 8-bit or less.
PALETTE_ENTRIES Returns the number of colors in the video image's palette.
RESET_MASKS Clears the specified video image's bitmasks.
RESET_HEADER Clears the specified video image.
RESET_PALETTE Clears the specified video image's color palette.
SIZE_EGA_PALETTE Calculates the size of the EGA (4-bit) color palette.
SIZE_MASKS Calculates the size of the mask's color palette.
SIZE_MPEG1VIDEOINFO Calculates the size of the specified MPEG-1 video image.
SIZE_PALETTE Calculates the size of the 8-bit color palette.
SIZE_PREHEADER Calculates the byte offset for the video image's bitmap information.
SIZE_VIDEOHEADER Calculates the size of the video image.
TRUECOLORINFO Retrieves a pointer to an array of TRUECOLORINFO structures that describes the bitmasks and color palette for the specified VIDEOINFOHEADER structure.

These functions are made available to help manage VIDEOINFOHEADER structures, which are used throughout DirectShow to describe video data streams. Although similar to the BITMAPINFO structure used in Microsoft® Win32® and existing multimedia, VIDEOINFOHEADER also adds some new video-specific fields.

Global dataDescription
bits555 Array of color bitmasks for an RGB 555 bitmap.
bits565 Array of color bitmasks for an RGB 565 bitmap.
bits888 Array of color bitmasks for an RGB 24-bit bitmap.

BIT_MASKS_MATCH

Bitmap Functions, Macros, and Data

Retrieves the bitmasks for the specified video image.

Syntax

BIT_MASKS_MATCH(
  pbmi1,
  pbmi2
  )

Parameters

pbmi1
Pointer to a Win32 VIDEOINFOHEADER structure that contains the first video image.
pbmi2
Pointer to a Win32 VIDEOINFOHEADER structure that contains the second video image.

Return Value

Returns nonzero if the bitmasks for both video images are identical or zero otherwise.

BITMASKS

Bitmap Functions, Macros, and Data

Retrieves the bitmasks for the specified video image.

Syntax

BITMASKS(
  pbmi
  )

Parameters

pbmi
Pointer to a Win32 VIDEOINFOHEADER structure that contains the video image.

Return Value

Returns a pointer to the array of bitmasks for the specified VIDEOINFOHEADER structure.

COLORS

Bitmap Functions, Macros, and Data

Retrieves the color palette for the specified video image.

Syntax

COLORS(
  pbmi
  )

Parameters

pbmi
Pointer to a Win32 VIDEOINFOHEADER structure that contains the video image.

Return Value

Returns a pointer to an array of RGBQUAD structures that describes the color palette for the specified VIDEOINFOHEADER structure.

ContainsPalette

Bitmap Functions, Macros, and Data

Checks if the specified video image contains a color palette.

Syntax

BOOL ContainsPalette(
  const VIDEOINFOHEADER *pVideoInfo
  );

Parameters

pVideoInfo
Pointer to a VIDEOINFOHEADER structure.

Return Value

Returns TRUE if the VIDEOINFOHEADER structure contains a color palette or FALSE otherwise.

DIBSIZE

Bitmap Functions, Macros, and Data

Calculates the byte size of the specified (device-independent) bitmap.

Syntax

DIBSIZE(
  bi
  )

Parameters

bi
A Win32 BITMAPINFOHEADER structure that specifies the source bitmap.

Return Value

Returns the byte size of the bi parameter.

GetBitCount

Bitmap Functions, Macros, and Data

Finds the number of bits per pixel.

Syntax

WORD GetBitCount(
  const GUID *pSubtype
  );

Parameters

pSubtype
Pointer to a GUID for a given video subtype.

Return Value

Returns the number of bits per pixel for this subtype, or USHRT_MAX if an error occurred.

GetBitmapFormatSize

Bitmap Functions, Macros, and Data

Finds the size (in bytes) needed to build a VIDEOINFOHEADER structure and related data.

Syntax

LONG GetBitmapFormatSize(
  const BITMAPINFOHEADER *pHeader
  );

Parameters

pHeader
Pointer to a Win32 BITMAPINFOHEADER structure.

Return Value

Returns the number of bytes for the VIDEOINFOHEADER structure described by this BITMAPINFOHEADER, including prefix information, the BITMAPINFOHEADER field, and any other color information on the end.

GetBitmapPalette

Bitmap Functions, Macros, and Data

Finds the first palette for a VIDEOINFOHEADER structure.

Syntax

const RGBQUAD * GetBitmapPalette(
  const VIDEOINFOHEADER *pVideoInfo
  );

Parameters

pVideoInfo
Pointer to a VIDEOINFOHEADER structure.

Return Value

Returns a pointer to the first entry in a palette.

GetBitmapSize

Bitmap Functions, Macros, and Data

Finds the number of bytes needed to hold an image.

Syntax

DWORD GetBitmapSize(
  const BITMAPINFOHEADER *pHeader
  );

Parameters

pHeader
Pointer to a Win32 BITMAPINFOHEADER structure.

Return Value

Returns the number of bytes needed to hold an image.

GetBitmapSubtype

Bitmap Functions, Macros, and Data

Finds the subtype for the specified bitmap.

Syntax

const GUID GetBitmapSubtype(
  const BITMAPINFOHEADER *pHeader
  );

Parameters

pHeader
Pointer to a Win32 BITMAPINFOHEADER structure.

Return Value

Returns the video subtype GUID of the bitmap specified by pHeader, or GUID_NULL if pHeader is NULL.

GetSubtypeName

Bitmap Functions, Macros, and Data

Retrieves the name for a given GUID subtype.

Syntax

TCHAR * GetSubtypeName(
  const GUID *pSubtype
  );

Parameters

pSubtype
Pointer to a GUID for a given video subtype.

Return Value

Returns the debug name of this GUID, or UNKNOWN if the name is not known.

GetTrueColorType

Bitmap Functions, Macros, and Data

Finds the subtype for the specified 16-bit color bitmap.

Syntax

const GUID GetTrueColorType(
  const BITMAPINFOHEADER *pHeader
  );

Parameters

pHeader
Pointer to a Win32 BITMAPINFOHEADER structure.

Return Value

Returns the video subtype GUID of the 16-bit color bitmap specified by pHeader, or GUID_NULL if pHeader is NULL.

HEADER

Bitmap Functions, Macros, and Data

Retrieves a pointer to the image data from the specified video image.

Syntax

HEADER(
  pVideoInfo
  )

Parameters

pVideoInfo
Pointer to the VIDEOINFOHEADER structure that specifies the video image.

Return Value

Returns a pointer to the Win32 BITMAPINFOHEADER structure contained in the VIDEOINFOHEADER structure's bmiHeader data member.

MPEG1_SEQUENCE_INFO

Bitmap Functions, Macros, and Data

Retrieves the sequence header for the specified MPEG-1 video image.

Syntax

MPEG1_SEQUENCE_INFO(
  pv
  )

Parameters

pv
Pointer to an MPEG1VIDEOINFO structure.

Return Value

Returns the bSequenceHeader data member of the specified MPEG1VIDEOINFO structure.

PALETTISED

Bitmap Functions, Macros, and Data

Checks if the video image's color palette is 8-bit or less.

Syntax

PALETTISED(
  pbmi
  )

Parameters

pbmi
Pointer to the Win32 BITMAPINFOHEADER structure that specifies the video image.

Return Value

Returns nonzero if the video image's palette contains 256 or fewer colors, or zero otherwise.

PALETTE_ENTRIES

Bitmap Functions, Macros, and Data

Retrieves the number of colors in the video image's palette.

Syntax

PALETTE_ENTRIES(
  pbmi
  )

Parameters

pbmi
Pointer to the Win32 BITMAPINFOHEADER structure that specifies the video image.

Return Value

Returns the number of colors in the video image's palette.

RESET_MASKS

Clears the specified video image's bitmasks.

Syntax

RESET_MASKS(
  pbmi
  )

Parameters

pbmi
Pointer to the Win32 BITMAPINFOHEADER structure that specifies the video image.

Return Value

No return value.

RESET_HEADER

Bitmap Functions, Macros, and Data

Clears the specified video image.

Syntax

RESET_HEADER(
  pbmi
  )

Parameters

pbmi
Pointer to the Win32 BITMAPINFOHEADER structure that specifies the video image.

Return Value

No return value.

RESET_PALETTE

Bitmap Functions, Macros, and Data

Clears the specified video image's color palette.

Syntax

RESET_PALETTE(
  pbmi
  )

Parameters

pbmi
Pointer to the Win32 BITMAPINFOHEADER structure that specifies the video image.

Return Value

No return value.

SIZE_EGA_PALETTE

Bitmap Functions, Macros, and Data

Calculates the size of a 4-bit color palette.

Syntax

SIZE_EGA_PALETTE

Return Value

Returns the size of a 16-color palette, in bytes.

SIZE_MASKS

Bitmap Functions, Macros, and Data

Calculates the size of a bitmask's color palette.

Syntax

SIZE_MASKS

Return Value

Returns the size, in bytes, of a bitmap mask's color palette, which has three colors.

SIZE_MPEG1VIDEOINFO

Bitmap Functions, Macros, and Data

Calculates the size of the specified MPEG-1 video image.

Syntax

SIZE_MPEG1VIDEOINFO(
  pv
  )

Parameters

pv
Pointer to the MPEG1VIDEOINFO structure that specifies the video image.

Return Value

Returns the byte size of the specified MPEG1VIDEOINFO structure.

SIZE_PALETTE

Bitmap Functions, Macros, and Data

Calculates the size of the 8-bit color palette.

Syntax

SIZE_PALETTE

Return Value

Returns the size of the 256-color palette.

SIZE_PREHEADER

Bitmap Functions, Macros, and Data

Calculates the byte offset for the video image's bitmap information.

Syntax

SIZE_PREHEADER

Return Value

Returns the byte offset of the VIDEOINFOHEADER structure's bmiHeader data member.

SIZE_VIDEOHEADER

Bitmap Functions, Macros, and Data

Calculates the size of the video image.

Syntax

SIZE_VIDEOHEADER

Return Value

Returns the combined size of all of the VIDEOINFOHEADER structure's data members.

TRUECOLORINFO

Bitmap Functions, Macros, and Data

Retrieves the color palette and bitmasks for the specified video image.

Syntax

TRUECOLORINFO(
  pbmi
  )

Parameters

pbmi
Pointer to a Win32 VIDEOINFOHEADER structure that contains the video image.

Return Value

Returns a pointer to an array of TRUECOLORINFO structures that describes the bitmasks and color palette for the specified VIDEOINFOHEADER structure.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.