Advertisement
Guest User

Untitled

a guest
Mar 9th, 2015
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. #include "argbplugin.h"
  2. #include "argbhandler.h"
  3.  
  4. ArgbPlugin::ArgbPlugin(QObject *parent) :
  5.     QImageIOPlugin(parent)
  6. {
  7. }
  8.  
  9. QStringList ArgbPlugin::keys() const
  10.     {
  11.         return QStringList() << "exr";
  12.     }
  13.  
  14. QImageIOPlugin::Capabilities ArgbPlugin::capabilities(
  15.     QIODevice *device, const QByteArray &format) const
  16. {
  17.     if (format == "exr")
  18.         return Capabilities(CanRead | CanWrite);
  19.     if (!(format.isEmpty() && device->isOpen()))
  20.         return 0;
  21.  
  22.     Capabilities cap;
  23.     if (device->isReadable() && ArgbHandler::canRead(device))
  24.         cap |= CanRead;
  25.     if (device->isWritable())
  26.         cap |= CanWrite;
  27.     return cap;
  28. }
  29.  
  30. QImageIOHandler *ArgbPlugin::create(QIODevice *device, const QByteArray &format) const
  31. {
  32.     //QImageIOHandler *handler = new ArgbHandler;
  33.    // handler->setDevice(device);
  34.    // handler->setFormat(format);
  35.    // return handler;
  36. }
  37.  
  38. #if QT_VERSION < 0x050000
  39. Q_EXPORT_PLUGIN2(ARGB, ArgbPlugin)
  40. #endif // QT_VERSION < 0x050000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement