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

KImgIO

  • 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__
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Fri Jul 12 2013 08:51:07 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.5 API Reference

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