source: liacs/MIR2010/SourceCode/cximage/ximapcx.h@ 137

Last change on this file since 137 was 95, checked in by Rick van der Zwet, 15 years ago

Bad boy, improper move of directory

File size: 2.1 KB
Line 
1/*
2 * File: ximapcx.h
3 * Purpose: PCX Image Class Loader and Writer
4 */
5/* ==========================================================
6 * CxImagePCX (c) 05/Jan/2002 Davide Pizzolato - www.xdp.it
7 * For conditions of distribution and use, see copyright notice in ximage.h
8 *
9 * Parts of the code come from Paintlib: Copyright (c) 1996-1998 Ulrich von Zadow
10 * ==========================================================
11 */
12#if !defined(__ximaPCX_h)
13#define __ximaPCX_h
14
15#include "ximage.h"
16
17#if CXIMAGE_SUPPORT_PCX
18
19class CxImagePCX: public CxImage
20{
21// PCX Image File
22#pragma pack(1)
23typedef struct tagPCXHEADER
24{
25 char Manufacturer; // always 0X0A
26 char Version; // version number
27 char Encoding; // always 1
28 char BitsPerPixel; // color bits
29 WORD Xmin, Ymin; // image origin
30 WORD Xmax, Ymax; // image dimensions
31 WORD Hres, Vres; // resolution values
32 BYTE ColorMap[16][3]; // color palette
33 char Reserved;
34 char ColorPlanes; // color planes
35 WORD BytesPerLine; // line buffer size
36 WORD PaletteType; // grey or color palette
37 char Filter[58];
38} PCXHEADER;
39#pragma pack()
40
41public:
42 CxImagePCX(): CxImage(CXIMAGE_FORMAT_PCX) {}
43
44// bool Load(const TCHAR * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_PCX);}
45// bool Save(const TCHAR * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_PCX);}
46 bool Decode(CxFile * hFile);
47 bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); }
48
49#if CXIMAGE_SUPPORT_ENCODE
50 bool Encode(CxFile * hFile);
51 bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); }
52#endif // CXIMAGE_SUPPORT_ENCODE
53protected:
54 bool PCX_PlanesToPixels(BYTE * pixels, BYTE * bitplanes, short bytesperline, short planes, short bitsperpixel);
55 bool PCX_UnpackPixels(BYTE * pixels, BYTE * bitplanes, short bytesperline, short planes, short bitsperpixel);
56 void PCX_PackPixels(const long p,BYTE &c, BYTE &n, CxFile &f);
57 void PCX_PackPlanes(BYTE* buff, const long size, CxFile &f);
58 void PCX_PixelsToPlanes(BYTE* raw, long width, BYTE* buf, long plane);
59 void PCX_toh(PCXHEADER* p);
60};
61
62#endif
63
64#endif
Note: See TracBrowser for help on using the repository browser.