[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
ImageImportInfo Class Reference |
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 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 *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 |
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
typedef ArrayVector<unsigned char> ICCProfile |
ICC profiles (handled as raw data so far). see getICCProfile()/setICCProfile()
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:
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.
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.
int width | ( | ) | const |
Get width of the image.
int height | ( | ) | const |
Get height of the image.
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.
bool isColor | ( | ) | const |
Returns true if the image is colored (RGB).
const char* getPixelType | ( | ) | const |
Query the pixel type of the image.
Possible values are:
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:
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.
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|