#include <surface.hpp>
Public Member Functions | |
surface () | |
surface (SDL_Surface *surf) | |
surface (int w, int h) | |
Allocates a new surface with the given dimensions. More... | |
surface (const surface &s) | |
surface (surface &&s) noexcept | |
~surface () | |
surface & | operator= (const surface &s) |
surface & | operator= (surface &&s) noexcept |
void | clear_without_free () |
bool | is_neutral () const |
Check that the surface is neutral bpp 32. More... | |
surface & | make_neutral () |
Converts this surface to a neutral format if it is not already. More... | |
surface | clone () const |
Makes a copy of this surface. More... | |
operator SDL_Surface * () const | |
SDL_Surface * | get () const |
SDL_Surface * | operator-> () const |
Private Member Functions | |
void | assign_surface_internal (SDL_Surface *surf) |
void | free_surface () |
Static Private Member Functions | |
static void | add_surface_ref (SDL_Surface *surf) |
Private Attributes | |
SDL_Surface * | surface_ |
Static Private Attributes | |
static const SDL_PixelFormat | neutral_pixel_format |
Definition at line 25 of file surface.hpp.
|
inline |
surface::surface | ( | SDL_Surface * | surf | ) |
Definition at line 27 of file surface.cpp.
References make_neutral().
surface::surface | ( | int | w, |
int | h | ||
) |
Allocates a new surface with the given dimensions.
Definition at line 33 of file surface.cpp.
References neutral_pixel_format, and surface_.
|
inline |
Definition at line 36 of file surface.hpp.
References add_surface_ref(), and surface_.
|
inlinenoexcept |
Definition at line 41 of file surface.hpp.
References s.
|
inline |
Definition at line 46 of file surface.hpp.
References free_surface().
|
inlinestaticprivate |
Definition at line 100 of file surface.hpp.
References assign_surface_internal(), and free_surface().
Referenced by assign_surface_internal(), and surface().
|
private |
Definition at line 81 of file surface.cpp.
References add_surface_ref(), free_surface(), make_neutral(), and surface_.
Referenced by add_surface_ref(), and operator=().
|
inline |
Definition at line 66 of file surface.hpp.
References clone(), is_neutral(), make_neutral(), and surface_.
surface surface::clone | ( | ) | const |
Makes a copy of this surface.
The copy will be in the 'neutral' pixel format.
Note this is creates a new, duplicate surface in memory. Making a copy of this 'surface' object will not duplicate the surface itself since we only hold a pointer to the actual surface.
Definition at line 75 of file surface.cpp.
References neutral_pixel_format, surface(), and surface_.
Referenced by adjust_surface_alpha_add(), adjust_surface_color(), alpha_to_greyscale(), image::apply_light(), blend_surface(), blur_alpha_surface(), blur_surface(), brighten_image(), clear_without_free(), gui::tristate_button::draw_contents(), gui::button::draw_contents(), flip_surface(), flop_surface(), get_non_transparent_portion(), greyscale_image(), in_mask_surface(), light_surface(), gui2::dialogs::make_screenshot(), mask_surface(), monochrome_image(), negative_image(), image::adjust_alpha_modification::operator()(), image::adjust_channels_modification::operator()(), image::blit_modification::operator()(), image::o_modification::operator()(), image::background_modification::operator()(), recolor_image(), display::render_image(), rotate_180_surface(), display::screenshot(), display::scroll(), sepia_image(), submerge_alpha(), swap_channels_image(), and wipe_alpha().
|
private |
Definition at line 89 of file surface.cpp.
References sdl_get_version(), and surface_.
Referenced by add_surface_ref(), assign_surface_internal(), make_neutral(), operator=(), and ~surface().
|
inline |
Definition at line 95 of file surface.hpp.
References surface_.
Referenced by gui::textbox::append_text(), gui::menu::imgsel_style::load_image(), operator<(), operator<<(), and operator=().
bool surface::is_neutral | ( | ) | const |
Check that the surface is neutral bpp 32.
The surface may have an empty alpha channel.
true
if neutral, false
if not. Definition at line 52 of file surface.cpp.
References SDL_ALPHA_MASK, SDL_RED_MASK, and surface_.
Referenced by gui2::canvas::blit(), blit_surface(), clear_without_free(), and make_neutral().
surface & surface::make_neutral | ( | ) |
Converts this surface to a neutral format if it is not already.
Definition at line 61 of file surface.cpp.
References free_surface(), is_neutral(), neutral_pixel_format, and surface_.
Referenced by assign_surface_internal(), clear_without_free(), and surface().
|
inline |
Definition at line 93 of file surface.hpp.
References surface_.
|
inline |
Definition at line 97 of file surface.hpp.
References surface_.
Definition at line 51 of file surface.hpp.
References assign_surface_internal(), and get().
Definition at line 57 of file surface.hpp.
References free_surface(), s, and surface_.
|
staticprivate |
Definition at line 113 of file surface.hpp.
Referenced by clone(), make_neutral(), and surface().
|
private |
Definition at line 111 of file surface.hpp.
Referenced by assign_surface_internal(), clear_without_free(), clip_rect_setter::clip_rect_setter(), clone(), free_surface(), get(), is_neutral(), make_neutral(), operator SDL_Surface *(), operator->(), operator=(), surface_locker< T >::pixels(), surface(), surface_locker< T >::surface_locker(), clip_rect_setter::~clip_rect_setter(), and surface_locker< T >::~surface_locker().