00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef IMAGE_H
00023 #define IMAGE_H
00024
00025 #include "ImageRGB.h"
00026 #include "ImageGrey.h"
00027
00028
00029 #define RED_COEF .2989961801
00030 #define GREEN_COEF .5869947588
00031 #define BLUE_COEF .1139912943
00032
00033 class Image : public ImageRGB, public ImageGrey
00041 {
00042 public:
00044 enum Type { COLOUR, GREYSCALE };
00045
00046 public:
00047
00048
00049 Image(Image&);
00050
00052 Image(unsigned int width, unsigned int height);
00053
00054 ~Image();
00055
00057 void set_rgb(unsigned int x, unsigned int y,
00058 PixelRGB& p);
00059
00061 void set_brightness(unsigned int x, unsigned int y,
00062 PixelGrey& level);
00063
00068 void get_rgb(unsigned int x, unsigned int y,
00069 PixelRGB& p);
00070
00072 void get_brightness( unsigned int x, unsigned int y,
00073 PixelGrey& p);
00074
00076 Image& clear_rgb(int = 0);
00077
00079 Image& clear_rgb(PixelRGB&);
00080
00082 Image& clear_brightness(int = 0);
00083
00085 Image& copy(Image& img);
00086
00087
00088
00089 Image& operator = (Image& img);
00090
00092 void update_brightness();
00093
00094 bool draw_line(int x_start, int y_start,
00095 int x_end, int y_end,
00096 PixelGrey intensity);
00097 bool draw_line(int x_start, int y_start,
00098 int x_end, int y_end,
00099 PixelRGB pix);
00100 bool draw_filled_circle(unsigned int centre_x,
00101 unsigned int centre_y,
00102 unsigned int radius,
00103 PixelGrey intensity);
00104 bool draw_filled_circle(unsigned int centre_x,
00105 unsigned int centre_y,
00106 unsigned int radius,
00107 PixelRGB pix);
00108 };
00109
00110 #endif // IMAGE_H