20 #include <SDL2/SDL_surface.h>
56 std::size_t
area()
const;
58 operator SDL_Surface*()
const {
return surface_; }
76 auto* pixels =
reinterpret_cast<const uint32_t*
>(
surf->pixels);
85 auto* pixels =
reinterpret_cast<uint32_t*
>(
surf->pixels);
Helper class for pinning SDL surfaces into memory.
utils::const_clone_t< uint32_t, T > pixel_t
utils::span< pixel_t > pixel_span() const
point size() const
Dimensions of the surface.
SDL_Surface * operator->() const
surface clone() const
Creates a new, duplicate surface in memory using the 'neutral' pixel format.
SDL_Surface * get() const
std::size_t area() const
Total area of the surface in square pixels.
surface & operator=(const surface &s)
auto pixel_span(const surface &surf)
Returns a read-only view over to surf's underlying pixel array.
typename const_clone< D, S >::type const_clone_t
std::ostream & operator<<(std::ostream &stream, const surface &surf)
static map_location::direction s