• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 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
24bool SoftimagePICHandler::canRead() const {
25 if (!SoftimagePICHandler::canRead(device())) {
26 return false;
27 }
28 setFormat("pic");
29 return true;
30}
31
32bool SoftimagePICHandler::read(QImage *image) {
33 pic_read(device(), image);
34 return true;
35}
36
37bool SoftimagePICHandler::write(const QImage &image) {
38 pic_write(device(), &image);
39 return true;
40}
41
42bool 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
52QVariant 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
64bool SoftimagePICHandler::supportsOption(ImageOption option) const {
65 return ( option == Size);
66}
67
68QByteArray SoftimagePICHandler::name() const {
69 return "pic";
70}
71
SoftimagePICHandler::write
virtual bool write(const QImage &)
Definition: pic_io_handler.cpp:37
SoftimagePICHandler::option
QVariant option(ImageOption option) const
Definition: pic_io_handler.cpp:52
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
SoftimagePICHandler::name
QByteArray name() const
Definition: pic_io_handler.cpp:68
SoftimagePICHandler::read
virtual bool read(QImage *image)
Definition: pic_io_handler.cpp:32
SoftimagePICHandler::supportsOption
bool supportsOption(ImageOption option) const
Definition: pic_io_handler.cpp:64
pic_io_handler.h
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
pic_read
void pic_read(QIODevice *dev, QImage *result)
KDE image reading function.
Definition: pic_read.cpp:264
pic_rw.h
pic_write
void pic_write(QIODevice *dev, const QImage *img)
Pic write handler for Qt / KDE.
Definition: pic_write.cpp:213
PICHeader
PIC format header.
Definition: pic_rw.h:68
PICHeader::width
qint16 width
Definition: pic_rw.h:73
PICHeader::id
char id[4]
Definition: pic_rw.h:72
PICHeader::height
qint16 height
Definition: pic_rw.h:74
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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.14.38 API Reference

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