fiasco(3)

NAME
fiasco_decoder_new, fiasco_decoder_delete, fiasco_decoder_write_frame, fiasco_decoder_get_frame, fiasco_decoder_get_length, fiasco_decoder_get_rate, fiasco_decoder_get_width, fiasco_decoder_get_height fiasco_decoder_get_title, fiasco_decoder_get_comment fiasco_decoder_is_color - decompress a FIASCO file

SYNOPSIS
#include <fiasco.h>

fiasco_decoder_t *
fiasco_decoder_new (const char * fiasco_name,
const fiasco_d_options_t * options);

void
fiasco_decoder_delete (fiasco_decoder_t * decoder);

int
fiasco_decoder_write_frame (fiasco_decoder_t * decoder,
const char * image_name);

fiasco_image_t *
fiasco_decoder_get_frame (fiasco_decoder_t * decoder);

unsigned
fiasco_decoder_get_length (fiasco_decoder_t * decoder);

unsigned
fiasco_decoder_get_rate (fiasco_decoder_t * decoder);

unsigned
fiasco_decoder_get_width (fiasco_decoder_t * decoder);

unsigned
fiasco_decoder_get_height (fiasco_decoder_t * decoder);

const char *
fiasco_decoder_get_title (fiasco_decoder_t * decoder);

const char *
fiasco_decoder_get_comment (fiasco_decoder_t * decoder);

int
fiasco_decoder_is_color (fiasco_decoder_t * decoder);

DESCRIPTION
The fiasco_decoder_new() function initializes the decompression of FIASCO file fiasco_name. Several decompression parameters can be adjusted by the class options (see fiasco_d_options_new(3)). The individual frames of a FIASCO video can be decompressed by calling successively either function fiasco_decoder_write_frame() or fiasco_decoder_get_frame(). The function fiasco_decoder_write_frame() decompresses the current frame and writes it in raw pgm(5) or ppm(5) format to the file image_name. If image_name=- or a NULL pointer then the image file is produced on the standard output. If image_name is a relative path and the environment variable FIASCO_IMAGES is a (colon-separated) list of directories, then the output file is written to the first (writable) directory of this list. Otherwise, the current directory is used to store the file. The function fiasco_decoder_get_frame() decompresses the current frame and returns the computed image object. Use the function fiasco_renderer_new(3) to create a renderer object that converts the FIASCO image to the desired format. After all frames have been decompressed, the function fiasco_decoder_delete() should be called to close the input file and to free temporarily allocated memory. Number of available frames, frame rate and frames geometry, type of the FIASCO file are accessible through member functions fiasco_decoder_get_length(), fiasco_decoder_get_rate(), fiasco_decoder_get_width(), fiasco_decoder_get_height(), and fiasco_decoder_is_color(). Use fiasco_decoder_get_title(), fiasco_decoder_get_comment() to read title and comment strings of the FIASCO file.

ARGUMENTS

fiasco_name
    Filename of the FIASCO input file. If fiasco_name is a NULL pointer or "-" then the decoder reads from standard input. If the file is not found in the current directory and the environment variable FIASCO_DATA is a (colon-separated) list of directories, then the input file is searched for in these directories, too.

options
    This "class" encapsulates the various coding and decoding parameters. Use the functions fiasco_d_options_new(3) and fiasco_d_options_delete(3) to create and delete an object of this class. Several member functions (see fiasco_d_options(3)) are available to change the default values.

decoder
    The decoder "class" encapsulates the FIASCO decoder. It is used to store the internal state of the decoder.

RETURN VALUES
The function fiasco_decoder_new() returns a pointer to the newly allocated decoder object. If an error has been catched, a NULL pointer is returned. The function fiasco_decoder_write_frame() returns 1 if the file has been successfully written. Otherwise, the function returns 0. The function fiasco_decoder_get_frame() returns a pointer to the newly allocated FIASCO image object. If an error has been catched, a NULL pointer is returned. The function fiasco_decoder_get_length() returns the number of frames of the FIASCO file. If an error has been catched, 0 is returned. The function fiasco_decoder_get_rate() returns the framerate (number of frames per second) of the FIASCO file. If an error has been catched, 0 is returned. The function fiasco_decoder_get_width() returns the width of the decoded frames of the FIASCO file. If an error has been catched, 0 is returned. The function fiasco_decoder_get_height() returns the height of the decoded frames of the FIASCO file. If an error has been catched, 0 is returned. The function fiasco_decoder_get_title() returns an optional title of the FIASCO file. If an error has been catched, 0 is returned. The function fiasco_decoder_get_comment() returns an optional comment of the FIASCO file. If an error has been catched, 0 is returned. The function fiasco_decoder_is_color() returns 0 if the decoded frames are grayscale images, otherwise a non-zero value is returned. In case of an error in one of the above functions, use the function fiasco_get_error_message(3) to get a string describing the last error message of FIASCO.

ENVIRONMENT
FIASCO_IMAGES
    Search path for image files. Default is "./".
FIASCO_DATA
    Search and save path for FIASCO files. Default is "./".

SEE ALSO
fiasco_d_options_new(3), fiasco_d_options_delete(3),
fiasco_d_options(3), fiasco_get_error_message(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 <hafner@bigfoot.de>