• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.8.3 API Reference
  • KDE Home
  • Contact Us
 

KImgIO

pic_io_handler.cpp
Go to the documentation of this file.
00001 
00021 #include "pic_io_handler.h"
00022 #include "pic_rw.h"
00023 
00024 bool SoftimagePICHandler::canRead() const {
00025     if (!SoftimagePICHandler::canRead(device())) {
00026         return false;
00027     }
00028     setFormat("pic");
00029     return true;
00030 }
00031 
00032 bool SoftimagePICHandler::read(QImage *image) {
00033     pic_read(device(), image);
00034     return true;
00035 }
00036 
00037 bool SoftimagePICHandler::write(const QImage &image) {
00038     pic_write(device(), &image);
00039     return true;
00040 }
00041 
00042 bool SoftimagePICHandler::canRead(QIODevice *device) {
00043     PICHeader hdr;
00044     if (picReadHeader(device, &hdr, true)) {
00045         if (strncmp(hdr.id, "PICT", 4) == 0) {
00046             return true;
00047         }
00048     }
00049     return false;
00050 }
00051 
00052 QVariant SoftimagePICHandler::option(ImageOption option) const {
00053     if (option == Size) {
00054         PICHeader hdr;
00055         if (picReadHeader(device(), &hdr, true)) {
00056             return QSize(hdr.width, hdr.height);
00057         } else {
00058             return QSize(-1, -1);
00059         }
00060     }
00061     return QVariant();
00062 }
00063 
00064 bool SoftimagePICHandler::supportsOption(ImageOption option) const {
00065     return ( option == Size);
00066 }
00067 
00068 QByteArray SoftimagePICHandler::name() const {
00069     return "pic";
00070 }
00071 
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu May 10 2012 20:50:56 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KImgIO

Skip menu "KImgIO"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.8.3 API Reference

Skip menu "kdelibs-4.8.3 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal