Compaq Multimedia Services
for OpenVMS Alpha
Programmer's Guide


Previous Contents Index


ICCompressQuery

Name ICCompressQuery --- Determine if a compressor can compress a specific format Syntax


#include <mme/mme_api.h> 
 
MMRESULT ICCompressQuery(HIC hic, 
                         LPBITMAPINFOHEADER lpbiInput, 
                         LPBITMAPINFOHEADER lpbiOutput); 
Arguments HIC hic
Specifies a handle to a compressor.

LPBITMAPINFOHEADER lpbiInput
Specifies a pointer to a BITMAPINFOHEADER data structure indicating the input data.

The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICCompressQuery function. See Chapter 2 for more information about the memory allocation functions.

LPBITMAPINFOHEADER lpbiOutput
Specifies a pointer to a BITMAPINFOHEADER data structure indicating the format of the data output. If NULL, then any output format is acceptable.

The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICCompressQuery function. See Chapter 2 for more information about the memory allocation functions.


Description

The ICCompressQuery function determines if a compressor can compress a specific format.
Extensions None.

Return Values

1
Returns ICERR_OK if the compression is supported; otherwise, it returns one of the following error codes:
Error Code Description
ICERR_BADHANDLE The hic argument is invalid, the compressor is not open, or the compressor is not open for compression.
ICERR_BADFORMAT The lpbiOutput and lpbiInput arguments are not acceptable formats.
See Also ICCompressGetFormat , ICCompressGetSize

ICCompressUnprepareHeader

Name ICCompressUnprepareHeader --- Unprepare compression headers Syntax


#include <mme/mme_api.h> 
 
MMRESULT ICCompressUnprepareHeader(HIC hic, 
                                   LPBITMAPINFOHEADER lpbiOutput, 
                                   LPVOID lpData, 
                                   LPBITMAPINFOHEADER lpbiInput, 
                                   LPVOID lpBits); 
Arguments HIC hic
Specifies a handle to a compressor.

LPBITMAPINFOHEADER lpbiOutput
Specifies a pointer to a BITMAPINFOHEADER data structure holding the output format. The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICCompressUnprepareHeader function. See Chapter 2 for more information about allocating memory for data structures.

LPVOID lpData
Specifies a pointer to the output data buffer. The data buffer must be allocated with the mmeAllocBuffer function before being passed to the ICCompressUnprepareHeader function. See Chapter 2 for more information about allocating memory for data buffers.

LPBITMAPINFOHEADER lpbiInput
Specifies a pointer to a BITMAPINFOHEADER data structure containing the input format.

The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICCompressUnprepareHeader function. See Chapter 2 for more information about allocating memory for data structures.

LPVOID lpBits
Specifies a pointer to the input data buffer. The data buffer must be allocated with the mmeAllocBuffer function before being passed to the ICCompressUnprepareHeader function. See Chapter 2 for more information about allocating memory for data buffers.


Description

The ICCompressUnprepareHeader function unprepares buffers prepared with ICCompressUnprepareHeader .

This function should be called before ICCompressEnd and after all compression operations have been completed and all buffers have been returned to the application.

Extensions The ICCompressUnprepareHeader function is a Compaq extension to the Microsoft multimedia API specification.

Return Values

1
Returns ICERR_OK if the function is successful; otherwise, it returns one of the following error codes:
Error Code Description
ICERR_BADHANDLE The hic argument is invalid, the compressor is not open, or the compressor is not open for compression.
ICERR_BADPARAM The lpbiInput or lpbiOutput, or lpData or lpBits arguments are NULL; or the hardware cannot be properly set up for the operation. The parameters are not the same as those specified in the ICCompressBegin call (with the exception of the biSizeImage fields). The buffers have not been previously prepared.
ICERR_CANTUPDATE The compressor is not in operation, that is, ICCompressBegin has not yet been called or ICCompressEnd has been called. The buffer should be unprepared before calling ICCompressEnd . Some compressors may choose to unprepare all prepared headers when ICCompressEnd is called.
ICERR_INTERNAL An internal driver error occurred. No more detailed information is available.
See Also ICCompressBegin , ICCompressEnd , ICCompressPrepareHeader

ICDecompress

Name ICDecompress --- Decompress a single video frame Syntax


#include <mme/mme_api.h> 
 
MMRESULT ICDecompress(HIC hic, 
                      DWORD dwFlags, 
                      LPBITMAPINFOHEADER lpbiFormat, 
                      LPVOID lpData, 
                      LPBITMAPINFOHEADER lpbi, 
                      LPVOID lpBits); 
Arguments HIC hic
Specifies a handle to a decompressor.

DWORD dwFlags
Specifies flags for decompression. The following flags are defined:

ICDECOMPRESS_HURRYUP
Indicates that the decompressor should try to decompress at a faster rate. When an application uses this flag, it should not draw the decompressed data.
NULL
Indicates that the decompressor will decompress at normal rate.

LPBITMAPINFOHEADER lpbiFormat
Specifies a pointer to a BITMAPINFOHEADER data structure containing the format of the compressed data.

The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICDecompress function. See Chapter 2 for more information about the memory allocation functions.

LPVOID lpData
Specifies a pointer to the input data. The data buffer must be allocated with the mmeAllocBuffer function before being passed to the ICDecompress function. See Chapter 2 for more information about the memory allocation functions.

LPBITMAPINFOHEADER lpbi
Specifies a pointer to a BITMAPINFOHEADER data structure containing the output format.

The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICDecompress function. See Chapter 2 for more information about the memory allocation functions.

LPVOID lpBits
Specifies a pointer to a data buffer for the decompressed data. The data buffer must be allocated with the mmeAllocBuffer function before being passed to the ICDecompress function. See Chapter 2 for more information about the memory allocation functions.


Description

The ICDecompress function decompresses a single video frame.

The lpBits argument must point to a buffer large enough to hold the decompressed data. Applications can calculate the size of this buffer using information returned from the ICDecompressGetFormat function. However, if an application requires the X image or YUV image format, it must calculate the buffer size using one of the following formulas:
Format Bits/Pixel Formula
BICOMP_DECXIMAGEDIB 8 PAD(width) * height * 1
BICOMP_DECXIMAGEDIB 24 PAD(width) * height * 4
BICOMP_DECYUVDIB 16 PAD(width) * height * 2

where PAD is:

#define PAD(size) (((size) + 3) & ~0x3)

X images must be padded to 4 bytes on each scanline.

The performance of the AlphaStation's built-in HX display and any other HX (also called SFB) graphics controller is improved if X images are aligned on 8-byte boundaries and have scanline widths that are multiples of 8.

The biSizeImage field in the lpbiFormat argument may change for each call to the ICDecompress function to reflect different sizes of compressed data buffers. To change any other fields in either the lpbiFormat or lpbi arguments, the decompression device must be reconfigured by calling the ICDecompressEnd function, followed by the ICDecompressBegin function.

Note

Some video devices may check decompression parameters, detect a change, and reconfigure themselves. In these cases, the ICDecompress function can return error codes associated with the ICDecompressEnd and ICDecompressBegin functions.
Extensions None.

Return Values

1
Returns ICERR_OK if the function is successful; otherwise, it returns one of the following error codes:
Error Code Description
ICERR_BADHANDLE The hic argument is invalid, the decompressor is not open, or the decompressor is not open for decompression.
ICERR_BADFORMAT The lpbiFormat and lpbi arguments are not acceptable formats.
ICERR_BADIMAGESIZE The specified image size is invalid.
ICERR_BADPARAM The lpbiFormat or lpbi, or lpData or lpBits arguments are NULL; or the hardware cannot be properly set up for the operation.
See Also ICDecompressBegin , ICDecompressEnd , ICDecompressGetFormat

ICDecompressBegin

Name ICDecompressBegin --- Prepare a decompressor for decompressing data Syntax


#include <mme/mme_api.h> 
 
MMRESULT ICDecompressBegin(HIC hic, 
                           LPBITMAPINFOHEADER lpbiInput, 
                           LPBITMAPINFOHEADER lpbiOutput); 
Arguments HIC hic
Specifies a handle to a decompressor.

LPBITMAPINFOHEADER lpbiInput
Specifies a pointer to a BITMAPINFOHEADER data structure indicating the format of the input data.

The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICDecompressBegin function. See Chapter 2 for more information about the memory allocation functions.

LPBITMAPINFOHEADER lpbiOutput
Specifies a pointer to a BITMAPINFOHEADER data structure indicating the format of the output data.

The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICDecompressBegin function. See Chapter 2 for more information about the memory allocation functions.


Description

The ICDecompressBegin function prepares a decompressor for decompressing data. Call this function before calling the ICDecompress function.

The ICDecompressBegin function returns the ICERR_ERROR error code when attempting to decompress to 8-bit X image format and the palette has not been negotiated with the ICDecompressGetPalette function. A palette is not required for 24-bit X image, YUV, or BI_BITFIELDS format.

Extensions None.

Return Values

1
Returns ICERR_OK if the specified decompression is supported; otherwise, it returns one of the following error codes:
Error Code Description
ICERR_BADHANDLE The hic argument is invalid, the decompressor is not open, or the decompressor is not open for decompression.
ICERR_BADFORMAT The lpbiInput and lpbiOutput arguments are not acceptable formats.
ICERR_BADPARAM The lpbiInput argument, lpbiOutput argument, or both are NULL.
ICERR_ERROR A palette has not been negotiated.
See Also ICCompressBegin , ICDecompress , ICDecompressEnd

ICDecompressEnd

Name ICDecompressEnd --- End decompression Syntax


#include <mme/mme_api.h> 
 
MMRESULT ICDecompressEnd(HIC hic) 
Arguments HIC hic
Specifies a handle to a decompressor.


Description

The ICDecompressEnd function tells a decompressor to end decompression.
Extensions None.

Return Values

1
Returns ICERR_OK if the function is successful; otherwise, it returns the following error code:
Error Code Description
ICERR_BADHANDLE The hic argument is invalid, the decompressor is not open, or the decompressor is not open for decompression.
See Also ICCompressEnd , ICDecompress , ICDecompressBegin

ICDecompressGetFormat

Name ICDecompressGetFormat --- Determine the default output of a decompressor Syntax


#include <mme/mme_api.h> 
 
MMRESULT ICDecompressGetFormat(HIC hic, 
                               LPBITMAPINFOHEADER lpbiInput, 
                               LPBITMAPINFOHEADER lpbiOutput); 
Arguments HIC hic
Specifies a handle to a decompressor.

LPBITMAPINFOHEADER lpbiInput
Specifies a pointer to a BITMAPINFOHEADER data structure indicating the format of the input data.

The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICDecompressGetFormat function. See Chapter 2 for more information about the memory allocation functions.

LPBITMAPINFOHEADER lpbiOutput
Specifies a pointer to a BITMAPINFOHEADER data structure used to return the format of the output data.

The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICDecompressGetFormat function. See Chapter 2 for more information about the memory allocation functions.


Description

The ICDecompressGetFormat function determines the default output of a decompressor.
Extensions None.

Return Values

1
Returns the size in bytes of the decompressor's default output if the function is successful; otherwise, it returns one of the following error codes:
Error Code Description
ICERR_BADHANDLE The hic argument is invalid, the decompressor is not open, or the decompressor is not open for decompression.
ICERR_BADFORMAT The lpbiInput and lpbiOutput arguments are not acceptable formats.

If the default output requires a colormap, the output size includes enough space to contain the colormap. If the default output does not require a colormap, then that information is not available from the ICDecompressGetFormat function. See Also ICDecompress , ICDecompressGetFormatSize , ICDecompressGetPalette ,
ICDecompressQuery


ICDecompressGetFormatSize

Name ICDecompressGetFormatSize --- Obtain the maximum required size of the output structure for the decompressor Syntax


#include <mme/mme_api.h> 
 
MMRESULT ICDecompressGetFormatSize(HIC hic, 
                                   LPBITMAPINFOHEADER lpbi); 
Arguments HIC hic
Specifies a handle to a decompressor.

LPBITMAPINFOHEADER lpbi
Specifies a pointer to a BITMAPINFOHEADER data structure indicating the format of the input data.

The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICDecompressGetFormatSize function. See Chapter 2 for more information about the memory allocation functions.


Description

The ICDecompressGetFormatSize function obtains the maximum required size in bytes of the output structure for the decompressor. Use the ICDecompressGetFormatSize function to determine the size of the output format buffer that must be allocated for the ICDecompressGetFormat function. If any of the possible output formats requires an RGBQUAD palette, then the maximum output size would include the size required to contain that palette.
Extensions None.

Return Values

1
Returns the maximum required size in bytes of the output structure for the decompressor if the function is successful; otherwise, it returns one of the following error codes:
Error Code Description
ICERR_BADHANDLE The hic argument is invalid, the decompressor is not open, or the decompressor is not open for decompression.
ICERR_BADFORMAT The lpbi argument is not an acceptable format.
See Also ICDecompressGetFormat

ICDecompressGetPalette

Name ICDecompressGetPalette --- Obtain the palette for the output format of a decompressor Syntax


#include <mme/mme_api.h> 
 
MMRESULT ICDecompressGetPalette(HIC hic, 
                                LPBITMAPINFOHEADER lpbiInput, 
                                LPBITMAPINFOHEADER lpbiOutput); 
Arguments HIC hic
Specifies a handle to a decompressor.

LPBITMAPINFOHEADER lpbiInput
Specifies a pointer to a BITMAPINFOHEADER data structure indicating the format of the input data.

The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICDecompressGetPalette function. See Chapter 2 for more information about the memory allocation functions.

LPBITMAPINFOHEADER lpbiOutput
Specifies a pointer to a BITMAPINFOHEADER data structure used to return the color table. The space reserved for the color table must accommodate a full color table for the output format. For instance, if the biBitCount field is 4, then the table must accommodate 16 entries; if the biBitCount field is 8, then the table must accommodate 256 entries.

The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICDecompressGetPalette function. See Chapter 2 for more information about the memory allocation functions.


Description

The ICDecompressGetPalette function obtains the palette for the output format of a decompressor. The palette is the range of colors that can be used for display.

The return value will be the size in bytes that includes the colormap supported by the decompressor.

See Section 5.2.4.3 for more information about specifying the palette.

Extensions Compaq has extended the data in the BITMAPINFOHEADER and RGBQUAD data structures pointed to by the lpbiOutput argument of the ICDecompressGetPalette function. These extensions have been made in order to provide the palette information necessary to render images to the X image format.

See Section 5.2.4.3 for more information about the extensions to the data structure and specifying the palette.


Return Values

1
Returns the size of the output data format structure if the function is successful; otherwise, it returns one of the following error codes:
Error Code Description
ICERR_BADHANDLE The hic argument is invalid, the decompressor is not open, or the decompressor is not open for decompression.
ICERR_BADFORMAT The lpbiInput and lpbiOutput arguments are not acceptable formats.
See Also ICDecompressGetFormat


Previous Next Contents Index