Gosu
ImageData.hpp
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include <Gosu/Fwd.hpp>
7 #include <Gosu/Color.hpp>
8 #include <Gosu/GraphicsBase.hpp>
9 #include <Gosu/Platform.hpp>
10 #include <memory>
11 
12 namespace Gosu
13 {
17  struct GLTexInfo
18  {
19  int tex_name;
20  double 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:
35  ImageData() {}
36 
37  virtual ~ImageData() {}
38 
39  virtual int width() const = 0;
40 
41  virtual int height() const = 0;
42 
43  virtual void draw(double x1, double y1, Color c1,
44  double x2, double y2, Color c2,
45  double x3, double y3, Color c3,
46  double x4, double y4, Color c4,
47  ZPos z, AlphaMode mode) const = 0;
48 
49  virtual const GLTexInfo* gl_tex_info() const = 0;
50 
51  virtual Bitmap to_bitmap() const = 0;
52 
53  virtual std::unique_ptr<ImageData> subimage(int x, int y, int width, int height) const = 0;
54 
55  virtual void insert(const Bitmap& bitmap, int x, int y) = 0;
56  };
57 }
Definition: Audio.hpp:12
Represents an RGBA color value with 8 bits for each channel.
Definition: Color.hpp:16
double ZPos
Represents the Z position of something drawn with Gosu&#39;s graphics system.
A two-dimensional array area of pixels, each represented by a Color value.
Definition: Bitmap.hpp:14
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
Macros and utility functions to facilitate programming on all of Gosu&#39;s supported platforms...
virtual ~ImageData()
Definition: ImageData.hpp:37
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.