00001 /* 00002 Copyright © 2009-2010 Thibaut Cuvelier 00003 00004 This file is part of QExtend. 00005 00006 QExtend is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 any later version. 00010 00011 QExtend is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with QExtend. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 #ifndef QEXTEND_PLUGINS_IMAGEFORMATS_DEVIL_HANDLER_H 00021 #define QEXTEND_PLUGINS_IMAGEFORMATS_DEVIL_HANDLER_H 00022 00023 // Qt 00024 #include <QtCore/QByteArray> 00025 #include <QtCore/QRect> 00026 #include <QtCore/QString> 00027 #include <QtCore/QIODevice> 00028 #include <QtGui/QImage> 00029 #include <QtGui/QImageIOHandler> 00030 #include <QtGui/QTransform> 00031 #include <QtGui/QPaintDevice> 00032 #include <QtGui/QRgb> 00033 // QExtend 00034 #include "../../../core/qextend_global.h" 00035 // DevIL 00036 #include <IL/il.h> 00037 00038 namespace QExtend 00039 { 00040 00041 namespace DevIL 00042 { 00043 00044 00046 00048 00064 class DevILHandler : public QImageIOHandler 00065 { 00066 public: 00067 00068 00070 00071 00073 DevILHandler(); 00074 00075 00076 00078 00079 00081 ~DevILHandler(); 00082 00083 00084 00085 00086 00088 00089 00091 00113 void setDevice( QIODevice * device ); 00114 00115 00116 00118 00119 00121 00140 QIODevice * device() const; 00141 00142 00143 00144 00145 00147 00148 00150 00167 bool canRead() const; 00168 00169 00170 00172 00173 00175 00193 bool canRead( QIODevice * device ); 00194 00195 00196 00197 00198 00200 00201 00203 00222 bool read( QImage * image ); 00223 00224 00225 00227 00228 00230 00249 bool write( const QImage & image ); 00250 00251 QVariant option( ImageOption option ) const; 00252 void setOption( ImageOption option, const QVariant &value ); 00253 bool supportsOption( ImageOption option ) const; 00254 00255 int loopCount() const; 00256 int nextImageDelay() const; 00257 int imageCount() const; 00258 bool jumpToImage( int imageNumber ) const; 00259 00260 void setFormat( const QByteArray & format ); 00261 ILenum format() const; 00262 QByteArray format() const; 00263 00264 private: 00265 char * Lump; 00266 ILuint Size; // of the picture, in bytes 00267 ILuint Width; 00268 ILuint Height; 00269 ILuint Depth; 00270 ILubyte * Data; 00271 ILenum I_Format; 00272 QByteArray format; 00273 ILuint Palette; 00274 ILuint NumImages; 00275 ILuint DurImage; 00276 float Gamma; 00277 const char * fileName; 00278 QIODevice * Device; 00279 QSize Size_wh; // of the picture, in pixels 00280 QImage Image; 00281 QImage::Format Q_Format; 00282 }; 00283 00284 } // namespace DevIL 00285 00286 } // namespace QExtend 00287 00288 #endif // QEXTEND_PLUGINS_IMAGEFORMATS_DEVIL_HANDLER_H
© 2000-2024 - www.developpez.com