![]() |
Qt 6.x
The Qt SDK
|
#include <qtiffhandler_p.h>
Public Types | |
enum | Compression { NoCompression = 0 , LzwCompression = 1 } |
![]() | |
enum | ImageOption { Size , ClipRect , Description , ScaledClipRect , ScaledSize , CompressionRatio , Gamma , Quality , Name , SubType , IncrementalReading , Endianness , Animation , BackgroundColor , ImageFormat , SupportedSubTypes , OptimizedWrite , ProgressiveScanWrite , ImageTransformation } |
This enum describes the different options supported by QImageIOHandler. More... | |
enum | Transformation { TransformationNone = 0 , TransformationMirror = 1 , TransformationFlip = 2 , TransformationRotate180 = TransformationMirror | TransformationFlip , TransformationRotate90 = 4 , TransformationMirrorAndRotate90 = TransformationMirror | TransformationRotate90 , TransformationFlipAndRotate90 = TransformationFlip | TransformationRotate90 , TransformationRotate270 = TransformationRotate180 | TransformationRotate90 } |
Public Member Functions | |
QTiffHandler () | |
bool | canRead () const override |
Returns true if an image can be read from the device (i.e., the image format is supported, the device can be read from and the initial header information suggests that the image can be read); otherwise returns false . | |
bool | read (QImage *image) override |
Read an image from the device, and stores it in image. | |
bool | write (const QImage &image) override |
Writes the image image to the assigned device. | |
QVariant | option (ImageOption option) const override |
Returns the value assigned to option as a QVariant. | |
void | setOption (ImageOption option, const QVariant &value) override |
Sets the option option with the value value. | |
bool | supportsOption (ImageOption option) const override |
Returns true if the QImageIOHandler supports the option option; otherwise returns false . | |
bool | jumpToNextImage () override |
For image formats that support animation, this function jumps to the next image. | |
bool | jumpToImage (int imageNumber) override |
For image formats that support animation, this function jumps to the image whose sequence number is imageNumber. | |
int | imageCount () const override |
For image formats that support animation, this function returns the number of images in the animation. | |
int | currentImageNumber () const override |
For image formats that support animation, this function returns the sequence number of the current image in the animation. | |
![]() | |
QImageIOHandler () | |
Constructs a QImageIOHandler object. | |
virtual | ~QImageIOHandler () |
Destructs the QImageIOHandler object. | |
void | setDevice (QIODevice *device) |
Sets the device of the QImageIOHandler to device. | |
QIODevice * | device () const |
Returns the device currently assigned to the QImageIOHandler. | |
void | setFormat (const QByteArray &format) |
Sets the format of the QImageIOHandler to format. | |
void | setFormat (const QByteArray &format) const |
Sets the format of the QImageIOHandler to format. | |
QByteArray | format () const |
Returns the format that is currently assigned to QImageIOHandler. | |
virtual bool | canRead () const =0 |
Returns true if an image can be read from the device (i.e., the image format is supported, the device can be read from and the initial header information suggests that the image can be read); otherwise returns false . | |
virtual bool | read (QImage *image)=0 |
Read an image from the device, and stores it in image. | |
virtual bool | write (const QImage &image) |
Writes the image image to the assigned device. | |
virtual QVariant | option (ImageOption option) const |
Returns the value assigned to option as a QVariant. | |
virtual void | setOption (ImageOption option, const QVariant &value) |
Sets the option option with the value value. | |
virtual bool | supportsOption (ImageOption option) const |
Returns true if the QImageIOHandler supports the option option; otherwise returns false . | |
virtual bool | jumpToNextImage () |
For image formats that support animation, this function jumps to the next image. | |
virtual bool | jumpToImage (int imageNumber) |
For image formats that support animation, this function jumps to the image whose sequence number is imageNumber. | |
virtual int | loopCount () const |
For image formats that support animation, this function returns the number of times the animation should loop. | |
virtual int | imageCount () const |
For image formats that support animation, this function returns the number of images in the animation. | |
virtual int | nextImageDelay () const |
For image formats that support animation, this function returns the number of milliseconds to wait until reading the next image. | |
virtual int | currentImageNumber () const |
For image formats that support animation, this function returns the sequence number of the current image in the animation. | |
virtual QRect | currentImageRect () const |
Returns the rect of the current image. | |
Static Public Member Functions | |
static bool | canRead (QIODevice *device) |
![]() | |
static bool | allocateImage (QSize size, QImage::Format format, QImage *image) |
Additional Inherited Members | |
![]() | |
QImageIOHandler (QImageIOHandlerPrivate &dd) | |
![]() | |
QScopedPointer< QImageIOHandlerPrivate > | d_ptr |
Definition at line 13 of file qtiffhandler_p.h.
Enumerator | |
---|---|
NoCompression | |
LzwCompression |
Definition at line 33 of file qtiffhandler_p.h.
QTiffHandler::QTiffHandler | ( | ) |
Definition at line 325 of file qtiffhandler.cpp.
|
overridevirtual |
Returns true
if an image can be read from the device (i.e., the image format is supported, the device can be read from and the initial header information suggests that the image can be read); otherwise returns false
.
When reimplementing canRead(), make sure that the I/O device (device()) is left in its original state (e.g., by using peek() rather than read()).
Implements QImageIOHandler.
Definition at line 331 of file qtiffhandler.cpp.
References QTiffHandlerPrivate::canRead(), QImageIOHandler::device(), QImageIOHandler::setFormat(), and QTiffHandlerPrivate::tiff.
Referenced by QTiffPlugin::capabilities(), and option().
|
static |
Definition at line 342 of file qtiffhandler.cpp.
References QTiffHandlerPrivate::canRead(), and QImageIOHandler::device().
|
overridevirtual |
For image formats that support animation, this function returns the sequence number of the current image in the animation.
If this function is called before any image is read(), -1 is returned. The number of the first image in the sequence is 0.
If the image format does not support animation, 0 is returned.
Reimplemented from QImageIOHandler.
Definition at line 966 of file qtiffhandler.cpp.
References QTiffHandlerPrivate::currentDirectory.
|
overridevirtual |
For image formats that support animation, this function returns the number of images in the animation.
If the image format does not support animation, or if it is unable to determine the number of images, 0 is returned.
The default implementation returns 1 if canRead() returns true
; otherwise 0 is returned.
Reimplemented from QImageIOHandler.
Definition at line 958 of file qtiffhandler.cpp.
References QTiffHandlerPrivate::directoryCount.
|
overridevirtual |
For image formats that support animation, this function jumps to the image whose sequence number is imageNumber.
The next call to read() will attempt to read this image.
The default implementation does nothing, and returns false
.
Reimplemented from QImageIOHandler.
Definition at line 944 of file qtiffhandler.cpp.
References QTiffHandlerPrivate::currentDirectory, QTiffHandlerPrivate::directoryCount, and QTiffHandlerPrivate::headersRead.
|
overridevirtual |
For image formats that support animation, this function jumps to the next image.
The default implementation does nothing, and returns false
.
Reimplemented from QImageIOHandler.
Definition at line 932 of file qtiffhandler.cpp.
References QTiffHandlerPrivate::currentDirectory, QTiffHandlerPrivate::directoryCount, and QTiffHandlerPrivate::headersRead.
|
overridevirtual |
Returns the value assigned to option as a QVariant.
The type of the value depends on the option. For example, option(Size) returns a QSize variant.
Reimplemented from QImageIOHandler.
Definition at line 896 of file qtiffhandler.cpp.
References canRead(), QTiffHandlerPrivate::compression, QImageIOHandler::CompressionRatio, QImageIOHandler::device(), QTiffHandlerPrivate::format, QImageIOHandler::ImageFormat, QImageIOHandler::ImageTransformation, QTiffHandlerPrivate::readHeaders(), QImageIOHandler::Size, QTiffHandlerPrivate::size, and QTiffHandlerPrivate::transformation.
|
overridevirtual |
Read an image from the device, and stores it in image.
Returns true
if the image is successfully read; otherwise returns false.
For image formats that support incremental loading, and for animation formats, the image handler can assume that image points to the previous frame.
Implements QImageIOHandler.
Definition at line 347 of file qtiffhandler.cpp.
References QImageIOHandler::allocateImage(), QTiffHandlerPrivate::close(), QImageIOHandler::device(), QTiffHandlerPrivate::floatingPoint, QTiffHandlerPrivate::format, QImage::Format_Grayscale16, QImage::Format_Grayscale8, QImage::Format_Indexed8, QImage::Format_Mono, QImage::Format_RGBA16FPx4, QImage::Format_RGBA16FPx4_Premultiplied, QImage::Format_RGBA32FPx4, QImage::Format_RGBA32FPx4_Premultiplied, QImage::Format_RGBA64, QImage::Format_RGBA64_Premultiplied, QImage::Format_RGBX16FPx4, QImage::Format_RGBX32FPx4, QImage::Format_RGBX64, QColorSpace::fromIccProfile(), QTiffHandlerPrivate::grayscale, QSize::height(), i, QTiffHandlerPrivate::photometric, qMin(), qRgb(), qRound(), qt2Exif(), QTiffHandlerPrivate::readHeaders(), red, QTiffHandlerPrivate::size, QTiffHandlerPrivate::tiff, QTiffHandlerPrivate::transformation, and QSize::width().
|
overridevirtual |
Sets the option option with the value value.
Reimplemented from QImageIOHandler.
Definition at line 913 of file qtiffhandler.cpp.
References QTiffHandlerPrivate::compression, QImageIOHandler::CompressionRatio, QImageIOHandler::ImageTransformation, qBound(), and QTiffHandlerPrivate::transformation.
|
overridevirtual |
Returns true
if the QImageIOHandler supports the option option; otherwise returns false
.
For example, if the QImageIOHandler supports the \l Size option, supportsOption(Size) must return true.
Reimplemented from QImageIOHandler.
Definition at line 924 of file qtiffhandler.cpp.
References QImageIOHandler::CompressionRatio, QImageIOHandler::ImageFormat, QImageIOHandler::ImageTransformation, and QImageIOHandler::Size.
|
overridevirtual |
Writes the image image to the assigned device.
Returns true
on success; otherwise returns false
.
The default implementation does nothing, and simply returns false
.
Reimplemented from QImageIOHandler.
Definition at line 580 of file qtiffhandler.cpp.
References QList< T >::at(), checkGrayscale(), QTiffHandlerPrivate::compression, QByteArray::constData(), QVarLengthArray< T, Prealloc >::data(), defaultStripSize(), QImageIOHandler::device(), effectiveColorTable(), QImage::Format_Alpha8, QImage::Format_ARGB32, QImage::Format_Grayscale16, QImage::Format_Grayscale8, QImage::Format_Indexed8, QImage::Format_Mono, QImage::Format_MonoLSB, QImage::Format_RGB888, QImage::Format_RGBA16FPx4, QImage::Format_RGBA16FPx4_Premultiplied, QImage::Format_RGBA32FPx4, QImage::Format_RGBA32FPx4_Premultiplied, QImage::Format_RGBA64, QImage::Format_RGBA64_Premultiplied, QImage::Format_RGBA8888, QImage::Format_RGBA8888_Premultiplied, QImage::Format_RGBX16FPx4, QImage::Format_RGBX32FPx4, QImage::Format_RGBX64, QImage::height(), i, line, NoCompression, Q_ASSERT, qBlue(), qGreen(), qMax(), qMin(), qRed(), QRgb, qt2Exif(), qtiffCloseProc(), qtiffMapProc(), qtiffReadProc(), qtiffSeekProc(), qtiffSizeProc(), qtiffUnmapProc(), qtiffWriteProc(), QImage::scanLine(), QByteArray::size(), QList< T >::size(), and QTiffHandlerPrivate::transformation.