VIGRA - ImageExportInfo class Reference

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

| ImageExportInfo Class Reference |
--- | --- | ---

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 Types
typedef ArrayVector< unsigned char > | ICCProfile
## Public Methods
VIGRA_EXPORT | ImageExportInfo (const char *)
VIGRA_EXPORT ImageExportInfo & | setFileType (const char *)
VIGRA_EXPORT ImageExportInfo & | setCompression (const char *)
VIGRA_EXPORT ImageExportInfo & | setPixelType (const char *)
VIGRA_EXPORT const char * | getPixelType () const
VIGRA_EXPORT ImageExportInfo & | setXResolution (float)
VIGRA_EXPORT ImageExportInfo & | setYResolution (float)
VIGRA_EXPORT ImageExportInfo & | setPosition (const Diff2D &pos)
VIGRA_EXPORT Diff2D | getPosition () const
VIGRA_EXPORT const ICCProfile & | getICCProfile () const
VIGRA_EXPORT ImageExportInfo & | setICCProfile (const ICCProfile &profile)

## 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.

## Member Typedef Documentation

typedef ArrayVector<unsigned char> ICCProfile

| ICC profiles (handled as raw data so far). see getICCProfile()/setICCProfile()

## Constructor & Destructor Documentation

VIGRA_EXPORT 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', '.hdr'. JPEG support requires libjpeg, PNG support requires libpng, and TIFF support requires libtiff.

## Member Function Documentation

VIGRA_EXPORT const ICCProfile& getICCProfile | ( |  | ) |

| Returns a reference to the ICC profile.

VIGRA_EXPORT 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)

VIGRA_EXPORT Diff2D getPosition | ( |  | ) |

| Get the position of the upper left corner on a global canvas.

VIGRA_EXPORT 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 came with LZW disabled due to Unisys patent enforcement. In this case, VIGRA stores the image uncompressed. Valid Compression for TIFF files: JPEG jpeg compression, call setQuality as well! RLE runlength compression LZW lzw compression DEFLATE deflate compression

VIGRA_EXPORT 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, VIFF, PNG, and PNM all file types store 1 byte (gray scale and mapped RGB) or 3 bytes (RGB) per pixel. PNG can store UInt8 and UInt16 values, and supports 1 and 3 channel images. One additional alpha channel is also supported. PNM can store 1 and 3 channel images with UInt8, UInt16 and UInt32 values in each channel. 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(). Support to reading and writing ICC color profiles is provided for TIFF, JPEG, and PNG images.

VIGRA_EXPORT ImageExportInfo& setICCProfile | ( | const ICCProfile & | profile | ) |

| Sets the ICC profile. ICC profiles are currently supported by TIFF, PNG and JPEG images. (Otherwise, the profile data is silently ignored.)

VIGRA_EXPORT 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) "UINT16" 16-bit unsigned integer (unsigned short) "INT32" 32-bit signed integer (long) "UINT32" 32-bit unsigned integer (unsigned 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"));

VIGRA_EXPORT ImageExportInfo& setPosition | ( | const Diff2D & | pos | ) |

  | Set the position of the upper Left corner on a global canvas. Currently only supported by TIFF and PNG files. The offset is encoded in the XPosition and YPosition TIFF tags. Parameters:
  position | of the upper left corner in pixels must be >= 0

VIGRA_EXPORT ImageExportInfo& setXResolution | ( | float |  | ) |

| Set the image resolution in horizontal direction

VIGRA_EXPORT ImageExportInfo& setYResolution | ( | float |  | ) |

| Set the image resolution in vertical direction

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

- vigra/imageinfo.hxx

© Ullrich Köthe (koethe@informatik.uni-hamburg.de) Cognitive Systems Group, University of Hamburg, Germany | html generated using doxygen and Python VIGRA 1.5.0 (7 Dec 2006)