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

details ImageImportInfo Class Reference VIGRA

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

#include <vigra/imageinfo.hxx>

Public Types

typedef ArrayVector< unsigned
char > 
ICCProfile
 

Public Member Functions

Size2D getCanvasSize () const
 
const char * getFileType () const
 
const ICCProfilegetICCProfile () const
 
int getImageIndex () const
 
const char * getPixelType () const
 
Diff2D getPosition () const
 
float getXResolution () const
 
float getYResolution () const
 
int height () const
 
 ImageImportInfo (const char *filename, unsigned int page=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, composite.cxx, convert.cxx, dissolve.cxx, edge.cxx, graph_agglomerative_clustering.cxx, imageImportInfo_tutorial.cxx, imageIO_tutorial.cxx, invert.cxx, invert_explicitly.cxx, invert_tutorial.cxx, mirror_tutorial.cxx, profile.cxx, pyramid.cxx, resize.cxx, smooth.cxx, smooth_convolve.cxx, smooth_explicitly.cxx, subimage.cxx, subimage_tutorial.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 *  filename,
unsigned int  page = 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.

The parameter page can be used in conjunction with multi-page TIFF files in order to specify the desired page (i.e. image) in the 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:
imageImportInfo_tutorial.cxx, and invert.cxx.
int width ( ) const
int height ( ) const
int numBands ( ) const

Get the total number of bands in the image.

Examples:
graph_agglomerative_clustering.cxx, and imageImportInfo_tutorial.cxx.
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
bool isGrayscale ( ) const
bool isColor ( ) const

Returns true if the image is colored (RGB).

Examples:
boundarytensor.cxx, and imageImportInfo_tutorial.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)
Examples:
imageImportInfo_tutorial.cxx.
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:

© 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.11.1 (Fri May 19 2017)