[ Previous | Next | Contents | Glossary | Home | Search ]
Ultimedia Services Version 2 for AIX: Programmer's Guide and Reference

UMSJPEGDecoder Object

The JPEG decoder object provides methods to decompress JPEG image formats. It is presented in the class library for editing and format-conversion purposes.

Note: The UMSJPEGDecoder object is shipped for compatibility with the Ultimedia Services Version 1.1.0 product. The function provided is redundant with the UMSJPEGVideoDecoder object. The UMSJPEGVideoDecoder object is the preferred object for decoding JPEG video, since it inherits methods from the UMSVideoDecoder base video decoder class.

To learn more about the UMSJPEGDecoder object, see:

For introductory information, see Video Codec Objects.

Enumeration Lists

To avoid name collision on defines, integer values have been captured as enumerated lists. The set of valid values from an enumerated lists can vary with the application. The detailed method descriptions describe the valid or possible values for the specific use. The enumerated lists that are defined for this object are:

enum ReturnCode {
      Success,
      Failure,
      UnsupportedFormat,
      OutOfRange,
      Uninitialized,
      WrongImageSize
      };
enum ImageFormatOut  {
      RGB8Dither,
      RGB24,
      Mono8,
      RGB
      };

Method Descriptions

ReturnCode decompress_frame(in char *comp_frame, in char *image_frame)

Description

This method accepts an encoded JPEG frame and produces an output image in the format specified.

Arguments
in char *comp_frame Pointer to the start of the compressed frame data.
in char *image_frame Pointer to the start of the expanded image data.
Return Values

Success

UnsupportedFormat

Failure

WrongImageSize

ReturnCode get_color_map(in char *color_map)

Description

This method allows the application to get a copy of the decoder's color map.

Arguments
in char *color_map A pointer to a reserved memory area in the application space that can be used to copy the color map from the decoder to the application. The colors are formatted as:
Overlay : Red : Green : Blue - Entry 0
Overlay : Red : Green : Blue - Entry 1
 .
Overlay : Red : Green : Blue - Entry size-1

where each entry is a 32-bit record containing 8-bit color lookup values.

Return Values

Success

ReturnCode get_colormap_attributes(out long colormap_base_index, out long colormap_size)

Description

This method gets the attributes for the color map used by the decoder to create the image frame.

Arguments
out long colormap_base_index The base address of the JPEG color map in the output AIXwindows window color map.
out long colormap_size The length of the color map array for each color.
Return Values

Success

ReturnCode get_component_number(in char *comp_frame, out long component_number)

Description

This function gets the number of components from the compressed frame data. For a color image, the component_number is equal to 3. For a monochrome image, the component_number is equal to 1.

Arguments
in char *comp_frame Pointer to the start of the compressed frame data.
out long component_number Number of components in the frame.
Return Values

Success

UnsupportedFormat

Failure

ImageFormatOut get_image_format()

Description

This method allows the application to query the output image format.

Return Values

Any of the ImageFormatOut values are possible.

ReturnCode get_image_size(in char *comp_frame, out long width, out long height)

Description

This method allows the application to query the dimensions of the encoded image frame. If comp_frame is equal to NULL, get_image_size returns the width and height set by set_image_size. In case the width and height are not set by set_image_size, Uninitialized is returned. If comp_frame is not equal to NULL, the width and height extracted from the compressed frame data are returned.

Arguments
in char *comp_frame Pointer to the start of the compressed frame data.
out long width The width of the image.
out long height The height of the image.
Return Values

Success

UnsupportedFormat

Uninitialized

Failure

ReturnCode set_colormap_attributes(in long colormap_base_index, in long colormap_size)

Description

This method sets up attributes of the decoder's internal color map. The default colormap_size is 224 and the default colormap_base_index is 32. Currently, the default values are the only valid settings. This method is only used if the output image format is RGB8Dither.

Arguments
in long colormap_base_index Sets the base address of the JPEG color map in the output AIXwindows window color map.
in long colormap_size The number of color table entries that should be used by the decoder.
Return Values

Success

Failure

ReturnCode set_image_format(in ImageFormatOut image_format)

Description

This method sets the format of the output image data to be created by the decoder. If the format is unsupported, an error code is returned.

Arguments
in ImageFormatOut image_format Possible values are RGB8Dither, RGB24, Mono8, and RGB.
Return Values

Success

UnsupportedFormat

ReturnCode set_image_size(in long width, in long height)

Description

This method allows the application to specify the dimensions of the input decoded frame. The image frame to be created has dimensions that match the original encoded image.

Arguments
in long width The width of the image.
in long height The height of the image.
Return Values

Success

Failure

For introductory information, see Video Codec Objects.


[ Previous | Next | Contents | Glossary | Home | Search ]