LevelS C++ support library
3.83
|
#include <ls_image.h>
Public Member Functions | |
LS_Image (int xres, int yres) | |
void | fill (const Colour &col) |
void | set_font (const MP_Font &fnt) |
void | annotate (int xpos, int ypos, const Colour &col, const std::string &text, int scale=1) |
void | annotate_centered (int xpos, int ypos, const Colour &col, const std::string &text, int scale=1) |
void | put_pixel (tsize i, tsize j, const Colour &col) |
Colour8 | get_pixel (tsize i, tsize j) |
void | write_TGA (const std::string &file) const |
void | write_TGA_rle (const std::string &file) const |
void | write_PPM (const std::string &file) const |
Class for creating and storing image files.
Definition at line 103 of file ls_image.h.
LS_Image::LS_Image | ( | int | xres, |
int | yres | ||
) |
Creates an image object with a resolution of xres by yres.
Definition at line 134 of file ls_image.cc.
|
inline |
Fills the entire image with colour col.
Definition at line 121 of file ls_image.h.
void LS_Image::set_font | ( | const MP_Font & | fnt | ) |
Sets the font used for annotations to fnt.
Definition at line 152 of file ls_image.cc.
void LS_Image::annotate | ( | int | xpos, |
int | ypos, | ||
const Colour & | col, | ||
const std::string & | text, | ||
int | scale = 1 |
||
) |
Outputs the string text in colour col. xpos, ypos is the lower left corner; the font is scaled by scale.
Definition at line 137 of file ls_image.cc.
void LS_Image::annotate_centered | ( | int | xpos, |
int | ypos, | ||
const Colour & | col, | ||
const std::string & | text, | ||
int | scale = 1 |
||
) |
Outputs the string text centered at position xpos, ypos in colour col. The font is scaled by scale.
Definition at line 144 of file ls_image.cc.
Sets the pixel i, j, to the colour col.
Definition at line 134 of file ls_image.h.
Returns the colour of the pixel i, j, or black if the pixel lies outside of the image.
Definition at line 141 of file ls_image.h.
void LS_Image::write_TGA | ( | const std::string & | file | ) | const |
Writes the image to file in uncompressed TGA format.
Definition at line 155 of file ls_image.cc.
void LS_Image::write_TGA_rle | ( | const std::string & | file | ) | const |
Writes the image to file in run-length encoded TGA format.
Definition at line 215 of file ls_image.cc.
void LS_Image::write_PPM | ( | const std::string & | file | ) | const |
Writes the image to file in binary PPM format.
Definition at line 265 of file ls_image.cc.