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

KImgIO

  • kimgio
pic_io_handler.cpp
Go to the documentation of this file.
1 
21 #include "pic_io_handler.h"
22 #include "pic_rw.h"
23 
24 bool SoftimagePICHandler::canRead() const {
25  if (!SoftimagePICHandler::canRead(device())) {
26  return false;
27  }
28  setFormat("pic");
29  return true;
30 }
31 
32 bool SoftimagePICHandler::read(QImage *image) {
33  pic_read(device(), image);
34  return true;
35 }
36 
37 bool SoftimagePICHandler::write(const QImage &image) {
38  pic_write(device(), &image);
39  return true;
40 }
41 
42 bool SoftimagePICHandler::canRead(QIODevice *device) {
43  PICHeader hdr;
44  if (picReadHeader(device, &hdr, true)) {
45  if (strncmp(hdr.id, "PICT", 4) == 0) {
46  return true;
47  }
48  }
49  return false;
50 }
51 
52 QVariant SoftimagePICHandler::option(ImageOption option) const {
53  if (option == Size) {
54  PICHeader hdr;
55  if (picReadHeader(device(), &hdr, true)) {
56  return QSize(hdr.width, hdr.height);
57  } else {
58  return QSize(-1, -1);
59  }
60  }
61  return QVariant();
62 }
63 
64 bool SoftimagePICHandler::supportsOption(ImageOption option) const {
65  return ( option == Size);
66 }
67 
68 QByteArray SoftimagePICHandler::name() const {
69  return "pic";
70 }
71 
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Wed Mar 20 2013 07:15:36 by doxygen 1.8.3.1 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.10.1 API Reference

Skip menu "kdelibs-4.10.1 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