29 #ifndef NOMLIB_SDL2_IMAGE_HEADERS
30 #define NOMLIB_SDL2_IMAGE_HEADERS
38 #include "SDL_image.h"
40 #include "nomlib/config.hpp"
41 #include "nomlib/math/Color.hpp"
42 #include "nomlib/math/Coords.hpp"
43 #include "nomlib/math/Point2-inl.hpp"
44 #include "nomlib/SDL_helpers.hpp"
60 Image ( uint32 img_flags );
76 bool initialize(
void* pixels, int32 width, int32 height,
77 int32 bpp, uint16 pitch,
78 uint32 Rmask, uint32 Gmask, uint32 Bmask, uint32 Amask );
81 SDL_SURFACE::RawPtr
image (
void )
const;
84 bool valid (
void )
const;
86 int32 width (
void )
const;
87 int32 height (
void )
const;
88 void* pixels (
void )
const;
89 uint16 pitch (
void )
const;
94 const SDL_PIXELFORMAT::RawPtr pixel_format (
void )
const;
97 const uint32
red_mask (
void )
const;
130 void set_bounds (
const Coords& clip_bounds );
134 bool load (
const std::string& filename );
141 bool load_bmp (
const std::string& filename );
148 bool save (
const std::string& filename, SDL_SURFACE::RawPtr video_buffer )
const;
154 bool save (
const std::string& filename )
const;
165 const SDL_BlendMode
blend_mode (
void )
const;
180 bool RLE (
bool flag );
189 uint32
pixel ( int32 x, int32 y );
195 SDL_SURFACE::SharedPtr image_;
201 #endif // NOMLIB_SDL_IMAGE_HEADERS defined
bool load_bmp(const std::string &filename)
Image & operator=(const Image &other)
Copy assignment constructor.
virtual ~Image(void)
Destructor.
const Point2i size(void) const
Obtain the width and height (in pixels) of the stored bitmap buffer.
const uint32 green_mask(void) const
Obtain the video surface's green alpha mask.
Image(void)
Default constructor – initializes to sane defaults.
uint32 pixel(int32 x, int32 y)
SDL_SURFACE::RawPtr image(void) const
Obtain the SDL_Surface struct used in this object instance.
bool set_colorkey(const Color &colorkey, bool flag)
const Coords bounds(void) const
bool load(const std::string &filename)
const uint32 alpha_mask(void) const
Obtain the video surface's alpha mask.
const uint32 blue_mask(void) const
Obtain the video surface's blue alpha mask.
Bitmap storage container.
const SDL_BlendMode blend_mode(void) const
Obtain the blend mode used for blitting.
bool set_blend_mode(const SDL_BlendMode blend)
Set a new blending mode for blitting.
bool initialize(void *pixels, int32 width, int32 height, int32 bpp, uint16 pitch, uint32 Rmask, uint32 Gmask, uint32 Bmask, uint32 Amask)
bool valid(void) const
Is this object initialized? Valid when NOT nullptr.
uint8 bits_per_pixel(void) const
Coordinate values (x, y, z, width, height ) wrapper.
bool save(const std::string &filename, SDL_SURFACE::RawPtr video_buffer) const
const Color colorkey(void) const
const uint32 red_mask(void) const
Obtain the video surface's red alpha mask.
Utility class container for RGBA colors.