fiasco(3)

NAME
fiasco_renderer_new, fiasco_renderer_delete - convert a FIASCO image object to an X11 XImage

SYNOPSIS
#include <fiasco.h>

fiasco_renderer_t *
fiasco_renderer_new (unsigned long red_mask,
unsigned long green_mask,
unsigned long blue_mask,
unsigned bpp,
int double_resolution);

void
fiasco_renderer_delete (fiasco_renderer_t * renderer);

int
fiasco_renderer_render (const fiasco_renderer_t * renderer,
unsigned char * data);
const fiasco_image_t * fiasco_image);

DESCRIPTION
The fiasco_renderer_new() function allocates and initializes a renderer object which has to be used to convert an internal FIASCO image object to one of the supported X11 formats. Currently, the FIASCO image can be rendered to an X11 XImage of either 16, 24, or 32 bits per pixel. Additional formats will be supported upon request. Function fiasco_renderer_render() is used to convert the given FIASCO image object to the specified format. After all frames are rendered, the function fiasco_renderer_delete() should be called to free temporarily allocated memory and to discard the renderer object. Note that the FIASCO renderer class is not restricted to X11 images: a FIASCO image object can be converted to an image data array of the form RGBRGB... by setting red_mask=0xff0000, green_mask=0xff00, blue_mask=0xff, and bpp=24.

ARGUMENTS

bpp Determines the number of bits of a single pixel of the X11 XImage structure (see XCreateImage(3)). If the XImage is already allocated then the value XImage->bits_per_pixel should be used. Currently, 16, 24, and 32 bits per pixel are supported.

red_mask
    Determines which bits of a pixel should be used for the red component. If the XImage is already allocated then the value XImage->red_mask should be used. E.g., if bpp=16 and red_mask=0xf800 then each pixel is stored with two bytes. The red component uses bits 11-15, the remaining green and blue components use bits 0-10.

green_mask
    Determines which bits of a pixel should be used for the green component. If the XImage is already allocated then the value XImage->green_mask should be used.

blue_mask
    Determines which bits of a pixel should be used for the blue component. If the XImage is already allocated then the value XImage->blue_mask should be used.

data
    A pointer to the image data. If the XImage is already allocated then the value XImage->data should be used. This array has to be large enough to hold the decoded image at the given size (geometry and bits per pixel).

fiasco_image
    This object represents the decoded image which has been created by the FIASCO functions fiasco_decoder_get_frame(3) or fiasco_image_new(3).

RETURN VALUE
The function fiasco_renderer_new() returns a pointer to the newly allocated renderer object. If an error has been caught, a NULL pointer is returned. The function fiasco_renderer_render() returns 1 if the image has been successfully converted. Otherwise, the function returns 0. In case of an error in one of the above functions, use the function fiasco_get_error_message(3) to get a string with the last error message of FIASCO.

SEE ALSO
fiasco_decoder_get_frame(3), fiasco_get_error_message(3) fiasco_image_new(3)
Ullrich Hafner, Juergen Albert, Stefan Frank, and Michael Unger. Weighted Finite Automata for Video Compression, IEEE Journal on Selected Areas In Communications, January 1998
Ullrich Hafner. Low Bit-Rate Image and Video Coding with Weighted Finite Automata, Ph.D. thesis, Mensch & Buch Verlag, ISBN 3-89820-002-7, October 1999.

AUTHOR
Ullrich Hafner