Index Topic Contents | |||
Previous Topic: BSTR Functions Next Topic: CBaseRenderer Callback Function |
Bitmap Functions, Macros, and Data
The Wxutil.h header file in the DirectShow base classes provides functions and macros to help convert between VIDEOINFOHEADER and BITMAPINFO structures.
Function Description 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 Data Description 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. Bitmap Functions, Macros, and Data
BIT_MASKS_MATCHRetrieves the bitmasks for the specified video image.
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 Values
Returns nonzero if the bitmasks for both video images are identical or zero otherwise.
Bitmap Functions, Macros, and Data
BITMASKSRetrieves the bitmasks for the specified video image.
BITMASKS(
pbmi
)Parameters
- pbmi
- Pointer to a Win32 VIDEOINFOHEADER structure that contains the video image.
Return Values
Returns a pointer to the array of bitmasks for the specified VIDEOINFOHEADER structure.
Bitmap Functions, Macros, and Data
COLORSRetrieves the color palette for the specified video image.
COLORS(
pbmi
)Parameters
- pbmi
- Pointer to a Win32 VIDEOINFOHEADER structure that contains the video image.
Return Values
Returns a pointer to an array of RGBQUAD structures that describes the color palette for the specified VIDEOINFOHEADER structure.
Bitmap Functions, Macros, and Data
ContainsPaletteChecks if the specified video image contains a color palette.
BOOL ContainsPalette(
const VIDEOINFOHEADER *pVideoInfo
);Parameters
- pVideoInfo
- Pointer to a VIDEOINFOHEADER structure.
Return Values
Returns TRUE if the VIDEOINFOHEADER structure contains a color palette or FALSE otherwise.
Bitmap Functions, Macros, and Data
DIBSIZECalculates the byte size of the specified bitmap.
DIBSIZE(
bi
)Parameters
- bi
- A Win32 BITMAPINFOHEADER structure that specifies the source bitmap.
Return Values
Returns the byte size of the bi parameter.
Bitmap Functions, Macros, and Data
GetBitCountFinds the number of bits per pixel.
WORD GetBitCount(
const GUID *pSubtype
);Parameters
- pSubtype
- Pointer to a GUID for a given video subtype.
Return Values
Returns the number of bits per pixel for this subtype, or USHRT_MAX if an error occurred.
Bitmap Functions, Macros, and Data
GetBitmapFormatSizeFinds the size (in bytes) needed to build a VIDEOINFOHEADER structure and related data.
LONG GetBitmapFormatSize(
const BITMAPINFOHEADER *pHeader
);Parameters
- pHeader
- Pointer to a Win32 BITMAPINFOHEADER structure.
Return Values
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.
Bitmap Functions, Macros, and Data
GetBitmapPaletteFinds the first palette for a VIDEOINFOHEADER structure.
const RGBQUAD * GetBitmapPalette(
const VIDEOINFOHEADER *pVideoInfo
);Parameters
- pVideoInfo
- Pointer to a VIDEOINFOHEADER structure.
Return Values
Returns a pointer to the first entry in a palette.
Bitmap Functions, Macros, and Data
GetBitmapSizeFinds the number of bytes needed to hold an image.
DWORD GetBitmapSize(
const BITMAPINFOHEADER *pHeader
);Parameters
- pHeader
- Pointer to a Win32 BITMAPINFOHEADER structure.
Return Values
Returns the number of bytes needed to hold an image.
Bitmap Functions, Macros, and Data
GetBitmapSubtypeFinds the subtype for the specified bitmap.
const GUID GetBitmapSubtype(
const BITMAPINFOHEADER *pHeader
);Parameters
- pHeader
- Pointer to a Win32 BITMAPINFOHEADER structure.
Return Values
Returns the video subtype GUID of the bitmap specified by pHeader, or GUID_NULL if pHeader is NULL.
Bitmap Functions, Macros, and Data
GetSubtypeNameRetrieves the name for a given GUID subtype.
TCHAR * GetSubtypeName(
const GUID *pSubtype
);Parameters
- pSubtype
- Pointer to a GUID for a given video subtype.
Return Values
Returns the debug name of this GUID, or UNKNOWN if the name is not known.
Bitmap Functions, Macros, and Data
GetTrueColorTypeFinds the subtype for the specified 16-bit color bitmap.
const GUID GetTrueColorType(
const BITMAPINFOHEADER *pHeader
);Parameters
- pHeader
- Pointer to a Win32 BITMAPINFOHEADER structure.
Return Values
Returns the video subtype GUID of the 16-bit color bitmap specified by pHeader, or GUID_NULL if pHeader is NULL.
Bitmap Functions, Macros, and Data
HEADERRetrieves a pointer to the image data from the specified video image.
HEADER(
pVideoInfo
)Parameters
- pVideoInfo
- Pointer to the VIDEOINFOHEADER structure that specifies the video image.
Return Values
Returns a pointer to the Win32 BITMAPINFOHEADER structure contained in the VIDEOINFOHEADER structure's bmiHeader data member.
Bitmap Functions, Macros, and Data
MPEG1_SEQUENCE_INFORetrieves the sequence header for the specified MPEG-1 video image.
MPEG1_SEQUENCE_INFO(
pv
)Parameters
- pv
- Pointer to an MPEG1VIDEOINFO structure.
Return Values
Returns the bSequenceHeader data member of the specified MPEG1VIDEOINFO structure.
Bitmap Functions, Macros, and Data
PALETTISEDChecks if the video image's color palette is 8-bit or less.
PALETTISED(
pbmi
)Parameters
- pbmi
- Pointer to the Win32 BITMAPINFOHEADER structure that specifies the video image.
Return Values
Returns nonzero if the video image's palette contains 256 or fewer colors, or zero otherwise.
Bitmap Functions, Macros, and Data
PALETTE_ENTRIESRetrieves the number of colors in the video image's palette.
PALETTE_ENTRIES(
pbmi
)Parameters
- pbmi
- Pointer to the Win32 BITMAPINFOHEADER structure that specifies the video image.
Return Values
Returns the number of colors in the video image's palette.
RESET_MASKSClears the specified video image's bitmasks.
RESET_MASKS(
pbmi
)Parameters
- pbmi
- Pointer to the Win32 BITMAPINFOHEADER structure that specifies the video image.
Return Values
No return value.
Bitmap Functions, Macros, and Data
RESET_HEADERClears the specified video image.
RESET_HEADER(
pbmi
)Parameters
- pbmi
- Pointer to the Win32 BITMAPINFOHEADER structure that specifies the video image.
Return Values
No return value.
Bitmap Functions, Macros, and Data
RESET_PALETTEClears the specified video image's color palette.
RESET_PALETTE(
pbmi
)Parameters
- pbmi
- Pointer to the Win32 BITMAPINFOHEADER structure that specifies the video image.
Return Values
No return value.
Bitmap Functions, Macros, and Data
SIZE_EGA_PALETTECalculates the size of a 4-bit color palette.
SIZE_EGA_PALETTE
Return Values
Returns the size of a 16-color palette, in bytes.
Bitmap Functions, Macros, and Data
SIZE_MASKSCalculates the size of a bitmask's color palette.
SIZE_MASKS
Return Values
Returns the size, in bytes, of a bitmap mask's color palette, which has three colors.
Bitmap Functions, Macros, and Data
SIZE_MPEG1VIDEOINFOCalculates the size of the specified MPEG-1 video image.
SIZE_MPEG1VIDEOINFO(
pv
)Parameters
- pv
- Pointer to the MPEG1VIDEOINFO structure that specifies the video image.
Return Values
Returns the byte size of the specified MPEG1VIDEOINFO structure.
Bitmap Functions, Macros, and Data
SIZE_PALETTECalculates the size of the 8-bit color palette.
SIZE_PALETTE
Return Values
Returns the size of the 256-color palette.
Bitmap Functions, Macros, and Data
SIZE_PREHEADERCalculates the byte offset for the video image's bitmap information.
SIZE_PREHEADER
Return Values
Returns the byte offset of the VIDEOINFOHEADER structure's bmiHeader data member.
Bitmap Functions, Macros, and Data
SIZE_VIDEOHEADERCalculates the size of the video image.
SIZE_VIDEOHEADER
Return Values
Returns the combined size of all of the VIDEOINFOHEADER structure's data members.
Bitmap Functions, Macros, and Data
TRUECOLORINFORetrieves the color palette and bitmasks for the specified video image.
TRUECOLORINFO(
pbmi
)Parameters
- pbmi
- Pointer to a Win32 VIDEOINFOHEADER structure that contains the video image.
Return Values
Returns a pointer to an array of TRUECOLORINFO structures that describes the bitmasks and color palette for the specified VIDEOINFOHEADER structure.
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.