DummyGraphics.hpp

00001 // This file is part of the imaging2 class library.
00002 //
00003 // University of Innsbruck, Infmath Imaging, 2009.
00004 // http://infmath.uibk.ac.at
00005 //
00006 // All rights reserved.
00007 
00008 
00009 #ifndef GRAPHICS_DUMMYGRAPHICS_H
00010 #define GRAPHICS_DUMMYGRAPHICS_H
00011 
00012 #include <graphics/GraphicsInterface.hpp>
00013 #include <image/Color.hpp>
00014 #include <image/Image.hpp>
00015 
00016 namespace imaging
00017 {
00021   class DummyGraphics : public GraphicsInterface
00022   {
00023     static const StreamStatus stream_status;
00024     
00025   public:
00027     static DummyGraphics out;
00028 
00030     enum image_formats { 
00031       IMAGE_FORMAT_EPS , 
00032       IMAGE_FORMAT_SVG ,
00033       IMAGE_FORMAT_PDF ,
00034       IMAGE_FORMAT_DETERMINE ,
00036       IMAGE_FORMAT_CAN_NOT_DETERMINE
00038     };
00039     
00040     static const size_t STD_WINDOW_SIZE = 400;
00041 
00042     DummyGraphics() {}
00043     
00044     virtual ~DummyGraphics() {}
00045 
00047     virtual void init(int argc, char** argv,
00048                                const ublas::fixed_vector<float_t, 2> & lower_left,
00049                                const ublas::fixed_vector<float_t, 2> & upper_right,
00050                                const size_t window_width = STD_WINDOW_SIZE,
00051                                const size_t window_height = STD_WINDOW_SIZE) {}
00052      
00053     virtual void clear() {}
00054                               
00055     virtual void set_coordinates(const ublas::fixed_vector<float_t, 2> & lower_left, const ublas::fixed_vector<float_t, 2> & upper_right) {}
00056 
00057     virtual void circle(const ublas::fixed_vector<float_t, 2> & center, float_t radius) {}
00058 
00059     virtual void polygon(const std::vector< ublas::fixed_vector<float_t, 2> > & vertices) {}
00060     
00061     virtual void fill_polygon(const std::vector< ublas::fixed_vector<float_t, 2> > & vertices) {}
00062     
00063     virtual void polyline(const std::vector< ublas::fixed_vector<float_t, 2> > & vertices) {}
00064     
00065     virtual void vertex(const ublas::fixed_vector<float_t, 2> & vertex) {}
00066     
00067     virtual void image(const ColorImage2d & image, const ublas::fixed_vector<float_t, 2> x_interval, const ublas::fixed_vector<float_t, 2> y_interval) {}
00068     
00069     virtual void spline_curve(const Bspline< ublas::fixed_vector<float_t, 2> > & spline_curve) {}
00070 
00071     virtual GraphicsInterface & operator<<(const CommandInterface & command) { return *this; }
00072     
00073     virtual GraphicsInterface & operator<<(const StreamStatus & status) { return *this; }
00074 
00075     virtual const StreamStatus & get_stream_status() { return stream_status; }
00076 
00078     virtual void  write_image(const std::string & file_name,
00079                       const int image_format = IMAGE_FORMAT_DETERMINE) {}
00080 
00082     virtual void  write_image(const std::string & file_name, size_t width, size_t height,
00083                       const int image_format = IMAGE_FORMAT_DETERMINE) {}
00084   };
00085 }
00086 
00087 #endif

Generated on Tue Feb 10 10:01:30 2009 for imaging2 by  doxygen 1.5.5