• 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_rw.h
Go to the documentation of this file.
1 
21 /* This code is based on the GIMP-PIC plugin by Halfdan Ingvarsson,
22  * and relicensed from GPL to LGPL to accomodate the KDE licensing policy
23  * with his permission.
24  * These is the original copyright:
25  * Copyright (C) 1998 Halfdan Ingvarsson
26  */
27 
28 #ifndef __PIC_RW_H__
29 #define __PIC_RW_H__
30 
31 #define PIC_MAGIC_NUMBER 0x5380f634
32 
33 #include <QtCore/QFile>
34 #include <QtGui/QImageIOPlugin>
35 #include <QtGui/QColor>
36 
40 typedef enum {
41  NONE = 0, /* No picture */
42  ODD = 1, /* Odd scanlines */
43  EVEN = 2, /* Even scanlines */
44  BOTH = 3 /* Every scanline */
45 } PICFields;
46 
50 typedef enum {
51  UNCOMPRESSED = 0, /* Image is uncompressed */
52  RLE = 2 /* Run length compression */
53 } PICChannelType;
54 
58 typedef enum {
59  RED = 0x80, /* Red channel */
60  GREEN = 0x40, /* Green channel */
61  BLUE = 0x20, /* Blue channel */
62  ALPHA = 0x10 /* Alpha channel */
63 } PICChannelCode;
64 
68 typedef struct {
69  qint32 magic; /* PIC_MAGIC_NUMBER */
70  float version; /* Version of format */
71  char comment[80]; /* Prototype description */
72  char id[4]; /* "PICT" */
73  qint16 width; /* Image width, in pixels */
74  qint16 height; /* Image height, in pixels */
75  float ratio; /* Pixel aspect ratio */
76  qint16 fields; /* Picture field type */
77  qint16 pad; /* Unused */
78 } PICHeader;
79 
83 typedef struct {
84  char chained; /* 1 if another packet follows, else 0 */
85  char size; /* Bits per pixel by channel */
86  char type; /* RLE or uncompressed */
87  char channel; /* Channel code (which planes are affected by this channel) */
88 } PICChannel;
89 
90 #define HEADER_SIZE sizeof(PICHeader)
91 #define CHANNEL_SIZE sizeof(PICChannel)
92 
93 
101 bool picReadHeader(QIODevice *dev, PICHeader *hdr, bool peek = false);
102 
104 void pic_read(QIODevice *dev, QImage *img);
105 
107 void pic_write(QIODevice *dev, const QImage *img);
108 
109 
110 #endif//__PIC_RW_H__
QIODevice
PICHeader::ratio
float ratio
Definition: pic_rw.h:75
PICChannel
PIC channel header.
Definition: pic_rw.h:83
picReadHeader
bool picReadHeader(QIODevice *dev, PICHeader *hdr, bool peek=false)
Reads the PIC header and checks that it is OK.
Definition: pic_read.cpp:41
PICHeader
PIC format header.
Definition: pic_rw.h:68
UNCOMPRESSED
Definition: pic_rw.h:51
EVEN
Definition: pic_rw.h:43
PICHeader::magic
qint32 magic
Definition: pic_rw.h:69
PICChannel::size
char size
Definition: pic_rw.h:85
pic_write
void pic_write(QIODevice *dev, const QImage *img)
Pic write handler for Qt / KDE.
Definition: pic_write.cpp:213
PICHeader::version
float version
Definition: pic_rw.h:70
pic_read
void pic_read(QIODevice *dev, QImage *img)
Pic read handler for Qt / KDE.
Definition: pic_read.cpp:264
PICFields
PICFields
How fields are distributed over the image.
Definition: pic_rw.h:40
PICChannel::channel
char channel
Definition: pic_rw.h:87
PICChannel::chained
char chained
Definition: pic_rw.h:84
PICChannelType
PICChannelType
Type of a channel.
Definition: pic_rw.h:50
RLE
Definition: pic_rw.h:52
PICHeader::fields
qint16 fields
Definition: pic_rw.h:76
QImage
ODD
Definition: pic_rw.h:42
BLUE
Definition: pic_rw.h:61
BOTH
Definition: pic_rw.h:44
PICChannel::type
char type
Definition: pic_rw.h:86
GREEN
Definition: pic_rw.h:60
NONE
Definition: pic_rw.h:41
PICHeader::height
qint16 height
Definition: pic_rw.h:74
PICHeader::pad
qint16 pad
Definition: pic_rw.h:77
ALPHA
Definition: pic_rw.h:62
RED
Definition: pic_rw.h:59
PICChannelCode
PICChannelCode
Channel codes.
Definition: pic_rw.h:58
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