• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 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
40typedef enum {
41 NONE = 0, /* No picture */
42 ODD = 1, /* Odd scanlines */
43 EVEN = 2, /* Even scanlines */
44 BOTH = 3 /* Every scanline */
45} PICFields;
46
50typedef enum {
51 UNCOMPRESSED = 0, /* Image is uncompressed */
52 RLE = 2 /* Run length compression */
53} PICChannelType;
54
58typedef enum {
59 RED = 0x80, /* Red channel */
60 GREEN = 0x40, /* Green channel */
61 BLUE = 0x20, /* Blue channel */
62 ALPHA = 0x10 /* Alpha channel */
63} PICChannelCode;
64
68typedef 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
83typedef 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
101bool picReadHeader(QIODevice *dev, PICHeader *hdr, bool peek = false);
102
104void pic_read(QIODevice *dev, QImage *img);
105
107void pic_write(QIODevice *dev, const QImage *img);
108
109
110#endif//__PIC_RW_H__
PICFields
PICFields
How fields are distributed over the image.
Definition: pic_rw.h:40
BOTH
@ BOTH
Definition: pic_rw.h:44
EVEN
@ EVEN
Definition: pic_rw.h:43
ODD
@ ODD
Definition: pic_rw.h:42
NONE
@ NONE
Definition: pic_rw.h:41
pic_read
void pic_read(QIODevice *dev, QImage *img)
Pic read handler for Qt / KDE.
Definition: pic_read.cpp:264
PICChannelType
PICChannelType
Type of a channel.
Definition: pic_rw.h:50
UNCOMPRESSED
@ UNCOMPRESSED
Definition: pic_rw.h:51
RLE
@ RLE
Definition: pic_rw.h:52
PICChannelCode
PICChannelCode
Channel codes.
Definition: pic_rw.h:58
BLUE
@ BLUE
Definition: pic_rw.h:61
ALPHA
@ ALPHA
Definition: pic_rw.h:62
GREEN
@ GREEN
Definition: pic_rw.h:60
RED
@ RED
Definition: pic_rw.h:59
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
pic_write
void pic_write(QIODevice *dev, const QImage *img)
Pic write handler for Qt / KDE.
Definition: pic_write.cpp:213
PICChannel
PIC channel header.
Definition: pic_rw.h:83
PICChannel::type
char type
Definition: pic_rw.h:86
PICChannel::size
char size
Definition: pic_rw.h:85
PICChannel::channel
char channel
Definition: pic_rw.h:87
PICChannel::chained
char chained
Definition: pic_rw.h:84
PICHeader
PIC format header.
Definition: pic_rw.h:68
PICHeader::magic
qint32 magic
Definition: pic_rw.h:69
PICHeader::version
float version
Definition: pic_rw.h:70
PICHeader::width
qint16 width
Definition: pic_rw.h:73
PICHeader::pad
qint16 pad
Definition: pic_rw.h:77
PICHeader::ratio
float ratio
Definition: pic_rw.h:75
PICHeader::fields
qint16 fields
Definition: pic_rw.h:76
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