• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kstars

fitsviewer.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           FITSViewer.cpp  -  A FITSViewer for KStars
00003                              -------------------
00004     begin                : Thu Jan 22 2004
00005     copyright            : (C) 2004 by Jasem Mutlaq
00006     email                : mutlaqja@ikarustech.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  *   Some code fragments were adapted from Peter Kirchgessner's FITS plugin*
00017  *   See http://members.aol.com/pkirchg for more details.                  *
00018  ***************************************************************************/
00019 
00020 #ifndef FITSViewer_H
00021 #define FITSViewer_H
00022 
00023 #include <qwidget.h>
00024 #include <qstring.h>
00025 #include <qimage.h>
00026 #include <qpixmap.h>
00027 #include <qframe.h>
00028 #include <qrect.h> 
00029 #include <qptrlist.h>
00030 #include <qstringlist.h>
00031 #include <qscrollview.h>
00032 
00033 #include <kpixmapio.h>
00034 #include <kpixmap.h>
00035 #include <kdialog.h>
00036 #include <kmainwindow.h>
00037 #include <kurl.h>
00038 #include <kcommand.h>
00039 
00040 #include "indi/fitsrw.h"
00041 
00042 class KCommandHistory;
00043 class ContrastBrightnessDlg;
00044 class QScrollView;
00045 class FITSImage;
00046 class FITSHistogram;
00047 
00048 class FITSViewer : public KMainWindow  {
00049     Q_OBJECT
00050 
00051     public:
00052     
00053     friend class ContrastBrightnessDlg;
00054     friend class FITSChangeCommand;
00055     friend class FITSProcess;
00056     friend class FITSImage;
00057     friend class FITSHistogram;
00058     friend class FITSHistogramCommand;
00059     friend class FITSProcessCommand;
00060     
00062     FITSViewer (const KURL *imageName, QWidget *parent, const char *name = 0);
00063     ~FITSViewer();
00064 
00065     
00066     
00067     enum undoTypes { CONTRAST_BRIGHTNESS, IMAGE_REDUCTION, IMAGE_FILTER };
00068             
00069     protected:
00070     /* key press event */
00071     void keyPressEvent (QKeyEvent *ev);
00072     /* Calculate stats */
00073     void calculateStats();
00074     void closeEvent(QCloseEvent *ev);
00075     
00076     public slots:
00077     void fitsChange();
00078     
00079     private slots:
00080     void fileOpen();
00081     void fileSave();
00082         void fileSaveAs();
00083     void fitsCOPY();
00084     void fitsRestore();
00085     void fitsStatistics();
00086     void fitsHeader();
00087     void slotClose();
00088     void imageReduction();
00089     void imageHistogram();
00090     void BrightContrastDlg();
00091     void updateImgBuffer();
00092     
00093     private:
00094     //int  loadImage(unsigned int *buffer, bool displayImage = false);
00095     float * loadData(const char * filename, float *buffer);
00096     bool    initFITS();
00097     void show_fits_errors();
00098 
00099     double average();
00100     double min(int & minIndex);
00101     double max(int & maxIndex);
00102     double stddev();
00103 
00104     FITSImage *image;                   /* FITS image object */
00105     int Dirty;                      /* Document modified? */
00106     KURL currentURL;                    /* FITS File name and path */
00107     float *imgBuffer;                   /* Main unmodified FITS data buffer */
00108     KCommandHistory *history;               /* History for undo/redo */
00109     QStringList record;                 /* FITS records */
00110     FITSHistogram *histo;
00111     
00112     /* stats struct to hold statisical data about the FITS data */
00113     struct {
00114         double min, max;
00115         int minAt, maxAt;
00116         double average;
00117         double stddev;
00118         int bitpix, width, height;
00119     } stats;
00120         
00121         
00122 };
00123 
00124 class FITSChangeCommand : public KCommand
00125 {
00126   public:
00127         FITSChangeCommand(QWidget * parent, int inType, QImage *newIMG, QImage *oldIMG);
00128     ~FITSChangeCommand();
00129             
00130         void execute();
00131         void unexecute();
00132         QString name() const;
00133 
00134     private:
00135         int type;
00136     
00137     protected:
00138         FITSViewer *viewer;
00139         QImage *newImage;
00140     QImage *oldImage;
00141 };
00142 
00143 
00144 #endif

kstars

Skip menu "kstars"
  • Main Page
  • Modules
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • keduca
  • kstars
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal