Lysa  0.0
Lysa 3D Engine
Image Class Reference

Detailed Description

A bitmap resource, stored in GPU memory.

+ Inheritance diagram for Image:

Public Member Functions

 Image (const std::shared_ptr< vireo::Image > &image, const std::string &name)
 
auto getWidth () const
 
auto getHeight () const
 
auto getSize () const
 
auto getImage () const
 
auto getIndex () const
 
void save (const std::string &filepath) const
 
 ~Image () override = default
 
- Public Member Functions inherited from Resource
 Resource (const std::string &name)
 
auto getId () const
 
const auto & getName () const
 
bool operator== (const Resource &other) const
 
bool operator< (const Resource &other) const
 
bool operator> (const Resource &other) const
 
virtual std::shared_ptr< Resource > duplicate () const
 
- Public Member Functions inherited from Object
void connect (const Signal::signal &name, const Signal::Handler &handler)
 
void connect (const Signal::signal &name, const std::function< void ()> &handler)
 
void emit (const Signal::signal &name, void *params=nullptr)
 
virtual std::string toString () const
 
 Object () = default
 
virtual ~Object () = default
 

Static Public Member Functions

static void save (const std::string &filepath, const std::shared_ptr< vireo::Image > &image)
 
static std::shared_ptr< Image > load (const std::string &filepath, vireo::ImageFormat imageFormat=vireo::ImageFormat::R8G8B8A8_SRGB)
 
static std::shared_ptr< Image > create (const void *data, uint32 width, uint32 height, vireo::ImageFormat imageFormat=vireo::ImageFormat::R8G8B8A8_SRGB, const std::string &name="Image")
 

Protected Attributes

std::shared_ptr< vireo::Image > image
 
uint32 index
 

Constructor & Destructor Documentation

Image ( const std::shared_ptr< vireo::Image > &  image,
const std::string &  name 
)
~Image ( )
overridedefault

Member Function Documentation

static std::shared_ptr<Image> create ( const void *  data,
uint32  width,
uint32  height,
vireo::ImageFormat  imageFormat = vireo::ImageFormat::R8G8B8A8_SRGB,
const std::string &  name = "Image" 
)
static

Load a bitmap from memory.
Supports JPEG & PNG formats.

auto getHeight ( ) const
inline

Returns the height in pixels

auto getImage ( ) const
inline
auto getIndex ( ) const
inline
auto getSize ( ) const
inline

Returns the size in pixels

auto getWidth ( ) const
inline

Returns the width in pixels

static std::shared_ptr<Image> load ( const std::string &  filepath,
vireo::ImageFormat  imageFormat = vireo::ImageFormat::R8G8B8A8_SRGB 
)
static

Load a bitmap from a file.
Supports JPEG and PNG formats

void save ( const std::string &  filepath) const
static void save ( const std::string &  filepath,
const std::shared_ptr< vireo::Image > &  image 
)
static

Member Data Documentation

std::shared_ptr<vireo::Image> image
protected
uint32 index
protected