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

kimgio

pcx.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002-2003 Nadeem Hasan <nhasan@kde.org>
00003 
00004    This program is free software; you can redistribute it and/or
00005    modify it under the terms of the Lesser GNU General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 */
00009 
00010 #ifndef PCX_H
00011 #define PCX_H
00012 
00013 #include <tqglobal.h>
00014 #include <tqdatastream.h>
00015 #include <tqcolor.h>
00016 
00017 class TQImageIO;
00018 
00019 extern "C"
00020 {
00021   void kimgio_pcx_read( TQImageIO * );
00022   void kimgio_pcx_write( TQImageIO * );
00023 }
00024 
00025 class RGB
00026 {
00027   public:
00028     RGB() { }
00029 
00030     RGB( const QRgb color )
00031     {
00032       r = tqRed( color );
00033       g = tqGreen( color );
00034       b = tqBlue( color );
00035     }
00036 
00037     TQ_UINT8 r;
00038     TQ_UINT8 g;
00039     TQ_UINT8 b;
00040 };
00041 
00042 class Palette
00043 {
00044   public:
00045     Palette() { }
00046 
00047     void setColor( int i, const QRgb color )
00048     {
00049       rgb[ i ] = RGB( color );
00050     }
00051 
00052     QRgb color( int i ) const
00053     {
00054       return tqRgb( rgb[ i ].r, rgb[ i ].g, rgb[ i ].b );
00055     }
00056 
00057     struct RGB rgb[ 16 ];
00058 };
00059 
00060 class PCXHEADER
00061 {
00062   public:
00063     PCXHEADER();
00064 
00065     inline int width() const { return ( XMax-XMin ) + 1; }
00066     inline int height() const { return ( YMax-YMin ) + 1; }
00067     inline bool isCompressed() const { return ( Encoding==1 ); }
00068 
00069     TQ_UINT8  Manufacturer;    // Constant Flag, 10 = ZSoft .pcx
00070     TQ_UINT8  Version;         // Version information
00071                               // 0 = Version 2.5 of PC Paintbrush
00072                               // 2 = Version 2.8 w/palette information
00073                               // 3 = Version 2.8 w/o palette information
00074                               // 4 = PC Paintbrush for Windows(Plus for
00075                               //     Windows uses Ver 5)
00076                               // 5 = Version 3.0 and > of PC Paintbrush
00077                               //     and PC Paintbrush +, includes
00078                               //     Publisher's Paintbrush . Includes
00079                               //     24-bit .PCX files
00080     TQ_UINT8  Encoding;        // 1 = .PCX run length encoding
00081     TQ_UINT8  Bpp;             // Number of bits to represent a pixel
00082                               // (per Plane) - 1, 2, 4, or 8
00083     TQ_UINT16 XMin;
00084     TQ_UINT16 YMin;
00085     TQ_UINT16 XMax;
00086     TQ_UINT16 YMax;
00087     TQ_UINT16 HDpi;
00088     TQ_UINT16 YDpi;
00089     Palette  ColorMap;
00090     TQ_UINT8  Reserved;        // Should be set to 0.
00091     TQ_UINT8  NPlanes;         // Number of color planes
00092     TQ_UINT16 BytesPerLine;    // Number of bytes to allocate for a scanline
00093                               // plane.  MUST be an EVEN number.  Do NOT
00094                               // calculate from Xmax-Xmin.
00095     TQ_UINT16 PaletteInfo;     // How to interpret palette- 1 = Color/BW,
00096                               // 2 = Grayscale ( ignored in PB IV/ IV + )
00097     TQ_UINT16 HScreenSize;     // Horizontal screen size in pixels. New field
00098                               // found only in PB IV/IV Plus
00099     TQ_UINT16 VScreenSize;     // Vertical screen size in pixels. New field
00100                               // found only in PB IV/IV Plus
00101 } KDE_PACKED;
00102 
00103 #endif // PCX_H
00104 
00105 /* vim: et sw=2 ts=2
00106 */

kimgio

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

kimgio

Skip menu "kimgio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for kimgio by doxygen 1.7.1
This website is maintained by Timothy Pearson.