# use AROS_LIB/INCLUDES
[AROS-Contrib.git] / arospdf / splash / SplashBitmap.h
blob69ab058e5c537e7101de9b9f1ce2b4ab330ed867
1 //========================================================================
2 //
3 // SplashBitmap.h
4 //
5 //========================================================================
7 #ifndef SPLASHBITMAP_H
8 #define SPLASHBITMAP_H
10 #include <aconf.h>
12 #ifdef USE_GCC_PRAGMAS
13 #pragma interface
14 #endif
16 #include "SplashTypes.h"
18 //------------------------------------------------------------------------
19 // SplashBitmap
20 //------------------------------------------------------------------------
22 class SplashBitmap {
23 public:
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 alphaA,
31 GBool topDown = gTrue);
33 ~SplashBitmap();
35 int getWidth() { return width; }
36 int getHeight() { return height; }
37 int getRowSize() { return rowSize; }
38 int getAlphaRowSize() { return width; }
39 SplashColorMode getMode() { return mode; }
40 SplashColorPtr getDataPtr() { return data; }
41 Guchar *getAlphaPtr() { return alpha; }
43 SplashError writePNMFile(char *fileName);
45 void getPixel(int x, int y, SplashColorPtr pixel);
46 Guchar getAlpha(int x, int y);
48 private:
50 int width, height; // size of bitmap
51 int rowSize; // size of one row of data, in bytes
52 // - negative for bottom-up bitmaps
53 SplashColorMode mode; // color mode
54 SplashColorPtr data; // pointer to row zero of the color data
55 Guchar *alpha; // pointer to row zero of the alpha data
56 // (always top-down)
58 friend class Splash;
61 #endif