1 #ifndef _freeimage_bitmap_
\r
2 #define _freeimage_bitmap_
\r
4 #include <FreeImage.h>
\r
16 Bitmap(const Bitmap &bmp);
\r
17 Bitmap(const std::string &typestr, const std::string &filename);
\r
18 Bitmap(FIBITMAP *bmp);
\r
19 Bitmap(const int width, const int height, const int bpp);
\r
22 const bool Create(const int width, const int height, const int bpp);
\r
24 inline const unsigned int Height() const { return m_bmp ? FreeImage_GetHeight(m_bmp) : 0 ; }
\r
25 inline const unsigned int Width() const { return m_bmp ? FreeImage_GetWidth(m_bmp) : 0 ; }
\r
26 inline const unsigned int BPP() const { return m_bmp ? FreeImage_GetBPP(m_bmp) : 0 ; }
\r
27 void ConvertBPP(const int bpp);
\r
29 void Clear(const RGBQUAD color);
\r
30 void ClearTransparent();
\r
32 const bool Save(const std::string &filename) const;
\r
33 const bool SaveToMemory(const std::string &typestr, std::vector<unsigned char> &data) const;
\r
34 const bool Load(const std::string &typestr, const std::string &filename);
\r
35 const bool LoadFromMemory(const std::string &typestr, std::vector<unsigned char> &data);
\r
37 void SetTransparent();
\r
39 void PutPixel(const int x, const int y, RGBQUAD color);
\r
40 RGBQUAD GetPixel(const int x, const int y) const;
\r
41 const int GetPixelIndex(const int x, const int y) const;
\r
42 void Line(const int x1, const int y1, const int x2, const int y2, const RGBQUAD color);
\r
43 void FastLine(const int x1, const int y1, const int x2, const int y2, const RGBQUAD color);
\r
44 //void Arc(const int cx, const int cy, const int r, const float start, const float end, const RGBQUAD color);
\r
45 void Rect(const int x1, const int y1, const int w, const int h, const bool filled, const RGBQUAD color);
\r
46 void Rotate(const double angle, const int shiftx, const int shifty, const int originx, const int originy);
\r
47 void HorizontalOffset(const int y, const double shift);
\r
48 void VerticalOffset(const int x, const double shift);
\r
50 void Blit(const Bitmap &bmp, const int destx, const int desty, const int sourcex, const int sourcey, const int w, const int h, const int alpha);
\r
51 void BlitTrans(const Bitmap &bmp, const int destx, const int desty, const int sourcex, const int sourcey, const int w, const int h);
\r
53 Bitmap &operator=(const Bitmap &rhs);
\r
57 void AALine(const int x1, const int y1, const int x2, const int y2, const RGBQUAD color);
\r
58 double LineFunction(const double slopex, const double slopey, const int startx, const int starty, const double testx, const double texty);
\r
66 #endif // _freeimage_bitmap_
\r