• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kimgio
 

kimgio

  • kimgio
pcx.h
1 /* This file is part of the KDE project
2  Copyright (C) 2002-2003 Nadeem Hasan <nhasan@kde.org>
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the Lesser GNU General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 */
9 
10 #ifndef PCX_H
11 #define PCX_H
12 
13 #include <tqglobal.h>
14 #include <tqdatastream.h>
15 #include <tqcolor.h>
16 
17 class TQImageIO;
18 
19 extern "C"
20 {
21  void kimgio_pcx_read( TQImageIO * );
22  void kimgio_pcx_write( TQImageIO * );
23 }
24 
25 class RGB
26 {
27  public:
28  RGB() { }
29 
30  RGB( const QRgb color )
31  {
32  r = tqRed( color );
33  g = tqGreen( color );
34  b = tqBlue( color );
35  }
36 
37  TQ_UINT8 r;
38  TQ_UINT8 g;
39  TQ_UINT8 b;
40 };
41 
42 class Palette
43 {
44  public:
45  Palette() { }
46 
47  void setColor( int i, const QRgb color )
48  {
49  rgb[ i ] = RGB( color );
50  }
51 
52  QRgb color( int i ) const
53  {
54  return tqRgb( rgb[ i ].r, rgb[ i ].g, rgb[ i ].b );
55  }
56 
57  struct RGB rgb[ 16 ];
58 };
59 
60 class PCXHEADER
61 {
62  public:
63  PCXHEADER();
64 
65  inline int width() const { return ( XMax-XMin ) + 1; }
66  inline int height() const { return ( YMax-YMin ) + 1; }
67  inline bool isCompressed() const { return ( Encoding==1 ); }
68 
69  TQ_UINT8 Manufacturer; // Constant Flag, 10 = ZSoft .pcx
70  TQ_UINT8 Version; // Version information
71  // 0 = Version 2.5 of PC Paintbrush
72  // 2 = Version 2.8 w/palette information
73  // 3 = Version 2.8 w/o palette information
74  // 4 = PC Paintbrush for Windows(Plus for
75  // Windows uses Ver 5)
76  // 5 = Version 3.0 and > of PC Paintbrush
77  // and PC Paintbrush +, includes
78  // Publisher's Paintbrush . Includes
79  // 24-bit .PCX files
80  TQ_UINT8 Encoding; // 1 = .PCX run length encoding
81  TQ_UINT8 Bpp; // Number of bits to represent a pixel
82  // (per Plane) - 1, 2, 4, or 8
83  TQ_UINT16 XMin;
84  TQ_UINT16 YMin;
85  TQ_UINT16 XMax;
86  TQ_UINT16 YMax;
87  TQ_UINT16 HDpi;
88  TQ_UINT16 YDpi;
89  Palette ColorMap;
90  TQ_UINT8 Reserved; // Should be set to 0.
91  TQ_UINT8 NPlanes; // Number of color planes
92  TQ_UINT16 BytesPerLine; // Number of bytes to allocate for a scanline
93  // plane. MUST be an EVEN number. Do NOT
94  // calculate from Xmax-Xmin.
95  TQ_UINT16 PaletteInfo; // How to interpret palette- 1 = Color/BW,
96  // 2 = Grayscale ( ignored in PB IV/ IV + )
97  TQ_UINT16 HScreenSize; // Horizontal screen size in pixels. New field
98  // found only in PB IV/IV Plus
99  TQ_UINT16 VScreenSize; // Vertical screen size in pixels. New field
100  // found only in PB IV/IV Plus
101 } KDE_PACKED;
102 
103 #endif // PCX_H
104 
105 /* vim: et sw=2 ts=2
106 */

kimgio

Skip menu "kimgio"
  • Main Page
  • File List
  • Related Pages

kimgio

Skip menu "kimgio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kimgio by doxygen 1.8.6
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |