• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
  • fitsviewer
fitsview.h
Go to the documentation of this file.
1 /***************************************************************************
2  FITSView.cpp - FITS Image
3  -------------------
4  begin : Tue Feb 24 2004
5  copyright : (C) 2004 by Jasem Mutlaq
6  email : mutlaqja@ikarustech.com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  * Some code fragments were adapted from Peter Kirchgessner's FITS plugin*
17  * See http://members.aol.com/pkirchg for more details. *
18  ***************************************************************************/
19 
20 #ifndef FITSView_H_
21 #define FITSView_H_
22 
23 #include <QFrame>
24 #include <QImage>
25 #include <QPixmap>
26 #include <QMouseEvent>
27 #include <QResizeEvent>
28 #include <QPaintEvent>
29 #include <QScrollArea>
30 #include <QLabel>
31 
32 #include <kxmlguiwindow.h>
33 #include <kurl.h>
34 
35 #ifdef WIN32
36 // avoid compiler warning when windows.h is included after fitsio.h
37 #include <windows.h>
38 #endif
39 
40 #include <fitsio.h>
41 #include "fitshistogram.h"
42 #include "fitscommon.h"
43 
44 #include "dms.h"
45 #include "fitsimage.h"
46 
47 #define INITIAL_W 640
48 #define INITIAL_H 480
49 
50 #define MINIMUM_PIXEL_RANGE 5
51 #define MINIMUM_STDVAR 5
52 
53 class FITSView;
54 
55 
56 class FITSLabel : public QLabel
57 {
58  Q_OBJECT
59 public:
60  explicit FITSLabel(FITSView *img, QWidget *parent=NULL);
61  virtual ~FITSLabel();
62  void setSize(double w, double h);
63 
64 protected:
65  virtual void mouseMoveEvent(QMouseEvent *e);
66  virtual void mousePressEvent(QMouseEvent *e);
67 
68 private:
69  FITSView *image;
70  dms ra;
71  dms dec;
72  double width,height,size;
73 
74 signals:
75  void newStatus(const QString &msg, FITSBar id);
76  void pointSelected(int x, int y);
77 
78 
79 };
80 
81 class FITSView : public QScrollArea
82 {
83  Q_OBJECT
84 public:
85  FITSView(QWidget *parent = 0, FITSMode mode=FITS_NORMAL);
86  ~FITSView();
87 
88  /* Loads FITS image, scales it, and displays it in the GUI */
89  bool loadFITS(const QString &filename);
90  /* Save FITS */
91  int saveFITS(const QString &filename);
92  /* Rescale image lineary from image_buffer, fit to window if desired */
93  int rescale(FITSZoom type);
94 
95  void setImageData(FITSImage *d) { image_data = d; }
96 
97  // Access functions
98  FITSImage *getImageData() { return image_data; }
99  double getCurrentZoom() { return currentZoom; }
100  QImage * getDisplayImage() { return display_image; }
101  FITSMode getMode() { return mode;}
102 
103  void setGuideBoxSize(int size);
104  void setGuideSquare(int x, int y);
105 
106  // Overlay
107  void drawOverlay(QPainter *);
108  void drawStarCentroid(QPainter *);
109  void drawGuideBox(QPainter *);
110  void updateFrame();
111 
112  // Star Detection
113  void toggleStars(bool enable);
114 
115 
116 public slots:
117  void ZoomIn();
118  void ZoomOut();
119  void ZoomDefault();
120 
121  void processPointSelection(int x, int y);
122 
123 private:
124 
125  double average();
126  double stddev();
127 
128  bool markStars;
129  FITSLabel *image_frame;
130  FITSImage *image_data;
131  int image_width, image_height;
132  double currentWidth,currentHeight; /* Current width and height due to zoom */
133  const double zoomFactor; /* Image zoom factor */
134  double currentZoom; /* Current Zoom level */
135  int data_type; /* FITS data type when opened */
136  QImage *display_image; /* FITS image that is displayed in the GUI */
137  FITSHistogram *histogram;
138  int guide_x, guide_y, guide_box;
139  bool firstLoad;
140  bool starsSearched;
141  bool hasWCS;
142  QString filename;
143  FITSMode mode;
144 
145 signals:
146  void newStatus(const QString &msg, FITSBar id);
147  void actionUpdated(const QString &name, bool enable);
148  void guideStarSelected(int x, int y);
149 
150  friend class FITSLabel;
151 };
152 
153 #endif
FITSView::getImageData
FITSImage * getImageData()
Definition: fitsview.h:98
fitsimage.h
FITSView::setGuideSquare
void setGuideSquare(int x, int y)
Definition: fitsview.cpp:442
FITSView::loadFITS
bool loadFITS(const QString &filename)
Definition: fitsview.cpp:162
FITSImage
Definition: fitsimage.h:73
FITSView::processPointSelection
void processPointSelection(int x, int y)
Definition: fitsview.cpp:470
FITSLabel::~FITSLabel
virtual ~FITSLabel()
Definition: fitsview.cpp:69
QWidget
FITSLabel::mousePressEvent
virtual void mousePressEvent(QMouseEvent *e)
Definition: fitsview.cpp:115
FITSLabel::setSize
void setSize(double w, double h)
Definition: fitsview.cpp:62
FITSView::guideStarSelected
void guideStarSelected(int x, int y)
FITS_NORMAL
Definition: fitscommon.h:20
FITSView
Definition: fitsview.h:81
FITSView::drawOverlay
void drawOverlay(QPainter *)
Definition: fitsview.cpp:396
QScrollArea
FITSView::setImageData
void setImageData(FITSImage *d)
Definition: fitsview.h:95
FITSView::rescale
int rescale(FITSZoom type)
Definition: fitsview.cpp:222
FITSView::getCurrentZoom
double getCurrentZoom()
Definition: fitsview.h:99
FITSView::newStatus
void newStatus(const QString &msg, FITSBar id)
FITSLabel::pointSelected
void pointSelected(int x, int y)
FITSView::saveFITS
int saveFITS(const QString &filename)
Definition: fitsview.cpp:216
dms.h
FITSView::~FITSView
~FITSView()
Definition: fitsview.cpp:156
FITSLabel::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *e)
Definition: fitsview.cpp:71
fitshistogram.h
FITSView::getDisplayImage
QImage * getDisplayImage()
Definition: fitsview.h:100
fitscommon.h
FITSView::toggleStars
void toggleStars(bool enable)
Definition: fitsview.cpp:458
FITSView::drawStarCentroid
void drawStarCentroid(QPainter *)
Definition: fitsview.cpp:406
FITSView::ZoomDefault
void ZoomDefault()
Definition: fitsview.cpp:378
dms
An angle, stored as degrees, but expressible in many ways.
Definition: dms.h:42
FITSView::drawGuideBox
void drawGuideBox(QPainter *)
Definition: fitsview.cpp:426
FITSView::ZoomOut
void ZoomOut()
Definition: fitsview.cpp:331
FITSHistogram
Definition: fitshistogram.h:48
FITSLabel::FITSLabel
FITSLabel(FITSView *img, QWidget *parent=NULL)
Definition: fitsview.cpp:56
NaN::d
const double d
Definition: nan.h:35
QLabel
FITSBar
FITSBar
Definition: fitscommon.h:21
FITSView::FITSView
FITSView(QWidget *parent=0, FITSMode mode=FITS_NORMAL)
Definition: fitsview.cpp:129
FITSView::updateFrame
void updateFrame()
Definition: fitsview.cpp:352
FITSView::actionUpdated
void actionUpdated(const QString &name, bool enable)
FITSLabel
Definition: fitsview.h:56
FITSView::setGuideBoxSize
void setGuideBoxSize(int size)
Definition: fitsview.cpp:452
FITSView::ZoomIn
void ZoomIn()
Definition: fitsview.cpp:309
FITSZoom
FITSZoom
Definition: fitscommon.h:23
FITSView::getMode
FITSMode getMode()
Definition: fitsview.h:101
FITSMode
FITSMode
Definition: fitscommon.h:20
FITSLabel::newStatus
void newStatus(const QString &msg, FITSBar id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal