mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-20 13:25:10 +00:00
71 lines
1.5 KiB
C++
71 lines
1.5 KiB
C++
/*
|
|
** EPITECH PROJECT, 2021
|
|
** Bomberman
|
|
** File description:
|
|
** Image
|
|
*/
|
|
|
|
#ifndef IMAGE_HPP_
|
|
#define IMAGE_HPP_
|
|
|
|
#include <raylib.h>
|
|
#include <string>
|
|
#include "Canvas.hpp"
|
|
#include "Texture.hpp"
|
|
#include "IRessource.hpp"
|
|
|
|
namespace RAY
|
|
{
|
|
namespace Drawables {
|
|
class ADrawable2D;
|
|
}
|
|
class IRessource;
|
|
//! @brief Object representation of a framebuffer
|
|
class Image: public Canvas, public IRessource {
|
|
public:
|
|
//! @brief Create an image, loading a file
|
|
//! @param filename: path to file to load
|
|
Image(const std::string &filename);
|
|
|
|
//! @brief Create an image, using data from a texure
|
|
//! @param texture: texture to extract data from
|
|
Image(Texture &texture);
|
|
|
|
//! @brief A default copy constructor
|
|
Image(const Image &image) = default;
|
|
|
|
//! @brief A default constructor, no ressources loaded
|
|
Image();
|
|
|
|
//! @brief An image is assignable
|
|
Image &operator=(const Image &image) = default;
|
|
|
|
//! @brief Image destructor, will unload ressources
|
|
~Image();
|
|
|
|
//! @brief load ressources from file
|
|
//! @param filename: path of input
|
|
bool load(const std::string &filename) override;
|
|
|
|
//! @brief export to file
|
|
//! @param outputPath: path of output
|
|
bool exportTo(const std::string &outputPath);
|
|
|
|
//! @brief unload ressources
|
|
bool unload() override;
|
|
|
|
//! @brief get image
|
|
operator ::Image() const;
|
|
operator ::Image *();
|
|
|
|
//! @brief draw drawable
|
|
void draw(Drawables::ADrawable2D &);
|
|
|
|
private:
|
|
//! @brief Image, really, that's just it...
|
|
::Image _image;
|
|
};
|
|
}
|
|
|
|
#endif /* !IMAGE_HPP_ */
|