KImgIO
pic_io_plugin.cpp
Go to the documentation of this file.
00001 00021 #include "pic_io_plugin.h" 00022 #include "pic_io_handler.h" 00023 00024 QImageIOPlugin::Capabilities SoftimagePICPlugin::capabilities(QIODevice *device, const QByteArray &format) const { 00025 if (format == "pic") { 00026 return Capabilities(CanRead | CanWrite); 00027 } 00028 if (!(format.isEmpty() && device->isOpen())) { 00029 return 0; 00030 } 00031 00032 Capabilities cap; 00033 if (device->isReadable() && SoftimagePICHandler::canRead(device)) { 00034 cap |= CanRead; 00035 } 00036 if (device->isWritable()) { 00037 cap |= CanWrite; 00038 } 00039 return cap; 00040 } 00041 00042 QStringList SoftimagePICPlugin::keys() const { 00043 return QStringList() << "pic"; 00044 } 00045 00046 QImageIOHandler * SoftimagePICPlugin::create(QIODevice *device, const QByteArray &format) const { 00047 QImageIOHandler * handler = new SoftimagePICHandler(); 00048 handler->setDevice(device); 00049 handler->setFormat(format); 00050 return handler; 00051 } 00052 00053 Q_EXPORT_STATIC_PLUGIN(SoftimagePICPlugin) 00054 Q_EXPORT_PLUGIN2(softimagePICPlugin, SoftimagePICPlugin) 00055
KDE 4.6 API Reference