Qt 4.8
qimageiohandler.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
232 #include "qimageiohandler.h"
233 
234 #include <qbytearray.h>
235 #include <qimage.h>
236 #include <qvariant.h>
237 
239 
240 class QIODevice;
241 
243 {
245 public:
247  virtual ~QImageIOHandlerPrivate();
248 
251 
253 };
254 
256 {
257  device = 0;
258  q_ptr = q;
259 }
260 
262 {
263 }
264 
269  : d_ptr(new QImageIOHandlerPrivate(this))
270 {
271 }
272 
282  : d_ptr(&dd)
283 {
284 }
285 
290 {
291 }
292 
305 {
307  d->device = device;
308 }
309 
315 {
316  Q_D(const QImageIOHandler);
317  return d->device;
318 }
319 
327 {
329  d->format = format;
330 }
331 
341 {
342  Q_D(const QImageIOHandler);
343  d->format = format;
344 }
345 
354 {
355  Q_D(const QImageIOHandler);
356  return d->format;
357 }
358 
401 {
402  return format();
403 }
404 
411 bool QImageIOHandler::write(const QImage &image)
412 {
413  Q_UNUSED(image);
414  return false;
415 }
416 
423 {
424  Q_UNUSED(option);
425  Q_UNUSED(value);
426 }
427 
436 {
437  Q_UNUSED(option);
438  return QVariant();
439 }
440 
450 {
451  Q_UNUSED(option);
452  return false;
453 }
454 
466 {
467  return 0;
468 }
469 
478 {
479  return QRect();
480 }
481 
492 {
493  return canRead() ? 1 : 0;
494 }
495 
503 {
504  return false;
505 }
506 
514 bool QImageIOHandler::jumpToImage(int imageNumber)
515 {
516  Q_UNUSED(imageNumber);
517  return false;
518 }
519 
526 {
527  return 0;
528 }
529 
537 {
538  return 0;
539 }
540 
546  : QObject(parent)
547 {
548 }
549 
557 {
558 }
559 
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
double d
Definition: qnumeric_p.h:62
void setFormat(const QByteArray &format)
Sets the format of the QImageIOHandler to format.
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
virtual ~QImageIOHandler()
Destructs the QImageIOHandler object.
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
virtual bool jumpToNextImage()
For image formats that support animation, this function jumps to the next image.
QImageIOHandler()
Constructs a QImageIOHandler object.
QImageIOPlugin(QObject *parent=0)
Constructs an image plugin with the given parent.
virtual bool jumpToImage(int imageNumber)
For image formats that support animation, this function jumps to the image whose sequence number is i...
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
#define Q_D(Class)
Definition: qglobal.h:2482
virtual bool write(const QImage &image)
Writes the image image to the assigned device.
QByteArray format() const
Returns the format that is currently assigned to QImageIOHandler.
virtual void setOption(ImageOption option, const QVariant &value)
Sets the option option with the value value.
QImageIOHandlerPrivate(QImageIOHandler *q)
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
ImageOption
This enum describes the different options supported by QImageIOHandler.
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
virtual QByteArray name() const
Use format() instead.
virtual int loopCount() const
For image formats that support animation, this function returns the number of times the animation sho...
virtual int nextImageDelay() const
For image formats that support animation, this function returns the number of milliseconds to wait un...
virtual ~QImageIOPlugin()
Destroys the picture format plugin.
virtual int imageCount() const
For image formats that support animation, this function returns the number of images in the animation...
#define Q_DECLARE_PUBLIC(Class)
Definition: qglobal.h:2477
void setDevice(QIODevice *device)
Sets the device of the QImageIOHandler to device.
The QImageIOHandler class defines the common image I/O interface for all image formats in Qt...
QScopedPointer< QImageIOHandlerPrivate > d_ptr
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QIODevice * device() const
Returns the device currently assigned to the QImageIOHandler.
virtual int currentImageNumber() const
For image formats that support animation, this function returns the sequence number of the current im...
QImageIOHandler * q_ptr
virtual QVariant option(ImageOption option) const
Returns the value assigned to option as a QVariant.
virtual bool supportsOption(ImageOption option) const
Returns true if the QImageIOHandler supports the option option; otherwise returns false...
The QIODevice class is the base interface class of all I/O devices in Qt.
Definition: qiodevice.h:66
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
virtual bool canRead() const =0
Returns true if an image can be read from the device (i.
virtual QRect currentImageRect() const
Returns the rect of the current image.