32 #ifndef PLANCK_LS_IMAGE_H 33 #define PLANCK_LS_IMAGE_H 53 void add (
float f,
const Colour &c)
55 void addb (uint8 f, uint8 r,uint8 g, uint8 b)
56 { addVal (f/255., Colour(r/255.,g/255.,b/255.)); }
62 {
return getVal_const(f); }
68 void import (
const Colour &col)
71 r = uint8(max(0,min(255,
int(col.r*256))));
72 g = uint8(max(0,min(255,
int(col.g*256))));
73 b = uint8(max(0,min(255,
int(col.b*256))));
80 Colour8 (uint8 R, uint8 G, uint8 B)
82 Colour8 (
const Colour &col)
84 const Colour8 &operator= (
const Colour &col)
85 {
import (col);
return *
this; }
86 bool operator== (
const Colour8 &that)
87 {
return (r == that.r) && (g == that.g) && (b == that.b); }
88 bool operator!= (
const Colour8 &that)
89 {
return (r != that.r) || (g != that.g) || (b != that.b); }
95 int offset, num_chars, xpix, ypix;
99 extern const MP_Font medium_bold_font;
100 extern const MP_Font giant_font;
109 void write_char (
int xpos,
int ypos,
const Colour &col,
char c,
123 void set_font (
const MP_Font &fnt);
127 void annotate (
int xpos,
int ypos,
const Colour &col,
128 const std::string &text,
int scale=1);
131 void annotate_centered (
int xpos,
int ypos,
const Colour &col,
132 const std::string &text,
int scale=1);
143 return ((i<pixel.
size1()) && (j<pixel.
size2())) ?
144 pixel[i][j] : Colour8(0, 0, 0);
148 void write_TGA (
const std::string &file)
const;
151 void write_TGA_rle (
const std::string &file)
const;
154 void write_PPM (
const std::string &file)
const;
Colour8 get_pixel(tsize i, tsize j)
void put_pixel(tsize i, tsize j, const Colour &col)
void add(float f, const Colour &c)
void fill(const Colour &col)
Colour Get_Colour(float f) const
void setPredefined(int num)