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

| ImageImportInfo Class Reference Image Import/Export Facilities |

Argument object for the function importImage(). More...

`#include <vigra/imageinfo.hxx>`

List of all members.

## Public Types
typedef ArrayVector< unsigned char > | ICCProfile
## Public Member Functions
Size2D | getCanvasSize () const
const char * | getFileType () const
const ICCProfile & | getICCProfile () const
int | getImageIndex () const
const char * | getPixelType () const
Diff2D | getPosition () const
float | getXResolution () const
float | getYResolution () const
int | height () const
| ImageImportInfo (const char *, unsigned int=0)
bool | isByte () const
bool | isColor () const
bool | isGrayscale () const
int | numBands () const
int | numExtraBands () const
int | numImages () const
PixelType | pixelType () const
void | setImageIndex (const int)
MultiArrayShape< 2 >::type | shape () const
Size2D | size () const
int | width () const

## Detailed Description

Argument object for the function importImage().

See importImage() for a usage example. This object must be used to read an image from disk and enquire about its properties.

#include <vigra/imageinfo.hxx>
Namespace: vigra

Examples:
  boundarytensor.cxx, convert.cxx, edge.cxx, invert.cxx, invert_explicitly.cxx, profile.cxx, pyramid.cxx, resize.cxx, smooth.cxx, subimage.cxx, total_variation.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

ImageImportInfo | ( | const char * | ,
|  | unsigned | int = `0`
| ) |  |

Construct ImageImportInfo object.

The image with the given filename is read into memory. The file type will be determined by the first few bytes of the file (magic number). Recognized file types:

"BMP"
  Microsoft Windows bitmap image file.
"EXR"
  OpenEXR high dynamic range image format. (only available if libopenexr is installed)
"GIF"
  CompuServe graphics interchange format; 8-bit color.
"HDR"
  Radiance RGBE high dynamic range image format.
"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.

## Member Function Documentation

const char* getFileType | ( |  | ) | const

Get the file type of the image associated with this info object.

See ImageImportInfo::ImageImportInfo for a list of the available file types.

Examples:
  invert.cxx.

int width | ( |  | ) | const

Get width of the image.

Examples:
  boundarytensor.cxx, convert.cxx, edge.cxx, invert.cxx, invert_explicitly.cxx, profile.cxx, resize.cxx, smooth.cxx, and subimage.cxx.

int height | ( |  | ) | const

Get height of the image.

Examples:
  boundarytensor.cxx, convert.cxx, edge.cxx, invert.cxx, invert_explicitly.cxx, profile.cxx, resize.cxx, smooth.cxx, and subimage.cxx.

int numBands | ( |  | ) | const

Get the total number of bands in the image.

int numExtraBands | ( |  | ) | const

Get the number of extra (non color) bands in the image. Usually these are the alpha channels.

int numImages | ( |  | ) | const

Get the number of images contained in the image file.

void setImageIndex | ( | const int |  | ) |

Sets the index of the image to import from the image file.

int getImageIndex | ( |  | ) | const

Gets the index of the image to import from the image file.

Size2D size | ( |  | ) | const

Get size of the image.

MultiArrayShape<2>::type shape | ( |  | ) | const

Get size of the image in a form compatible to MultiArray.

bool isGrayscale | ( |  | ) | const

Returns true if the image is gray scale.

Examples:
  boundarytensor.cxx, convert.cxx, edge.cxx, invert.cxx, invert_explicitly.cxx, profile.cxx, resize.cxx, smooth.cxx, and subimage.cxx.

bool isColor | ( |  | ) | const

Returns true if the image is colored (RGB).

Examples:
  boundarytensor.cxx.

const char* getPixelType | ( |  | ) | const

Query the pixel type of the image.

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)

PixelType pixelType | ( |  | ) | const

Query the pixel type of the image.

Same as getPixelType(), but the result is returned as a ImageImportInfo::PixelType enum. This is useful to implement a switch() on the pixel type.

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)

bool isByte | ( |  | ) | const

Returns true if the image has 1 byte per pixel (gray) or 3 bytes per pixel (RGB).

Diff2D getPosition | ( |  | ) | const

Returns the layer offset of the current image, if there is one

Size2D getCanvasSize | ( |  | ) | const

Get the size of the canvas, on which the image is positioned at getPosition()

float getXResolution | ( |  | ) | const

Returns the image resolution in horizontal direction

float getYResolution | ( |  | ) | const

Returns the image resolution in vertical direction

const ICCProfile& getICCProfile | ( |  | ) | const

Returns a reference to the ICC profile.

Note: The reference will become invalid when the ImageImportInfo object has been destroyed.

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

- vigra/imageinfo.hxx

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany | html generated using doxygen and Python vigra 1.9.0 (Tue Nov 6 2012)