Bomberman
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
RAY::Image Class Reference

Object representation of a framebuffer. More...

#include <Image.hpp>

Inheritance diagram for RAY::Image:
Collaboration diagram for RAY::Image:

Public Member Functions

 Image (const std::string &filename, bool lonely=false)
 Create an image, loading a file. More...
 
 Image (const Image &image)=default
 A default copy constructor. More...
 
Imageoperator= (const Image &image)=default
 An image is assignable. More...
 
 ~Image () override=default
 Image destructor, will unload ressources. More...
 
bool exportTo (const std::string &outputPath)
 export to file More...
 
void draw (Drawables::ADrawable2D &)
 draw drawable on image More...
 
void drawOn (RAY::Window &) override
 Draw image on window. More...
 
void drawOn (RAY::Image &image) override
 Draw image on another image. More...
 
void resize (const RAY::Vector2 &dimensions)
 Resize image;. More...
 
Imageuse (const std::string &filename)
 Load image from file, lets one use one entity for multiple files. More...
 
- Public Member Functions inherited from RAY::Drawables::Drawables2D::Rectangle
 Rectangle (const Vector2 &position, const Vector2 &dimensions, const Color &color=WHITE, float scale=1, float rotation=0)
 Rectangle constructor. More...
 
 Rectangle (int x, int y, int width, int height, const Color &color=WHITE)
 Rectangle constructor. More...
 
 Rectangle (const Rectangle &)=default
 A default copy constructor. More...
 
Rectangleoperator= (const Rectangle &)=default
 A rectangle is assignable. More...
 
 ~Rectangle () override=default
 A default destructor. More...
 
const Vector2getDimensions (void)
 
float getWidth (void) const
 
float getHeight (void) const
 
RectanglesetDimensions (const Vector2 &dimensions)
 set dimensions More...
 
RectangleincrementWidth (float width)
 increment width of the rectangle More...
 
RectangleincrementHeight (float height)
 increment height of the rectangle More...
 
RectanglesetHeight (float height)
 set rectangle's height More...
 
RectanglesetWidth (float width)
 set rectangle's width More...
 
RectanglesetDimensions (float x, float y)
 set dimensions More...
 
- Public Member Functions inherited from RAY::Drawables::ADrawable2D
 ADrawable2D (const Vector2 &position, const RAY::Color &color, float scale=1, float rotation=0)
 ADrawable constructor. More...
 
 ADrawable2D (int x, int y, const RAY::Color &color, float scale=1, float rotation=0)
 ADrawable constructor. More...
 
 ADrawable2D (const ADrawable2D &)=default
 A default copy constructor. More...
 
 ~ADrawable2D () override=default
 A default destructor. More...
 
const RAY::Vector2getPosition (void) const
 
const RAY::ColorgetColor (void) const
 
ADrawable2DsetPosition (const Vector2 &position)
 set Top-left position More...
 
ADrawable2DsetPosition (int x, int y)
 set Top-left position More...
 
ADrawable2DsetColor (const Color &color)
 set color More...
 
float getScale () const
 scale getter More...
 
void setScale (float scale)
 scale setters More...
 
- Public Member Functions inherited from RAY::Drawables::IDrawable
virtual ~IDrawable ()=default
 

Private Member Functions

 operator::Image * ()
 

Private Attributes

std::shared_ptr<::Image_image
 Image, really, that's just it... More...
 
std::string _ressourcePath
 
INTERNAL __pad0__: operator ::Image() const
 

Static Private Attributes

static Cache<::Image_imagesCache
 

Additional Inherited Members

- Protected Attributes inherited from RAY::Drawables::Drawables2D::Rectangle
Vector2 _dimensions
 Diemnsions of the rectangle. More...
 
INTERNAL __pad0__: operator ::Rectangle() const
 
- Protected Attributes inherited from RAY::Drawables::ADrawable2D
float _rotation = 0
 rotation More...
 
float _scale = 1
 scale More...
 
Vector2 _position
 Top-left position. More...
 
Color _color
 Color of the ADrawable. More...
 

Detailed Description

Object representation of a framebuffer.

Constructor & Destructor Documentation

◆ Image() [1/2]

RAY::Image::Image ( const std::string &  filename,
bool  lonely = false 
)

Create an image, loading a file.

Parameters
filenamepath to file to load
lonelyshould be set to true if the entity's loaded data must be independent from others

◆ Image() [2/2]

RAY::Image::Image ( const Image image)
default

A default copy constructor.

◆ ~Image()

RAY::Image::~Image ( )
overridedefault

Image destructor, will unload ressources.

Member Function Documentation

◆ draw()

void RAY::Image::draw ( Drawables::ADrawable2D drawable)

draw drawable on image

◆ drawOn() [1/2]

void RAY::Image::drawOn ( RAY::Image image)
overridevirtual

Draw image on another image.

Reimplemented from RAY::Drawables::Drawables2D::Rectangle.

◆ drawOn() [2/2]

void RAY::Image::drawOn ( RAY::Window )
overridevirtual

Draw image on window.

Reimplemented from RAY::Drawables::Drawables2D::Rectangle.

◆ exportTo()

bool RAY::Image::exportTo ( const std::string &  outputPath)

export to file

Parameters
outputPathpath of output

◆ operator::Image *()

RAY::Image::operator::Image * ( )
private

◆ operator=()

Image& RAY::Image::operator= ( const Image image)
default

An image is assignable.

◆ resize()

void RAY::Image::resize ( const RAY::Vector2 dimensions)

Resize image;.

◆ use()

Image & RAY::Image::use ( const std::string &  filename)

Load image from file, lets one use one entity for multiple files.

Member Data Documentation

◆ __pad0__

INTERNAL RAY::Image::__pad0__
private

◆ _image

std::shared_ptr<::Image> RAY::Image::_image
private

Image, really, that's just it...

◆ _imagesCache

Cache<::Image > RAY::Image::_imagesCache
staticprivate

◆ _ressourcePath

std::string RAY::Image::_ressourcePath
private

The documentation for this class was generated from the following files: