src/imagecreator.h

00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Lynn Hazan                                      *
00003  *   lynn@myrealbox.com                                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef IMAGECREATOR_H
00021 #define IMAGECREATOR_H
00022 
00023 // include files for Qt
00024 #include <qwidget.h>
00025 #include <qpixmap.h>
00026 #include <qimage.h>
00027 #include <qpainter.h>
00028 
00029 // application specific includes
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

Generated on Mon Sep 17 20:47:30 2007 for NeuroScope by  doxygen 1.5.1