NAP
Public Member Functions | Public Attributes | List of all members
BitmapFromFile Class Reference

#include <bitmap.h>

Public Member Functions

virtual bool init (utility::ErrorState &errorState) override
 
- Public Member Functions inherited from Bitmap
virtual ~Bitmap ()
 
virtual bool initFromFile (const std::string &path, nap::utility::ErrorState &errorState)
 
void initFromDescriptor (const SurfaceDescriptor &surfaceDescriptor)
 
bool save (const std::string &path, utility::ErrorState &errorState)
 
rtti::TypeInfo getColorType () const
 
bool empty () const
 
int getWidth () const
 
int getHeight () const
 
int getNumberOfChannels () const
 
void * getData ()
 
const void * getData () const
 
size_t getSizeInBytes () const
 
std::unique_ptr< BaseColormakePixel () const
 
void getPixel (int x, int y, BaseColor &outPixel) const
 
template<typename T >
getPixel (int x, int y) const
 
void setPixel (int x, int y, const BaseColor &color)
 
template<typename T >
void setPixelColor (int x, int y, const T &color)
 
template<typename Type >
void getRGBColor (int x, int y, RGBColor< Type > &outColor) const
 
template<typename Type >
RGBColor< Type > getRGBColor (int x, int y) const
 
template<typename Type >
void getRGBAColor (int x, int y, RGBAColor< Type > &outColor) const
 
template<typename Type >
RGBAColor< Type > getRGBAColor (int x, int y) const
 
template<typename Type >
void getColorValue (int x, int y, nap::EColorChannel channel, RColor< Type > &outValue) const
 
template<typename Type >
RColor< Type > getColorValue (int x, int y, nap::EColorChannel channel) const
 
- Public Member Functions inherited from Resource
 Resource ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Public Attributes

std::string mPath
 Property 'Path': the path to the image on disk. More...
 
- Public Attributes inherited from Bitmap
SurfaceDescriptor mSurfaceDescriptor
 
Signal mBitmapUpdated
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 

Description

A bitmap resource that is loaded from file There is no GPU data associated with this object, only the pixel data extracted from the image on disk. After a successful load the bitmap properties will match that of the loaded image.

Inheritance diagram for BitmapFromFile:
[legend]
Collaboration diagram for BitmapFromFile:
[legend]

Member Function Documentation

◆ init()

virtual bool init ( utility::ErrorState errorState)
overridevirtual

Loads the image pointed to by the path property Calls Bitmap::initFromFile(path, error)

Parameters
errorStatecontains the error when loading fails
Returns
if loading succeeds

Reimplemented from Bitmap.

Member Data Documentation

◆ mPath

std::string mPath

Property 'Path': the path to the image on disk.