scantools
1.0.4
Graphics manipulation with a view towards scanned documents
|
Reads TIFF files and converts them to QImages. More...
#include <TIFFReader.h>
Public Member Functions | |
TIFFReader (const QString &fileName) | |
Constructs a TIFF document from a file. More... | |
~TIFFReader () | |
Standard destructor. | |
bool | hasError () |
Error status. More... | |
QString | error () |
Error message. More... | |
quint32 | size () |
Number of images in the TIFF document. More... | |
QImage | operator[] (quint16 pageNumber) |
Read image. More... | |
Reads TIFF files and converts them to QImages.
This class reads TIFF files into QImages. The class exist because the QImageReader that is shipped with Qt does not handle multi-page TIFF files.
The methods of this class are reentrant and thread safe. The implementation ensures that only one thread can access the document at any given time. This class does not use libtiff directly, which is extremely hard to use in a thread-safe manner. It does use, however, Qt's TIFF reader.
Definition at line 48 of file TIFFReader.h.
|
explicit |
Constructs a TIFF document from a file.
Once the TIFFReader is constructed, the error status should be checked using the method hasError().
fileName | Name of the TIFF file |
QString TIFFReader::error | ( | ) |
Error message.
In case that hasError() returns 'true', this method returns a human-readable description of the error.
bool TIFFReader::hasError | ( | ) |
Error status.
QImage TIFFReader::operator[] | ( | quint16 | pageNumber | ) |
Read image.
This method reads the n.th image of the TIFF file and returns it as a QImage. In case of error, an empty image is returned and an error condition is set.
pageNumber | Page number |
quint32 TIFFReader::size | ( | ) |
Number of images in the TIFF document.