00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 #ifndef IMAGECREATOR_H
00021 #define IMAGECREATOR_H
00022 
00023 
00024 #include <qwidget.h>
00025 #include <qpixmap.h>
00026 #include <qimage.h>
00027 #include <qpainter.h>
00028 
00029 
00030 #include "positionsprovider.h"
00031 #include <types.h>
00032 
00033 
00039 class ImageCreator : public QWidget
00040 {
00041 Q_OBJECT
00042 public:
00052     ImageCreator(PositionsProvider& provider,int width,int height,QString backgroundImage="",QColor backgroundColor = Qt::black,QColor foregroundColor = "#BFBFBF");
00053     ~ImageCreator();
00054 
00056    QImage createImage();
00057    
00062    void saveImage(QString fileName,QString format = "PNG");
00063     
00064 public slots:     
00065 
00071    void dataAvailable(Array<dataType>& data,QObject* initiator);   
00072    
00073 private:
00074 
00076   PositionsProvider& positionsProvider;
00077 
00079   int width;
00080   
00082   int height;
00083   
00085   QString backgroundImage;
00086    
00088   QColor backgroundColor;
00089   
00091   QColor foregroundColor;     
00092  
00096   Array<dataType> data;
00097   
00099   int nbSpots;
00100   
00102   QImage image;
00103   
00105   
00110   void drawPositions(QPainter& painter);    
00111 };
00112 
00113 #endif