kstars
fitsimage.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef FITSIMAGE_H
00021 #define FITSIMAGE_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 <qscrollview.h>
00031
00032 #include <kpixmapio.h>
00033 #include <kpixmap.h>
00034 #include <kdialog.h>
00035 #include <kmainwindow.h>
00036 #include <kurl.h>
00037
00038 #include "indi/fitsrw.h"
00039
00040 class KCommandHistory;
00041 class QScrollView;
00042 class FITSViewer;
00043 class FITSFrame;
00044
00045 class FITSImage : public QScrollView {
00046 Q_OBJECT
00047
00048 public:
00049
00050 friend class ContrastBrightnessDlg;
00051 friend class FITSProcess;
00052 friend class FITSFrame;
00053 friend class FITSViewer;
00054 friend class FITSHistogram;
00055 friend class FITSHistogramCommand;
00056 friend class FITSChangeCommand;
00057 friend class FITSProcessCommand;
00058
00059 FITSImage(QWidget * parent, const char * name = 0);
00060 ~FITSImage();
00061
00062 enum scaleType { FITSAuto = 0 , FITSLinear, FITSLog, FITSSqrt, FITSCustom };
00063
00065
00066
00067 void resizeEvent (QResizeEvent *ev);
00068
00069 int loadFits(const char *filename);
00070
00071 void convertImageToPixmap();
00072
00073 void clearMem();
00074
00075 private:
00076 FITSViewer *viewer;
00077 FITSFrame *imgFrame;
00078 QImage *displayImage;
00079 QImage *templateImage;
00080 QPixmap qpix;
00081 KPixmapIO kpix;
00082 QRect currentRect;
00083 int bitpix, bpp;
00084 int width, height;
00085 double currentWidth,currentHeight;
00086 const double zoomFactor;
00087 double currentZoom;
00088 QRgb *grayTable;
00089 unsigned char *reducedImgBuffer;
00090
00091
00092 void saveTemplateImage();
00093 void reLoadTemplateImage();
00094 void destroyTemplateImage();
00095 void zoomToCurrent();
00096
00097 protected:
00098
00099 void contentsMouseMoveEvent ( QMouseEvent * e );
00100 void viewportResizeEvent ( QResizeEvent * e) ;
00101
00102 public slots:
00103 void fitsZoomIn();
00104 void fitsZoomOut();
00105 void fitsZoomDefault();
00106 };
00107
00108 class FITSFrame : public QFrame
00109 {
00110 Q_OBJECT
00111
00112 public:
00113 FITSFrame(FITSImage * img, QWidget * parent = 0, const char * name = 0);
00114 ~FITSFrame();
00115
00116 private:
00117 FITSImage *image;
00118
00119 protected:
00120 void paintEvent( QPaintEvent * e);
00121
00122 };
00123
00124 #endif