Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QWbmpHandler Class Reference

The QWbmpHandler class provides support for the WBMP image format. More...

#include <qwbmphandler_p.h>

+ Inheritance diagram for QWbmpHandler:
+ Collaboration diagram for QWbmpHandler:

Public Member Functions

 QWbmpHandler (QIODevice *device)
 Constructs an instance of QWbmpHandler initialized to use device.
 
 ~QWbmpHandler ()
 Destructor for QWbmpHandler.
 
bool canRead () const override
 Verifies if some values (magic bytes) are set as expected in the header of the file.
 
bool read (QImage *image) override
 \reimp
 
bool write (const QImage &image) override
 \reimp
 
QVariant option (ImageOption option) const override
 Only Size option is supported.
 
bool supportsOption (ImageOption option) const override
 Returns true if the QImageIOHandler supports the option option; otherwise returns false.
 
- Public Member Functions inherited from QImageIOHandler
 QImageIOHandler ()
 Constructs a QImageIOHandler object.
 
virtual ~QImageIOHandler ()
 Destructs the QImageIOHandler object.
 
void setDevice (QIODevice *device)
 Sets the device of the QImageIOHandler to device.
 
QIODevicedevice () 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 Public Member Functions inherited from QImageIOHandler
static bool allocateImage (QSize size, QImage::Format format, QImage *image)
 

Additional Inherited Members

- Public Types inherited from QImageIOHandler
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
}
 
- Protected Member Functions inherited from QImageIOHandler
 QImageIOHandler (QImageIOHandlerPrivate &dd)
 
- Protected Attributes inherited from QImageIOHandler
QScopedPointer< QImageIOHandlerPrivated_ptr
 

Detailed Description

The QWbmpHandler class provides support for the WBMP image format.

Since
5.0

Definition at line 24 of file qwbmphandler_p.h.

Constructor & Destructor Documentation

◆ QWbmpHandler()

QWbmpHandler::QWbmpHandler ( QIODevice device)

Constructs an instance of QWbmpHandler initialized to use device.

Definition at line 227 of file qwbmphandler.cpp.

◆ ~QWbmpHandler()

QWbmpHandler::~QWbmpHandler ( )

Destructor for QWbmpHandler.

Definition at line 235 of file qwbmphandler.cpp.

Member Function Documentation

◆ canRead() [1/2]

bool QWbmpHandler::canRead ( ) const
overridevirtual

Verifies if some values (magic bytes) are set as expected in the header of the file.

If the magic bytes were found, it is assumed that the QWbmpHandler can read the file.

Implements QImageIOHandler.

Definition at line 244 of file qwbmphandler.cpp.

References canRead(), QImageIOHandler::device(), qWarning, and QImageIOHandler::setFormat().

Referenced by canRead(), and QWbmpPlugin::capabilities().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ canRead() [2/2]

bool QWbmpHandler::canRead ( QIODevice device)
static

Definition at line 320 of file qwbmphandler.cpp.

References WBMPReader::canRead(), and QImageIOHandler::device().

+ Here is the call graph for this function:

◆ option()

QVariant QWbmpHandler::option ( ImageOption  option) const
overridevirtual

Only Size option is supported.

Reimplemented from QImageIOHandler.

Definition at line 289 of file qwbmphandler.cpp.

References QImageIOHandler::device(), QImage::Format_Mono, WBMPHeader::height, QImageIOHandler::ImageFormat, QIODevice::isSequential(), QIODevice::pos(), readWBMPHeader(), QIODevice::seek(), QImageIOHandler::Size, and WBMPHeader::width.

+ Here is the call graph for this function:

◆ read()

bool QWbmpHandler::read ( QImage image)
overridevirtual

\reimp

Implements QImageIOHandler.

Definition at line 263 of file qwbmphandler.cpp.

References WBMPReader::readImage().

+ Here is the call graph for this function:

◆ supportsOption()

bool QWbmpHandler::supportsOption ( ImageOption  option) const
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.

See also
setOption(), option()

Reimplemented from QImageIOHandler.

Definition at line 314 of file qwbmphandler.cpp.

References QImageIOHandler::ImageFormat, and QImageIOHandler::Size.

◆ write()

bool QWbmpHandler::write ( const QImage image)
overridevirtual

\reimp

Reimplemented from QImageIOHandler.

Definition at line 278 of file qwbmphandler.cpp.

References WBMPReader::writeImage().

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: