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

KImgIO

  • sources
  • kde-4.14
  • kdelibs
  • 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 
QIODevice
pic_rw.h
SoftimagePICHandler::canRead
virtual bool canRead() const
PIC_RW - Qt PIC Support Copyright (C) 2007 Ruben Lopez r.lopez@bren.es
Definition: pic_io_handler.cpp:24
picReadHeader
bool picReadHeader(QIODevice *dev, PICHeader *hdr, bool peek)
PIC_RW - Qt PIC Support Copyright (C) 2007 Ruben Lopez r.lopez@bren.es
Definition: pic_read.cpp:41
QImageIOHandler::device
QIODevice * device() const
QByteArray
PICHeader
PIC format header.
Definition: pic_rw.h:68
pic_write
void pic_write(QIODevice *dev, const QImage *img)
Pic write handler for Qt / KDE.
Definition: pic_write.cpp:213
pic_read
void pic_read(QIODevice *dev, QImage *result)
KDE image reading function.
Definition: pic_read.cpp:264
pic_io_handler.h
PICHeader::id
char id[4]
Definition: pic_rw.h:72
SoftimagePICHandler::supportsOption
bool supportsOption(ImageOption option) const
Definition: pic_io_handler.cpp:64
QSize
QImage
SoftimagePICHandler::read
virtual bool read(QImage *image)
Definition: pic_io_handler.cpp:32
SoftimagePICHandler::write
virtual bool write(const QImage &)
Definition: pic_io_handler.cpp:37
QImageIOHandler::setFormat
void setFormat(const QByteArray &format)
PICHeader::height
qint16 height
Definition: pic_rw.h:74
SoftimagePICHandler::name
QByteArray name() const
Definition: pic_io_handler.cpp:68
SoftimagePICHandler::option
QVariant option(ImageOption option) const
Definition: pic_io_handler.cpp:52
QVariant
PICHeader::width
qint16 width
Definition: pic_rw.h:73
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:49 by doxygen 1.8.7 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 API Reference

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

Search



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