]> git.ipfire.org Git - thirdparty/cups.git/blob - pdftops/SplashBitmap.h
Load cups into easysw/current.
[thirdparty/cups.git] / pdftops / SplashBitmap.h
1 //========================================================================
2 //
3 // SplashBitmap.h
4 //
5 //========================================================================
6
7 #ifndef SPLASHBITMAP_H
8 #define SPLASHBITMAP_H
9
10 #include <config.h>
11
12 #ifdef USE_GCC_PRAGMAS
13 #pragma interface
14 #endif
15
16 #include "SplashTypes.h"
17
18 //------------------------------------------------------------------------
19 // SplashBitmap
20 //------------------------------------------------------------------------
21
22 class SplashBitmap {
23 public:
24
25 // Create a new bitmap. It will have <widthA> x <heightA> pixels in
26 // color mode <modeA>. Rows will be padded out to a multiple of
27 // <rowPad> bytes. If <topDown> is false, the bitmap will be stored
28 // upside-down, i.e., with the last row first in memory.
29 SplashBitmap(int widthA, int heightA, int rowPad,
30 SplashColorMode modeA, GBool topDown = gTrue);
31
32 ~SplashBitmap();
33
34 int getWidth() { return width; }
35 int getHeight() { return height; }
36 int getRowSize() { return rowSize; }
37 SplashColorMode getMode() { return mode; }
38 SplashColorPtr getDataPtr() { return data; }
39
40 SplashError writePNMFile(char *fileName);
41
42 void getPixel(int x, int y, SplashColorPtr pixel);
43
44 private:
45
46 int width, height; // size of bitmap
47 int rowSize; // size of one row of data, in bytes
48 // - negative for bottom-up bitmaps
49 SplashColorMode mode; // color mode
50 SplashColorPtr data; // pointer to row zero of the bitmap data
51
52 friend class Splash;
53 };
54
55 #endif