[ VIGRA Homepage | Class Index | Function Index | File Index | Main Page ]

details ImageExportInfo Class Reference VIGRA

Argument object for the function exportImage(). See exportImage() for usage example. This object must be used to define the properties of an image to be written to disk. More...

#include "vigra/imageinfo.hxx"


Public Methods

 ImageExportInfo (const char *)
ImageExportInfo & setFileType (const char *)
ImageExportInfo & setCompression (const char *)
ImageExportInfo & setPixelType (const char *)
const char * getPixelType () const
ImageExportInfo & setXResolution (float)
ImageExportInfo & setYResolution (float)


Detailed Description


Argument object for the function exportImage(). See exportImage() for usage example. This object must be used to define the properties of an image to be written to disk.

#include "vigra/imageinfo.hxx"
Namespace: vigra

Examples:

convert.cxx, edge.cxx, invert.cxx, invert_explicitly.cxx, profile.cxx, pyramid.cxx, resize.cxx, smooth.cxx, subimage.cxx, voronoi.cxx, and watershed.cxx.


Constructor & Destructor Documentation


ImageExportInfo const char *   

 

Construct ImageExportInfo object.

The image will be stored under the given filename. The file type will be guessed from the extension unless overridden by setFileType(). Recognized extensions: '.bmp', '.gif', '.jpeg', '.jpg', '.p7', '.png', '.pbm', '.pgm', '.pnm', '.ppm', '.ras', '.tif', '.tiff', '.xv'. JPEG support requires libjpeg, PNG support requires libpng, and TIFF support requires libtiff.


Member Function Documentation


const char* getPixelType  

 

Get the pixel type of the image. Possible values are:

"UINT8"
8-bit unsigned integer (unsigned char)
"INT16"
16-bit signed integer (short)
"INT32"
32-bit signed integer (long)
"FLOAT"
32-bit floating point (float)
"DOUBLE"
64-bit floating point (double)


ImageExportInfo& setCompression const char *   

 

Set compression type.

Recognized strings: "" (no compression), "LZW", "RunLength", "1" ... "100". A number is interpreted as the compression quality for JPEG compression. JPEG compression is supported by the JPEG and TIFF formats. "LZW" is only available if libtiff was installed with LZW enabled. By default, libtiff comes with LZW disabled due to Unisys patent enforcement. In this case, VIGRA stores the image uncompressed.


ImageExportInfo& setFileType const char *   

 

Store image as given file type.

This will override any type guessed from the file name's extension. Recognized file types:

"BMP"
Microsoft Windows bitmap image file.
"GIF"
CompuServe graphics interchange format; 8-bit color.
"JPEG"
Joint Photographic Experts Group JFIF format; compressed 24-bit color (only available if libjpeg is installed).
"PNG"
Portable Network Graphic (only available if libpng is installed).
"PBM"
Portable bitmap format (black and white).
"PGM"
Portable graymap format (gray scale).
"PNM"
Portable anymap.
"PPM"
Portable pixmap format (color).
"SUN"
SUN Rasterfile.
"TIFF"
Tagged Image File Format. (only available if libtiff is installed.)
"VIFF"
Khoros Visualization image file.

With the exception of TIFF and VIFF, all file types store 1 byte (gray scale and mapped RGB) or 3 bytes (RGB) per pixel.

TIFF and VIFF are aditionally able to store short and long integers (2 or 4 bytes) and real values (32 bit float and 64 bit double) without conversion. So you will need to use TIFF or VIFF if you need to store images with high accuracy (the appropriate type to write is automatically derived from the image type to be exported). However, many other programs using TIFF (e.g. ImageMagick) have not implemented support for those pixel types. So don't be surprised if the generated TIFF is not readable in some cases. If this happens, export the image as 'unsigned char' or 'RGBValue<unsigned char>' by calling ImageExportInfo::setPixelType().


ImageExportInfo& setPixelType const char *   

 

Set the pixel type of the image file. Possible values are:

"UINT8"
8-bit unsigned integer (unsigned char)
"INT16"
16-bit signed integer (short)
"INT32"
32-bit signed integer (long)
"FLOAT"
32-bit floating point (float)
"DOUBLE"
64-bit floating point (double)

Usage: FImage img(w,h);

by default, float images are exported with pixeltype float when the target format support this type, i.e. is TIFF or VIFF. exportImage(srcImageRange(img), ImageExportInfo("asFloat.tif"));

if this is not desired, force a different pixeltype exportImage(srcImageRange(img), ImageExportInfo("asByte.tif").setPixelType("UINT8"));


ImageExportInfo& setXResolution float   

 

Set the image resolution in horizontal direction


ImageExportInfo& setYResolution float   

 

Set the image resolution in vertical direction


The documentation for this class was generated from the following file:

© Ullrich Köthe (koethe@informatik.uni-hamburg.de)
Cognitive Systems Group, University of Hamburg, Germany

html generated using doxygen and Python
VIGRA 1.3.3 (18 Aug 2005)