17 #ifndef HEADER_SUPERTUX_VIDEO_SURFACE_HPP 18 #define HEADER_SUPERTUX_VIDEO_SURFACE_HPP 23 #include "math/rect.hpp" 24 #include "math/vector.hpp" 25 #include "video/flip.hpp" 26 #include "video/surface_ptr.hpp" 27 #include "video/texture_ptr.hpp" 38 static SurfacePtr from_texture(
const TexturePtr& texture);
39 static SurfacePtr from_file(
const std::string& filename,
const std::optional<Rect>& rect = std::nullopt);
40 static SurfacePtr from_reader(
const ReaderMapping& mapping,
const std::optional<Rect>& rect = std::nullopt,
const std::string& filename =
"");
43 Surface(
const TexturePtr& diffuse_texture,
const TexturePtr& displacement_texture, Flip flip,
const std::string& filename =
"");
44 Surface(
const TexturePtr& diffuse_texture,
const TexturePtr& displacement_texture,
const Rect& region, Flip flip,
const std::string& filename =
"");
49 SurfacePtr region(
const Rect& rect)
const;
50 SurfacePtr clone(Flip flip = NO_FLIP)
const;
52 TexturePtr get_texture()
const;
53 TexturePtr get_displacement_texture()
const;
54 Rect get_region()
const {
return m_region; }
55 int get_width()
const;
56 int get_height()
const;
57 Flip get_flip()
const {
return m_flip; }
58 const std::string& get_filename()
const {
return m_source_filename; }
61 const TexturePtr m_diffuse_texture;
62 const TexturePtr m_displacement_texture;
65 const std::string m_source_filename;
A rectangular image.
Definition: surface.hpp:35
Definition: reader_mapping.hpp:32