00001 #ifndef _VUSPECTRALIMAGE_H_
00002 #define _VUSPECTRALIMAGE_H_
00003
00004 #include "vuImage.h"
00005 #include "vuColour7a.h"
00006 #include "vuColourRGBa.h"
00007
00015 class vuSpectralImage
00016 {
00017 public:
00019 vuSpectralImage();
00021 virtual ~vuSpectralImage();
00023 const vuColour7a& get_light() const;
00026 bool get_xy(int x, int y, vuColour7a & col) const {
00027 col = spix[x+maxx*y];
00028 return true;
00029 }
00030
00032 float* get_xy_data(int x, int y) {
00033 return spix[x+maxx*y].getData();
00034 }
00036 void get_extents(int & sizx, int & sizy);
00039 bool init(int sizx, int sizy);
00042 void set_light(vuColour7a light);
00050 bool get_rgb(byte *buf, int size) const;
00052 bool getRGBImage(vuImage& img) const;
00053
00055 bool set_xy(int x, int y, const vuColour7a col) {
00056 if(x<0 || y<0 || x>=maxx || y>=maxy) return false;
00057 spix[x+maxx*y] = col;
00058 return true;
00059 }
00061 void set_mask(bool value=true);
00063 void create_black_mask();
00064 private:
00066 vuColour7a light;
00068 vuColour7a *spix;
00070 bool *mask;
00072 int maxx,maxy;
00073 };
00074
00075 #endif