ImageData.hpp
Go to the documentation of this file.
1 
4 #ifndef GOSU_IMAGEDATA_HPP
5 #define GOSU_IMAGEDATA_HPP
6 
7 #include <Gosu/Color.hpp>
8 #include <Gosu/GraphicsBase.hpp>
9 #include <Gosu/Fwd.hpp>
10 #include <Gosu/Platform.hpp>
11 
12 namespace Gosu
13 {
17  struct GLTexInfo
18  {
19  int texName;
20  float left, right, top, bottom;
21  };
22 
28  class ImageData
29  {
30  // Non-copyable
31  ImageData(const ImageData&);
32  ImageData& operator=(const ImageData&);
33 
34  public:
36  {
37  }
38 
39  virtual ~ImageData()
40  {
41  }
42 
43  virtual int width() const = 0;
44  virtual int height() const = 0;
45 
46  virtual void draw(double x1, double y1, Color c1,
47  double x2, double y2, Color c2,
48  double x3, double y3, Color c3,
49  double x4, double y4, Color c4,
50  ZPos z, AlphaMode mode) const = 0;
51 
52  virtual const GLTexInfo* glTexInfo() const = 0;
53  virtual Bitmap toBitmap() const = 0;
54 
55  virtual GOSU_UNIQUE_PTR<ImageData> subimage(int x, int y, int width, int height) const = 0;
56 
57  virtual void insert(const Bitmap& bitmap, int x, int y) = 0;
58  };
59 }
60 
61 #endif
virtual Bitmap toBitmap() const =0
virtual void draw(double x1, double y1, Color c1, double x2, double y2, Color c2, double x3, double y3, Color c3, double x4, double y4, Color c4, ZPos z, AlphaMode mode) const =0
virtual void insert(const Bitmap &bitmap, int x, int y)=0
virtual GOSU_UNIQUE_PTR< ImageData > subimage(int x, int y, int width, int height) const =0
Contains declarations of all of Gosu&#39;s available classes.
Represents an RGBA color value with 8 bits for each channel.
Definition: Color.hpp:18
virtual int height() const =0
double ZPos
Represents the Z position of something drawn with Gosu&#39;s graphics system.
Rectangular area of pixels, each represented by a Color value.
Definition: Bitmap.hpp:20
Contains information about the underlying OpenGL texture and the u/v space used for image data...
Definition: ImageData.hpp:17
The ImageData class is an abstract base class for drawable images.
Definition: ImageData.hpp:28
virtual const GLTexInfo * glTexInfo() const =0
Macros and utility functions to facilitate programming on all of Gosu&#39;s supported platforms...
virtual ~ImageData()
Definition: ImageData.hpp:39
virtual int width() const =0
AlphaMode
Determines the way colors are combined when one is drawn onto another.
Interface of the Color class.
Contains general typedefs and enums related to graphics.