[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
Image Import/Export Facilities |
Classes | |
class | ImageExportInfo |
Argument object for the function exportImage(). More... | |
class | ImageImportInfo |
Argument object for the function importImage(). More... | |
Functions | |
template<... > | |
void | exportImage (...) |
Write an image to a file. More... | |
template<... > | |
void | exportImageAlpha (...) |
Write the image and its alpha channel to a file. More... | |
std::string | impexListExtensions () |
List the file extension VIGRA understands. More... | |
std::string | impexListFormats () |
List the image formats VIGRA can read and write. More... | |
template<... > | |
void | importImage (...) |
Read an image from a file. More... | |
template<... > | |
void | importImageAlpha (...) |
Read the image specified by the given vigra::ImageImportInfo object including its alpha channel. More... | |
bool | isImage (char const *filename) |
Test whether a file is an image format known to VIGRA. More... | |
supports GIF, TIFF, JPEG, BMP, EXR, HDR, PNM (PBM, PGM, PPM), PNG, SunRaster, KHOROS-VIFF formats
std::string vigra::impexListFormats | ( | ) |
List the image formats VIGRA can read and write.
This is useful for creating error messages if VIGRA encounters an image format it doesn't recognize.
Usage:
#include <vigra/imageinfo.hxx>
Namespace: vigra
std::string vigra::impexListExtensions | ( | ) |
List the file extension VIGRA understands.
This is useful for creating file dialogs that only list image files VIGRA can actually import.
Usage:
#include <vigra/imageinfo.hxx>
Namespace: vigra
bool vigra::isImage | ( | char const * | filename | ) |
Test whether a file is an image format known to VIGRA.
This checks the first few bytes of the file and compares them with the "magic strings" of each recognized image format.
Usage:
#include <vigra/imageinfo.hxx>
Namespace: vigra
void vigra::importImage | ( | ... | ) |
Read an image from a file.
If the first parameter is vigra::ImageImportInfo, this function assumes that the destination image has already the appropriate shape. If the first parameter is a string, the destination must be a vigra::MultiArray reference, which will be reshaped automatically.
If the input image has only a single band, but the destination has multiple bands (e.g. is an RGB image), all bands will receive the same data. When a multi-band file is read into a single-band destination array, only the first band is read. Any other mismatch between the number of bands in input and output is an error and will throw a precondition exception.
Declarations
pass 2D array views:
Usage:
#include <vigra/impex.hxx>
Namespace: vigra
When the type of input image is already known, this can be shortened:
Preconditions
Type | Extension | Name | Support Library |
---|---|---|---|
BMP | bmp | Microsoft Windows bitmap image file | |
EXR | exr | OpenEXR high dynamic range image format | libopenexr |
GIF | gif | CompuServe graphics interchange format, 8-bit color | |
HDR | hdr | Radiance RGBE high dynamic range image format | |
JPEG | jpg, jpeg | Joint Photographic Experts Group JFIF format, 24-bit color | libjpeg |
PBM | pbm | Portable bitmap format (black and white) | |
PGM | pgm | Portable graymap format (gray scale) | |
PNG | png | Portable Network Graphic | libpng |
PNM | pnm | Portable anymap | |
PPM | ppm | Portable pixmap format (color) | |
SUN | ras | SUN Rasterfile | |
TIFF | tif, tiff | Tagged Image File Format | libtiff |
VIFF | xv | Khoros Visualization image file |
void vigra::exportImage | ( | ... | ) |
Write an image to a file.
The file can be specified either by a file name or by a vigra::ImageExportInfo object. In the latter case, you have much more control about how the file is written. By default, the file format to be created is guessed from the filename extension. This can be overridden by an explicit file type in the ImageExportInfo object. If the file format supports compression (e.g. JPEG and TIFF), default compression parameters are used which can be overridden by the ImageExportInfo object.
If the file format to be created supports the pixel type of the source image, this pixel type will be kept in the file (e.g. float
can be stored by TIFF without conversion) unless the ImageExportInfo object explicitly requests a different storage type. If the array's pixel type is not supported by the file format, the pixel values are transformed to the range 0..255 and converted to unsigned char
, unless another mapping is explicitly requested by the ImageExportInfo object.
Currently, the following file formats are supported. The pixel types given in brackets are those that are written without conversion:
Declarations
pass 2D array views:
Usage:
#include <vigra/impex.hxx>
Namespace: vigra
Preconditions
void vigra::importImageAlpha | ( | ... | ) |
Read the image specified by the given vigra::ImageImportInfo object including its alpha channel.
See importImage() for more information.
Declarations
pass 2D array views:
Usage:
#include <vigra/impexalpha.hxx>
Namespace: vigra
Preconditions
void vigra::exportImageAlpha | ( | ... | ) |
Write the image and its alpha channel to a file.
See exportImage() for more information.
Declarations
pass 2D array views:
Usage:
#include <vigra/impexalpha.hxx>
Namespace: vigra
Preconditions
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|