Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

Image.h

Go to the documentation of this file.
00001 /*************************************************************************
00008  *
00009  * Source code for Real Time Image Library (libRTImage) 
00010  *
00011  * Leeds Vision Group give permission for this code to be copied, modified 
00012  * and distributed within the University of Leeds subject to the following
00013  * conditions:-
00014  *
00015  * - The code is not to be used for commercial gain.
00016  * - The code and use thereof will be attributed to the authors where
00017  *   appropriate (including demonstrations which rely on it's use).
00018  * - All modified, distributions of the source files will retain this header.
00019  *
00020  ****************************************************************************/
00021 
00022 #ifndef IMAGE_H
00023 #define IMAGE_H
00024 
00025 #include "ImageRGB.h"
00026 #include "ImageGrey.h"
00027 
00028 /* Define Coefficients for RGB to Brightness relationship */
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 /* Public Methods */
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         /* Operator overloading */
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

Generated at Fri Aug 13 17:29:21 2004 for libRTImage by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001