Otclient 1.0  14/8/2020
Image Class Reference

#include <image.h>

Inheritance diagram for Image:
Collaboration diagram for Image:

Public Member Functions

 Image (const Size &size, int bpp=4, uint8 *pixels=nullptr)
 
void savePNG (const std::string &fileName)
 
void overwriteMask (const Color &maskedColor, const Color &insideColor=Color::white, const Color &outsideColor=Color::alpha)
 
void blit (const Point &dest, const ImagePtr &other)
 
void paste (const ImagePtr &other)
 
void resize (const Size &size)
 
bool nextMipmap ()
 
void setPixel (int x, int y, uint8 *pixel)
 
void setPixel (int x, int y, const Color &color)
 
std::vector< uint8 > & getPixels ()
 
uint8getPixelData ()
 
int getPixelCount ()
 
const SizegetSize ()
 
int getWidth ()
 
int getHeight ()
 
int getBpp ()
 
uint8getPixel (int x, int y)
 
bool hasTransparentPixel () const
 
void setTransparentPixel (const bool value)
 
- Public Member Functions inherited from stdext::shared_object
 shared_object ()
 
virtual ~shared_object ()
 
void add_ref ()
 
void dec_ref ()
 
refcount_t ref_count ()
 
template<typename T >
stdext::shared_object_ptr< T > static_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > dynamic_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > const_self_cast ()
 

Static Public Member Functions

static ImagePtr load (std::string file)
 
static ImagePtr loadPNG (const std::string &file)
 

Detailed Description

Definition at line 29 of file image.h.

Constructor & Destructor Documentation

◆ Image()

Image::Image ( const Size size,
int  bpp = 4,
uint8 pixels = nullptr 
)

Definition at line 30 of file image.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ blit()

void Image::blit ( const Point dest,
const ImagePtr other 
)

Definition at line 102 of file image.cpp.

Here is the call graph for this function:

◆ getBpp()

int Image::getBpp ( )
inline

Definition at line 54 of file image.h.

◆ getHeight()

int Image::getHeight ( )
inline

Definition at line 53 of file image.h.

Here is the call graph for this function:

◆ getPixel()

uint8* Image::getPixel ( int  x,
int  y 
)
inline

Definition at line 55 of file image.h.

Here is the call graph for this function:

◆ getPixelCount()

int Image::getPixelCount ( )
inline

Definition at line 50 of file image.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPixelData()

uint8* Image::getPixelData ( )
inline

Definition at line 49 of file image.h.

Here is the caller graph for this function:

◆ getPixels()

std::vector<uint8>& Image::getPixels ( )
inline

Definition at line 48 of file image.h.

◆ getSize()

const Size& Image::getSize ( )
inline

Definition at line 51 of file image.h.

◆ getWidth()

int Image::getWidth ( )
inline

Definition at line 52 of file image.h.

Here is the call graph for this function:

◆ hasTransparentPixel()

bool Image::hasTransparentPixel ( ) const
inline

Definition at line 56 of file image.h.

◆ load()

ImagePtr Image::load ( std::string  file)
static

Definition at line 40 of file image.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadPNG()

ImagePtr Image::loadPNG ( const std::string &  file)
static

Definition at line 55 of file image.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nextMipmap()

bool Image::nextMipmap ( )

Definition at line 147 of file image.cpp.

Here is the call graph for this function:

◆ overwriteMask()

void Image::overwriteMask ( const Color maskedColor,
const Color insideColor = Color::white,
const Color outsideColor = Color::alpha 
)

Definition at line 82 of file image.cpp.

Here is the call graph for this function:

◆ paste()

void Image::paste ( const ImagePtr other)

Definition at line 127 of file image.cpp.

Here is the call graph for this function:

◆ resize()

void Image::resize ( const Size size)
inline

Definition at line 42 of file image.h.

Here is the call graph for this function:

◆ savePNG()

void Image::savePNG ( const std::string &  fileName)

Definition at line 68 of file image.cpp.

Here is the call graph for this function:

◆ setPixel() [1/2]

void Image::setPixel ( int  x,
int  y,
const Color color 
)
inline

Definition at line 46 of file image.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPixel() [2/2]

void Image::setPixel ( int  x,
int  y,
uint8 pixel 
)
inline

Definition at line 45 of file image.h.

Here is the call graph for this function:

◆ setTransparentPixel()

void Image::setTransparentPixel ( const bool  value)
inline

Definition at line 57 of file image.h.


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