Main Page   Modules   Compound List   File List   Compound Members   File Members  

image_io.h File Reference

#include <gandalf/image/image_defs.h>

Go to the source code of this file.

Enumerations

enum  Gan_ImageFileFormat {
  GAN_PNG_FORMAT, GAN_PBM_FORMAT, GAN_PGM_FORMAT, GAN_PPM_FORMAT,
  GAN_TIFF_FORMAT, GAN_JPEG_FORMAT, GAN_UNKNOWN_FORMAT
}
 Image file formats supported by Gandalf. More...


Functions

Gan_ImageFileFormat gan_image_interpret_format_string (const char *format_string)
 Interprets a string as an image file format.

Gan_Imagegan_image_read (const char *filename, Gan_ImageFileFormat file_format, Gan_Image *image)
 Reads an image file.

Gan_Imagegan_image_read_stream (FILE *infile, Gan_ImageFileFormat file_format, Gan_Image *image)
 Reads an image file from a file stream.

Gan_Bool gan_image_write (const char *filename, Gan_ImageFileFormat file_format, Gan_Image *image)
 Writes an image file.

Gan_Bool gan_image_write_stream (FILE *outfile, Gan_ImageFileFormat file_format, Gan_Image *image)
 Writes an image file to a file stream.


Detailed Description

Module: Image file I/O functions

Part of: Gandalf Library

Revision: Last edited: Author:

Copyright: (c) 2000 Imagineer Software Limited


Function Documentation

Gan_ImageFileFormat gan_image_interpret_format_string const char *    format_string
 

Interprets a string as an image file format.

Parameters:
format_string File format string, e.g. "png"
Returns:
GAN_UNKNOWN_FORMAT on failure to interpret string, or else a successfully interpreted file format, e.g. GAN_PNG_FORMAT.
Attempts to interpret the given string format_string as a file name suffix or other identifying string for a specific image format known by Gandalf, which is returned.

Gan_Image* gan_image_read const char *    filename,
Gan_ImageFileFormat    file_format,
Gan_Image   image
 

Reads an image file.

Parameters:
filename The name of the image file
file_format The format of the file, e.g. GAN_PNG_FORMAT
image The image structure to read the image data into or NULL
Returns:
Pointer to image structure, or NULL on failure.
Reads an image from the given file filename into the provided image structure. If image is NULL a new image is dynamically allocated; otherwise the already allocated image structure is reused.

If the file format is known, it should be specified in file_format; otherwise pass file_format as GAN_UNKNOWN_FORMAT and the function will try to determine the file format.

See also:
gan_write_image().

Gan_Image* gan_image_read_stream FILE *    infile,
Gan_ImageFileFormat    file_format,
Gan_Image   image
 

Reads an image file from a file stream.

Parameters:
infile Input file stream
file_format The format of the file, e.g. GAN_PNG_FORMAT
image The image structure to read the image data into or NULL
Returns:
Pointer to image structure, or NULL on failure.
Reads an image from the given file stream infile into the provided image structure. If image is NULL a new image is dynamically allocated; otherwise the already allocated image structure is reused.

If the file format is known, it should be specified by file_format; otherwise pass file_format as GAN_UNKNOWN_FORMAT and the function will try to determine the file format.

See also:
gan_write_image_stream().

Gan_Bool gan_image_write const char *    filename,
Gan_ImageFileFormat    file_format,
Gan_Image   image
 

Writes an image file.

Parameters:
filename The name of the image file
file_format The format of the file, e.g. GAN_PNG_FORMAT
image The image structure to be written to the file
Returns:
GAN_TRUE on successful write operation, GAN_FALSE on failure.
Writes an image from the provided image structure into the given file.

The given file format file_format should support the format and type of the image; otherwise an error is reported and GAN_FALSE is returned.

See also:
gan_read_image().

Gan_Bool gan_image_write_stream FILE *    outfile,
Gan_ImageFileFormat    file_format,
Gan_Image   image
 

Writes an image file to a file stream.

Parameters:
outfile Output file stream
file_format The format of the file, e.g. GAN_PNG_FORMAT
image The image structure to be written to the file
Returns:
GAN_TRUE on successful write operation, GAN_FALSE on failure.
Writes an image from the provided image structure into the given file stream.

The given file format file_format should support the format and type of the image; otherwise an error is reported and GAN_FALSE is returned.

See also:
gan_read_image().


Generated on Mon Oct 13 16:14:42 2003 by doxygen1.3-rc1