00001 #ifndef CIMG_SIGNAL_DRAWER_H
00002 #define CIMG_SIGNAL_DRAWER_H
00003
00004
00005 #include"cimg_tools.h"
00006
00007
00008
00009
00010
00011 struct CImgSignalDrawer ;
00012
00013
00014 struct CImgAxis
00015 {
00016 int type;
00017 double begin;
00018 double end;
00019 int nTicks_max ;
00020 int precision;
00021 double offsetVal;
00022 float opacity;
00023 const double* color;
00024
00025 CImgAxis();
00026 ~CImgAxis(){}
00027
00028 protected :
00029
00030
00031
00032 double tBegin ;
00033 double tEnd ;
00034 double tOffsetVal ;
00035
00036 CImg<double> scale;
00037 CImg<double> scaleLoc;
00038
00039 void init();
00040
00041 friend struct CImgSignalDrawer ;
00042 };
00043
00044
00045
00046 struct CImgErrorBar
00047 {
00048 const double* color ;
00049 int end;
00050
00051 CImgErrorBar();
00052 ~CImgErrorBar(){}}
00053 ;
00054
00055
00056
00057 struct CImgSignalDrawer
00058 {
00059
00060 int style;
00061 int width;
00062 int border;
00063 double opacity;
00064 bool draw_axis;
00065
00066
00067 CImgAxis axisX, axisY;
00068
00069
00070 CImgErrorBar errorBar;
00071
00072 CImgSignalDrawer();
00073 ~CImgSignalDrawer(){}
00074
00075
00076
00077
00078
00079
00080
00081
00082 void draw( CImg<double> &figure, CImg<double> &values, const double* color=orange, CImg<double>* abscissas=0, CImg<double>* errorBars_v=0 , CImg<double>* errorBars_h=0 );
00083
00084
00085
00086 void draw( CImg<double> &figure, CImg<double> &values, const double* color, double tmin, double tmax, CImg<double>* errorBars_v=0 , CImg<double>* errorBars_h=0 );
00087
00088
00089
00090 void draw( CImg<double> &figure, const char *signal, const double* color );
00091
00092
00093
00094
00095 void draw( CImg<double> &figure, CImgList<double> &values, int startColor=0, CImg<double>* abscissas=0 );
00096
00097 void draw( CImg<double> &figure, CImgList<double> &values, int startColor, double tmin, double tmax );
00098
00099
00100 protected:
00101
00102 void draw_errorBar (CImg<double> &figure, int x_cen, int y_cen, double length, bool horizontal= false ) ;
00103
00104
00105
00106
00107 void draw_axisX (CImg<double> &figure, CImg<double>& tickValues, CImg<double>& tickLocations, int y ) ;
00108 void draw_axisY (CImg<double> &figure, CImg<double>& tickValues, CImg<double>& tickLocations, int x ) ;
00109 };
00110
00111 #endif
00112
00113
00114