18 std::shared_ptr<ImageData> data_;
28 explicit Image(
const std::string& filename,
unsigned image_flags =
IF_SMOOTH);
34 Image(
const std::string& filename,
int src_x,
int src_y,
35 int src_width,
int src_height,
unsigned image_flags =
IF_SMOOTH);
41 Image(
const Bitmap& source,
int src_x,
int src_y,
int src_width,
42 int src_height,
unsigned image_flags =
IF_SMOOTH);
45 explicit Image(std::unique_ptr<ImageData>&&
data);
47 unsigned width()
const;
51 void draw(
double x,
double y,
ZPos z = 0,
double scale_x = 1,
double scale_y = 1,
54 void draw_mod(
double x,
double y,
ZPos z,
double scale_x,
double scale_y,
67 double center_x = 0.5,
double center_y = 0.5,
double scale_x = 1,
double scale_y = 1,
82 int tile_width,
int tile_height,
unsigned image_flags =
IF_SMOOTH);
88 std::vector<Gosu::Image>
load_tiles(
const std::string& filename,
89 int tile_width,
int tile_height,
unsigned image_flags =
IF_SMOOTH);
Represents an RGBA color value with 8 bits for each channel.
void draw_rot(double x, double y, ZPos z=0, double angle=0, double center_x=0.5, double center_y=0.5, double scale_x=1, double scale_y=1, Color c=Color::WHITE, AlphaMode mode=AM_DEFAULT) const
Draws the image rotated by the given angle so that its rotation center is at (x; y).
std::vector< Gosu::Image > load_tiles(const Bitmap &bmp, int tile_width, int tile_height, unsigned image_flags=IF_SMOOTH)
Convenience function that slices an image file into a grid and creates images from them...
double ZPos
Represents the Z position of something drawn with Gosu's graphics system.
A two-dimensional array area of pixels, each represented by a Color value.
double angle(double from_x, double from_y, double to_x, double to_y, double def=0)
Returns the angle from point 1 to point 2 in degrees, where 0.0 means upwards.
The ImageData class is an abstract base class for drawable images.
AlphaMode
Determines the way colors are combined when one is drawn onto another.
ImageData & data() const
Provides access to the underlying image data object.
Interface of the Color class.
Provides functionality for drawing rectangular images.
void draw_mod(double x, double y, ZPos z, double scale_x, double scale_y, Color c1, Color c2, Color c3, Color c4, AlphaMode mode=AM_DEFAULT) const
Like draw(), but with modulation colors for all four corners.
void draw(double x, double y, ZPos z=0, double scale_x=1, double scale_y=1, Color c=Color::WHITE, AlphaMode mode=AM_DEFAULT) const
Draws the image so its upper left corner is at (x; y).
Image()
Creates an empty image. It will have a width and height of 0, and not contain anything.
Contains general typedefs and enums related to graphics.