vigra - vigra/imageinfo.hxx Source File

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

vigra/imageinfo.hxx |

    00001 /************************************************************************/
    00002 /*                                                                      */
    00003 /*               Copyright 1998-2001 by Ullrich Koethe                  */
    00004 /*               Copyright 2001-2002 by Gunnar Kedenburg                */
    00005 /*                                                                      */
    00006 /*    This file is part of the VIGRA computer vision library.           */
    00007 /*    The VIGRA Website is                                              */
    00008 /*        http://hci.iwr.uni-heidelberg.de/vigra/                       */
    00009 /*    Please direct questions, bug reports, and contributions to        */
    00010 /*        ullrich.koethe@iwr.uni-heidelberg.de    or                    */
    00011 /*        vigra@informatik.uni-hamburg.de                               */
    00012 /*                                                                      */
    00013 /*    Permission is hereby granted, free of charge, to any person       */
    00014 /*    obtaining a copy of this software and associated documentation    */
    00015 /*    files (the "Software"), to deal in the Software without           */
    00016 /*    restriction, including without limitation the rights to use,      */
    00017 /*    copy, modify, merge, publish, distribute, sublicense, and/or      */
    00018 /*    sell copies of the Software, and to permit persons to whom the    */
    00019 /*    Software is furnished to do so, subject to the following          */
    00020 /*    conditions:                                                       */
    00021 /*                                                                      */
    00022 /*    The above copyright notice and this permission notice shall be    */
    00023 /*    included in all copies or substantial portions of the             */
    00024 /*    Software.                                                         */
    00025 /*                                                                      */
    00026 /*    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND    */
    00027 /*    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES   */
    00028 /*    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND          */
    00029 /*    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT       */
    00030 /*    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,      */
    00031 /*    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING      */
    00032 /*    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR     */
    00033 /*    OTHER DEALINGS IN THE SOFTWARE.                                   */
    00034 /*                                                                      */
    00035 /************************************************************************/
    00036
    00037 /* Modifications by Pablo d'Angelo
    00038  * updated to vigra 1.4 by Douglas Wilkins
    00039  * as of 18 February 2006:
    00040  *  - Added UINT16 and UINT32 pixel types.
    00041  *  - Added support for obtaining extra bands beyond RGB.
    00042  *  - Added support for a position field that indicates the start of this
    00043  *    image relative to some global origin.
    00044  *  - Added support for x and y resolution fields.
    00045  *  - Added support for ICC profiles
    00046  */
    00047
    00048 #ifndef VIGRA_IMAGEINFO_HXX
    00049 #define VIGRA_IMAGEINFO_HXX
    00050
    00051 #include <memory>
    00052 #include <string>
    00053 #include "config.hxx"
    00054 #include "error.hxx"
    00055 #include "diff2d.hxx"
    00056 #include "codec.hxx"
    00057 #include "array_vector.hxx"
    00058 #include "multi_iterator.hxx"
    00059
    00060 namespace vigra
    00061 {
    00062 /** \addtogroup VigraImpex Image Import/Export Facilities
    00063
    00064     supports GIF, TIFF, JPEG, BMP, EXR, HDR, PNM (PBM, PGM, PPM), PNG, SunRaster, KHOROS-VIFF formats
    00065 **/
    00066 //@{
    00067
    00068     /** \brief List the image formats VIGRA can read and write.
    00069
    00070         This is useful for creating error messages if VIGRA encounters an
    00071         image format it doesn't recognize.
    00072
    00073         <b> Usage:</b>
    00074
    00075         <b>\#include</b> <vigra/imageinfo.hxx><br>
    00076         Namespace: vigra
    00077
    00078         \code
    00079         std::cout << "supported formats: " << vigra::impexListFormats() << std::endl;
    00080         \endcode
    00081
    00082     **/
    00083 VIGRA_EXPORT std::string impexListFormats();
    00084
    00085     /** \brief List the file extension VIGRA understands.
    00086
    00087         This is useful for creating file dialogs that only list image files
    00088         VIGRA can actually import.
    00089
    00090         <b> Usage:</b>
    00091
    00092         <b>\#include</b> <vigra/imageinfo.hxx><br>
    00093         Namespace: vigra
    00094
    00095         \code
    00096         std::cout << "supported extensions: " << vigra::impexListExtensions() << std::endl;
    00097         \endcode
    00098
    00099     **/
    00100 VIGRA_EXPORT std::string impexListExtensions();
    00101
    00102 /** \brief Test whether a file is an image format known to VIGRA.
    00103
    00104     This checks the first few bytes of the file and compares them with the
    00105     "magic strings" of each recognized image format.
    00106
    00107     <b> Usage:</b>
    00108
    00109     <b>\#include</b> <vigra/imageinfo.hxx><br>
    00110     Namespace: vigra
    00111
    00112     \code
    00113     std::cout << "is image: " << vigra::isImage("foo.bmp") << std::endl;
    00114     \endcode
    00115
    00116 **/
    00117 VIGRA_EXPORT bool isImage(char const * filename);
    00118
    00119 /********************************************************/
    00120 /*                                                      */
    00121 /*                   ImageExportInfo                    */
    00122 /*                                                      */
    00123 /********************************************************/
    00124
    00125 /** \brief Argument object for the function exportImage().
    00126
    00127     See \ref exportImage() for usage example. This object must be used
    00128     to define the properties of an image to be written to disk.
    00129
    00130     <b>\#include</b> <vigra/imageinfo.hxx><br>
    00131     Namespace: vigra
    00132 **/
    00133 class ImageExportInfo
    00134 {
    00135   public:
    00136         /** Construct ImageExportInfo object.
    00137
    00138             The image will be stored under the given filename.
    00139             The file type will be guessed from the extension unless overridden
    00140             by \ref setFileType(). Recognized extensions: '.bmp', '.exr', '.gif',
    00141             '.jpeg', '.jpg', '.p7', '.png', '.pbm', '.pgm', '.pnm', '.ppm', '.ras',
    00142             '.tif', '.tiff', '.xv', '.hdr'.
    00143             EXR support requires libopenexr, JPEG support requires libjpeg,
    00144             PNG support requires libpng and TIFF support requires libtiff.
    00145          **/
    00146     VIGRA_EXPORT ImageExportInfo( const char *, const char * = "w" );
    00147     VIGRA_EXPORT ~ImageExportInfo();
    00148
    00149         /** Set image file name.
    00150
    00151             The file type will be guessed from the extension unless overridden
    00152             by \ref setFileType(). Recognized extensions: '.bmp', '.exr', '.gif',
    00153             '.jpeg', '.jpg', '.p7', '.png', '.pbm', '.pgm', '.pnm', '.ppm', '.ras',
    00154             '.tif', '.tiff', '.xv', '.hdr'.
    00155             EXR support requires libopenexr, JPEG support requires libjpeg,
    00156             PNG support requires libpng and TIFF support requires libtiff.
    00157          **/
    00158     VIGRA_EXPORT ImageExportInfo & setFileName(const char * filename);
    00159     VIGRA_EXPORT const char * getFileName() const;
    00160
    00161         /** Return the image file opening mode.
    00162          **/
    00163     VIGRA_EXPORT const char * getMode() const;
    00164
    00165         /** Store image as given file type.
    00166
    00167             This will override any type guessed
    00168             from the file name's extension. Recognized file types:
    00169
    00170             <DL>
    00171             <DT>"BMP"<DD> Microsoft Windows bitmap image file.
    00172             <DT>"EXR"<DD> OpenEXR high dynamic range image format.
    00173             (only available if libopenexr is installed)
    00174             <DT>"GIF"<DD> CompuServe graphics interchange format; 8-bit color.
    00175             <DT>"HDR"<DD> Radiance RGBE high dynamic range image format.
    00176             <DT>"JPEG"<DD> Joint Photographic Experts Group JFIF format;
    00177             compressed 24-bit color (only available if libjpeg is installed).
    00178             <DT>"PNG"<DD> Portable Network Graphic
    00179             (only available if libpng is installed).
    00180             <DT>"PBM"<DD> Portable bitmap format (black and white).
    00181             <DT>"PGM"<DD> Portable graymap format (gray scale).
    00182             <DT>"PNM"<DD> Portable anymap.
    00183             <DT>"PPM"<DD> Portable pixmap format (color).
    00184             <DT>"SUN"<DD> SUN Rasterfile.
    00185             <DT>"TIFF"<DD> Tagged Image File Format.
    00186             (only available if libtiff is installed.)
    00187             <DT>"VIFF"<DD> Khoros Visualization image file.
    00188             </DL>
    00189
    00190             With the exception of TIFF, VIFF, PNG, and PNM all file types store
    00191             1 byte (gray scale and mapped RGB) or 3 bytes (RGB) per
    00192             pixel.
    00193
    00194             PNG can store UInt8 and UInt16 values, and supports 1 and 3 channel
    00195             images. One additional alpha channel is also supported.
    00196
    00197             PNM can store 1 and 3 channel images with UInt8, UInt16 and UInt32
    00198             values in each channel.
    00199
    00200             TIFF and VIFF are additionally able to store short and long
    00201             integers (2 or 4 bytes) and real values (32 bit float and
    00202             64 bit double) without conversion. So you will need to use
    00203             TIFF or VIFF if you need to store images with high
    00204             accuracy (the appropriate type to write is automatically
    00205             derived from the image type to be exported). However, many
    00206             other programs using TIFF (e.g. ImageMagick) have not
    00207             implemented support for those pixel types.  So don't be
    00208             surprised if the generated TIFF is not readable in some
    00209             cases.  If this happens, export the image as 'unsigned
    00210             char' or 'RGBValue<unsigned char>' by calling
    00211             \ref ImageExportInfo::setPixelType().
    00212
    00213             Support to reading and writing ICC color profiles is
    00214             provided for TIFF, JPEG, and PNG images.
    00215          **/
    00216     VIGRA_EXPORT ImageExportInfo & setFileType( const char * );
    00217     VIGRA_EXPORT const char * getFileType() const;
    00218
    00219         /** Set compression type and quality.
    00220
    00221             This option is ignored when the target file format doesn't recognize
    00222             the compression type. Valid arguments:
    00223
    00224             <DL>
    00225             <DT>"NONE"<DD> (recognized by EXR and TIFF): do not compress (many other formats don't
    00226                            compress either, but it is not an option for them).
    00227             <DT>"JPEG"<DD> (recognized by JPEG and TIFF): use JPEG compression.
    00228                            You can also specify a compression quality parameter by
    00229                            passing "JPEG QUALITY=N", where "N" must be an integer between 1 and 100
    00230                            (e.g. "JPEG QUALITY=70").
    00231             <DT>"JPEG-ARITH"<DD> (recognized by new versions of JPEG): use arithmetic coding as a back-end
    00232                            after JPEG compression (by default, the back-end is Huffman coding).
    00233                            You can also specify a compression quality parameter by
    00234                            passing "JPEG-ARITH QUALITY=N", where "N" must be an integer between 1 and 100
    00235                            (e.g. "JPEG-ARITH QUALITY=70").
    00236             <DT>"RLE", "RunLength"<DD> (recognized by EXR and TIFF): use run-length encoding. (BMP also
    00237                           uses run-length encoding, but there it is not an option).
    00238             <DT>"PACKBITS"<DD> (recognized by TIFF): use packbits encoding (a variant of RLE).
    00239             <DT>"DEFLATE"<DD> (recognized by TIFF): use deflate encoding, as defined in zlib (PNG also
    00240                            uses deflate, but there it is not an option).
    00241             <DT>"LZW"<DD> (recognized by TIFF): use Lempel-Ziv-Welch encoding.
    00242             <DT>"ZIP"<DD> (recognized by EXR): use zip-style encoding.
    00243             <DT>"PIZ"<DD> (recognized by EXR): use wavelet encoding.
    00244             <DT>"PXR24"<DD> (recognized by EXR): reduce to 24-bit, then use zip-style encoding.
    00245             <DT>"B44", "B44A"<DD> (recognized by EXR): see OpenEXR documentation.
    00246             <DT>"ASCII"<DD> (recognized by PNM): store pixels as ASCII (human readable numbers).
    00247             <DT>"RAW"<DD> (recognized by PNM): store pixels as uncompressed binary data.
    00248             <DT>"BILEVEL"<DD> (recognized by PNM): store as one bit per pixel.
    00249             <DT>"1" ... "100"<DD> deprecated (equivalent to <tt>setCompression("JPEG QUALITY=number")</tt>
    00250                              where the number denotes the desired quality).
    00251             </DL>
    00252
    00253             Some of these options (e.g. "JPEG-ARITH", "LZW", "B44", "B44A") may only be available when
    00254             they have been enabled in the corresponding third-party library.
    00255          **/
    00256     VIGRA_EXPORT ImageExportInfo & setCompression( const char * type);
    00257
    00258     VIGRA_EXPORT const char * getCompression() const;
    00259
    00260         /** Set the pixel type of the image file. Possible values are:
    00261             <DL>
    00262             <DT>"UINT8"<DD> 8-bit unsigned integer (unsigned char)
    00263             <DT>"INT16"<DD> 16-bit signed integer (short)
    00264             <DT>"UINT16"<DD> 16-bit unsigned integer (unsigned short)
    00265             <DT>"INT32"<DD> 32-bit signed integer (long)
    00266             <DT>"UINT32"<DD> 32-bit unsigned integer (unsigned long)
    00267             <DT>"FLOAT"<DD> 32-bit floating point (float)
    00268             <DT>"DOUBLE"<DD> 64-bit floating point (double)
    00269             </DL>
    00270
    00271             <b>Usage:</b>
    00272
    00273             \code
    00274             FImage img(w,h);
    00275
    00276             // by default, float images are exported with pixeltype float
    00277             // when the target format support this type, i.e. is TIFF or VIFF.
    00278             exportImage(srcImageRange(img), ImageExportInfo("asFloat.tif"));
    00279
    00280             // if this is not desired, force a different pixeltype
    00281             exportImage(srcImageRange(img), ImageExportInfo("asByte.tif").setPixelType("UINT8"));
    00282             \endcode
    00283          **/
    00284     VIGRA_EXPORT ImageExportInfo & setPixelType( const char * );
    00285
    00286         /** Get the pixel type of the image. Possible values are:
    00287             <DL>
    00288             <DT>"UINT8"<DD> 8-bit unsigned integer (unsigned char)
    00289             <DT>"INT16"<DD> 16-bit signed integer (short)
    00290             <DT>"INT32"<DD> 32-bit signed integer (long)
    00291             <DT>"FLOAT"<DD> 32-bit floating point (float)
    00292             <DT>"DOUBLE"<DD> 64-bit floating point (double)
    00293             </DL>
    00294          **/
    00295     VIGRA_EXPORT const char * getPixelType() const;
    00296
    00297     VIGRA_EXPORT ImageExportInfo & setForcedRangeMapping(double fromMin, double fromMax,
    00298                                                      double toMin, double toMax);
    00299     VIGRA_EXPORT bool hasForcedRangeMapping() const;
    00300     VIGRA_EXPORT double getFromMin() const;
    00301     VIGRA_EXPORT double getFromMax() const;
    00302     VIGRA_EXPORT double getToMin() const;
    00303     VIGRA_EXPORT double getToMax() const;
    00304
    00305         /** Set the image resolution in horizontal direction
    00306          **/
    00307     VIGRA_EXPORT ImageExportInfo & setXResolution( float );
    00308     VIGRA_EXPORT float getXResolution() const;
    00309
    00310         /** Set the image resolution in vertical direction
    00311          **/
    00312     VIGRA_EXPORT ImageExportInfo & setYResolution( float );
    00313     VIGRA_EXPORT float getYResolution() const;
    00314
    00315         /** Set the position of the upper Left corner on a global
    00316             canvas.
    00317
    00318             Currently only supported by TIFF, PNG and OpenEXR files.
    00319
    00320             The offset is encoded in the XPosition and YPosition TIFF tags.
    00321
    00322             @param pos     position of the upper left corner in pixels
    00323                            (must be >= 0)
    00324          **/
    00325     VIGRA_EXPORT ImageExportInfo & setPosition(const Diff2D & pos);
    00326
    00327         /** Get the position of the upper left corner on
    00328             a global canvas.
    00329          **/
    00330     VIGRA_EXPORT Diff2D getPosition() const;
    00331
    00332         /** Get the size of the canvas, on which the image is positioned at
    00333             getPosition()
    00334          **/
    00335     VIGRA_EXPORT Size2D getCanvasSize() const;
    00336
    00337         /** Get the size of the canvas, on which the image is positioned at
    00338             getPosition()
    00339          **/
    00340     VIGRA_EXPORT ImageExportInfo & setCanvasSize(const Size2D & size);
    00341
    00342         /**
    00343           ICC profiles (handled as raw data so far).
    00344           see getICCProfile()/setICCProfile()
    00345          **/
    00346     typedef ArrayVector<unsigned char> ICCProfile;
    00347
    00348         /** Returns a reference to the ICC profile.
    00349          */
    00350     VIGRA_EXPORT const ICCProfile & getICCProfile() const;
    00351
    00352         /** Sets the ICC profile.
    00353             ICC profiles are currently supported by TIFF, PNG and JPEG images.
    00354             (Otherwise, the profile data is silently ignored.)
    00355          **/
    00356     VIGRA_EXPORT ImageExportInfo & setICCProfile(const ICCProfile & profile);
    00357
    00358   private:
    00359     std::string m_filename, m_filetype, m_pixeltype, m_comp, m_mode;
    00360     float m_x_res, m_y_res;
    00361     Diff2D m_pos;
    00362     ICCProfile m_icc_profile;
    00363     Size2D m_canvas_size;
    00364     double fromMin_, fromMax_, toMin_, toMax_;
    00365 };
    00366
    00367 // return an encoder for a given ImageExportInfo object
    00368 VIGRA_EXPORT VIGRA_UNIQUE_PTR<Encoder> encoder( const ImageExportInfo & info );
    00369
    00370 /********************************************************/
    00371 /*                                                      */
    00372 /*                   ImageImportInfo                    */
    00373 /*                                                      */
    00374 /********************************************************/
    00375
    00376 /** \brief Argument object for the function importImage().
    00377
    00378 See \ref importImage() for a usage example. This object must be
    00379 used to read an image from disk and enquire about its properties.
    00380
    00381 <b>\#include</b> <vigra/imageinfo.hxx><br>
    00382 Namespace: vigra
    00383 **/
    00384 class ImageImportInfo
    00385 {
    00386   public:
    00387     enum PixelType { UINT8, INT16, UINT16, INT32, UINT32, FLOAT, DOUBLE };
    00388
    00389         /** Construct ImageImportInfo object.
    00390
    00391             The image with the given filename is read into memory.
    00392             The file type will be determined by the first few bytes of the
    00393             file (magic number). Recognized file types:
    00394
    00395             <DL>
    00396             <DT>"BMP"<DD> Microsoft Windows bitmap image file.
    00397             <DT>"EXR"<DD> OpenEXR high dynamic range image format.
    00398             (only available if libopenexr is installed)
    00399             <DT>"GIF"<DD> CompuServe graphics interchange format; 8-bit color.
    00400             <DT>"HDR"<DD> Radiance RGBE high dynamic range image format.
    00401             <DT>"JPEG"<DD> Joint Photographic Experts Group JFIF format;
    00402             compressed 24-bit color (only available if libjpeg is installed).
    00403             <DT>"PNG"<DD> Portable Network Graphic
    00404             (only available if libpng is installed).
    00405             <DT>"PBM"<DD> Portable bitmap format (black and white).
    00406             <DT>"PGM"<DD> Portable graymap format (gray scale).
    00407             <DT>"PNM"<DD> Portable anymap.
    00408             <DT>"PPM"<DD> Portable pixmap format (color).
    00409             <DT>"SUN"<DD> SUN Rasterfile.
    00410             <DT>"TIFF"<DD> Tagged Image File Format.
    00411             (only available if libtiff is installed.)
    00412             <DT>"VIFF"<DD> Khoros Visualization image file.
    00413             </DL>
    00414          **/
    00415     VIGRA_EXPORT ImageImportInfo( const char *, unsigned int = 0 );
    00416     VIGRA_EXPORT ~ImageImportInfo();
    00417
    00418     VIGRA_EXPORT const char * getFileName() const;
    00419
    00420         /** Get the file type of the image associated with this
    00421             info object.
    00422
    00423             See ImageImportInfo::ImageImportInfo for a list of the
    00424             available file types.
    00425          **/
    00426     VIGRA_EXPORT const char * getFileType() const;
    00427
    00428         /** Get width of the image.
    00429          **/
    00430     VIGRA_EXPORT int width() const;
    00431
    00432         /** Get height of the image.
    00433          **/
    00434     VIGRA_EXPORT int height() const;
    00435
    00436         /** Get the total number of bands in the image.
    00437          **/
    00438     VIGRA_EXPORT int numBands() const;
    00439
    00440         /** Get the number of extra (non color) bands in the image.
    00441          ** Usually these are the alpha channels.
    00442          **/
    00443     VIGRA_EXPORT int numExtraBands() const;
    00444
    00445         /** Get the number of images contained in the image file.
    00446          **/
    00447     VIGRA_EXPORT int numImages() const;
    00448
    00449         /** Sets the index of the image to import from the image file.
    00450          **/
    00451     VIGRA_EXPORT void setImageIndex(const int);
    00452
    00453         /** Gets the index of the image to import from the image file.
    00454          **/
    00455     VIGRA_EXPORT int getImageIndex() const;
    00456
    00457         /** Get size of the image.
    00458          **/
    00459     VIGRA_EXPORT Size2D size() const;
    00460
    00461         /** Get size of the image in a form compatible to MultiArray.
    00462          **/
    00463     VIGRA_EXPORT MultiArrayShape<2>::type shape() const;
    00464
    00465         /** Returns true if the image is gray scale.
    00466          **/
    00467     VIGRA_EXPORT bool isGrayscale() const;
    00468
    00469         /** Returns true if the image is colored (RGB).
    00470          **/
    00471     VIGRA_EXPORT bool isColor() const;
    00472
    00473         /** Query the pixel type of the image.
    00474
    00475             Possible values are:
    00476             <DL>
    00477             <DT>"UINT8"<DD> 8-bit unsigned integer (unsigned char)
    00478             <DT>"INT16"<DD> 16-bit signed integer (short)
    00479             <DT>"UINT16"<DD> 16-bit unsigned integer (unsigned short)
    00480             <DT>"INT32"<DD> 32-bit signed integer (long)
    00481             <DT>"UINT32"<DD> 32-bit unsigned integer (unsigned long)
    00482             <DT>"FLOAT"<DD> 32-bit floating point (float)
    00483             <DT>"DOUBLE"<DD> 64-bit floating point (double)
    00484             </DL>
    00485          **/
    00486     VIGRA_EXPORT const char * getPixelType() const;
    00487
    00488         /** Query the pixel type of the image.
    00489
    00490             Same as getPixelType(), but the result is returned as a
    00491             ImageImportInfo::PixelType enum. This is useful to implement
    00492             a switch() on the pixel type.
    00493
    00494             Possible values are:
    00495             <DL>
    00496             <DT>UINT8<DD> 8-bit unsigned integer (unsigned char)
    00497             <DT>INT16<DD> 16-bit signed integer (short)
    00498             <DT>UINT16<DD> 16-bit unsigned integer (unsigned short)
    00499             <DT>INT32<DD> 32-bit signed integer (long)
    00500             <DT>UINT32<DD> 32-bit unsigned integer (unsigned long)
    00501             <DT>FLOAT<DD> 32-bit floating point (float)
    00502             <DT>DOUBLE<DD> 64-bit floating point (double)
    00503             </DL>
    00504          **/
    00505     VIGRA_EXPORT PixelType pixelType() const;
    00506
    00507         /** Returns true if the image has 1 byte per pixel (gray) or
    00508             3 bytes per pixel (RGB).
    00509          **/
    00510     VIGRA_EXPORT bool isByte() const;
    00511
    00512         /** Returns the layer offset of the current image, if there is one
    00513          **/
    00514     VIGRA_EXPORT Diff2D getPosition() const;
    00515
    00516         /** Get the size of the canvas, on which the image is positioned at
    00517             getPosition()
    00518          **/
    00519     VIGRA_EXPORT Size2D getCanvasSize() const;
    00520
    00521         /** Returns the image resolution in horizontal direction
    00522          **/
    00523     VIGRA_EXPORT float getXResolution() const;
    00524
    00525         /** Returns the image resolution in vertical direction
    00526          **/
    00527     VIGRA_EXPORT float getYResolution() const;
    00528
    00529         /**
    00530           ICC profiles (handled as raw data so far).
    00531           see getICCProfile()/setICCProfile()
    00532          **/
    00533     typedef ArrayVector<unsigned char> ICCProfile;
    00534
    00535         /** Returns a reference to the ICC profile.
    00536
    00537            Note: The reference will become invalid when the
    00538            ImageImportInfo object has been destroyed.
    00539          **/
    00540     VIGRA_EXPORT const ICCProfile & getICCProfile() const;
    00541
    00542   private:
    00543     std::string m_filename, m_filetype, m_pixeltype;
    00544     int m_width, m_height, m_num_bands, m_num_extra_bands, m_num_images, m_image_index;
    00545     float m_x_res, m_y_res;
    00546     Diff2D m_pos;
    00547     Size2D m_canvas_size;
    00548     ICCProfile m_icc_profile;
    00549
    00550     void readHeader_();
    00551 };
    00552
    00553 // return a decoder for a given ImageImportInfo object
    00554 VIGRA_EXPORT VIGRA_UNIQUE_PTR<Decoder> decoder( const ImageImportInfo & info );
    00555
    00556 //@}
    00557
    00558 } // namespace vigra
    00559
    00560 #endif // 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)