Photon 1.0.0
Loading...
Searching...
No Matches
Bitmap Class Reference

#include <Bitmap.h>

Public Member Functions

 Bitmap ()
 
 Bitmap (int width, int height, color color=white)
 
 Bitmap (string filename)
 
 Bitmap (canvas &canvas)
 
bool operator== (const Bitmap &bmp) const
 
bool operator!= (const Bitmap &bmp) const
 
 operator bool () const
 
color get_pixel (int x, int y) const
 
void set_pixel (int x, int y, color color)
 
void draw_line (int x0, int y0, int x1, int y1, color color)
 
void draw_rect (int x, int y, int width, int height, color color)
 
void fill_rect (rect rect, color color)
 
void replace_color (color original, color replacement)
 
rect find_picture (color bgcolor=white)
 
void load (string filename)
 
void save (string filename)
 

Public Attributes

int width = 0
 
int height = 0
 
vector< colordata
 

Constructor & Destructor Documentation

◆ Bitmap() [1/4]

Bitmap::Bitmap ( )
inline

◆ Bitmap() [2/4]

Bitmap::Bitmap ( int  width,
int  height,
color  color = white 
)
inline

◆ Bitmap() [3/4]

Bitmap::Bitmap ( string  filename)
inline

◆ Bitmap() [4/4]

Bitmap::Bitmap ( canvas canvas)

Member Function Documentation

◆ draw_line()

void Bitmap::draw_line ( int  x0,
int  y0,
int  x1,
int  y1,
color  color 
)

◆ draw_rect()

void Bitmap::draw_rect ( int  x,
int  y,
int  width,
int  height,
color  color 
)

◆ fill_rect()

void Bitmap::fill_rect ( rect  rect,
color  color 
)

◆ find_picture()

rect Bitmap::find_picture ( color  bgcolor = white)

◆ get_pixel()

color Bitmap::get_pixel ( int  x,
int  y 
) const

◆ load()

void Bitmap::load ( string  filename)

◆ operator bool()

Bitmap::operator bool ( ) const
inline

◆ operator!=()

bool Bitmap::operator!= ( const Bitmap bmp) const
inline

◆ operator==()

bool Bitmap::operator== ( const Bitmap bmp) const
inline

◆ replace_color()

void Bitmap::replace_color ( color  original,
color  replacement 
)

◆ save()

void Bitmap::save ( string  filename)

◆ set_pixel()

void Bitmap::set_pixel ( int  x,
int  y,
color  color 
)

Member Data Documentation

◆ data

vector<color> Bitmap::data

◆ height

int Bitmap::height = 0

◆ width

int Bitmap::width = 0

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