Kstars
10 #include "fitscommon.h"
12 #include <config-kstars.h>
15 #ifdef HAVE_DATAVISUALIZATION
16 #include "starprofileviewer.h"
19 #include <QFutureWatcher>
21 #include <QScrollArea>
53 explicit FITSView(
QWidget *parent =
nullptr, FITSMode fitsMode = FITS_NORMAL, FITSScale filterType = FITS_NONE);
54 virtual ~FITSView()
override;
56 typedef enum {dragCursor, selectCursor, scopeCursor, crosshairCursor } CursorMode;
64 void loadFile(
const QString &inFilename);
78 bool saveImage(
const QString &newFilename);
80 bool rescale(FITSZoom type);
87 double getCurrentZoom()
const
91 const QImage &getDisplayImage()
const
95 const QPixmap &getDisplayPixmap()
const
101 void setTrackingBoxEnabled(
bool enable);
102 bool isTrackingBoxEnabled()
const
104 return trackingBoxEnabled;
106 QPixmap &getTrackingBoxPixmap(uint8_t margin = 0);
107 void setTrackingBox(
const QRect &rect);
108 const QRect &getTrackingBox()
const
114 const QString &lastError()
const
120 virtual void drawOverlay(
QPainter *,
double scale);
123 void drawStarFilter(
QPainter *,
double scale);
124 void drawStarCentroid(
QPainter *,
double scale);
126 void drawTrackingBox(
QPainter *,
double scale);
127 void drawMarker(
QPainter *,
double scale);
128 void drawCrosshair(
QPainter *,
double scale);
130 #if !defined(KSTARS_LITE) && defined(HAVE_WCSLIB)
131 void drawEQGrid(
QPainter *,
double scale);
133 void drawObjectNames(
QPainter *painter,
double scale);
134 void drawPixelGrid(
QPainter *painter,
double scale);
135 void drawMagnifyingGlass(
QPainter *painter,
double scale);
136 bool isImageStretched();
137 bool isCrosshairShown();
138 bool isClippingShown();
139 bool areObjectsShown();
140 bool isEQGridShown();
141 bool isSelectionRectShown();
142 bool isPixelGridShown();
146 void updateFrame(
bool now =
false);
149 bool isTelescopeActive();
150 void updateScopeButton();
151 void setScopeButton(
QAction *action)
153 centerTelescopeAction = action;
159 CursorMode getCursorMode();
160 void setCursorMode(CursorMode mode);
161 void updateMouseCursor();
166 uint16_t zoomedWidth()
170 uint16_t zoomedHeight()
172 return currentHeight;
174 double ZoomFactor()
const
181 void toggleStars(
bool enable);
183 void setStarsEnabled(
bool enable);
184 void setStarsHFREnabled(
bool enable);
185 void setStarFilterRange(
float const innerRadius,
float const outerRadius);
189 void updateMode(FITSMode fmode);
195 void setFilter(FITSScale newFilter)
200 void setFirstLoad(
bool value);
202 void pushFilter(FITSScale value)
204 filterStack.push(value);
206 FITSScale popFilter()
208 return filterStack.pop();
211 CursorMode lastMouseMode { selectCursor };
212 bool isStarProfileShown()
214 return showStarProfile;
217 void createFloatingToolBar();
222 StretchParams getStretchParams()
const
224 return stretchParams;
229 bool getAutoStretch()
const
237 void setStretchParams(
const StretchParams ¶ms);
241 void setStretch(
bool onOff);
244 void setAutoStretchParams();
248 void setPreviewSampling(uint8_t value)
252 m_PreviewSampling = m_AdaptiveSampling;
253 m_StretchingInProgress =
false;
257 m_PreviewSampling = value * m_AdaptiveSampling;
258 m_StretchingInProgress =
true;
268 QRect getSelectionRegion()
const
270 return selectionRectangleRaw;
280 void updateMagnifyingGlass(
int x,
int y);
284 void toggleObjects();
285 void togglePixelGrid();
286 void toggleCrosshair();
289 void toggleSelectionMode();
293 void toggleStarProfile();
294 void viewStarProfile();
296 void centerTelescope();
298 void toggleStretch();
299 void toggleClipping();
301 virtual void processPointSelection(
int x,
int y);
302 virtual void processMarkerSelection(
int x,
int y);
304 void move3DTrackingBox(
int x,
int y);
305 void resizeTrackingBox(
int newSize);
306 void processRectangle(
QPoint p1,
QPoint p2,
bool refreshCenter =
false);
307 void processRectangleFixed(
int s);
322 void calculateMaxPixel(
double min,
double max);
323 void initDisplayImage();
326 bool pointIsInImage(
QPointF pt,
double scale);
333 QRect selectionRectangleRaw;
335 QToolBar *floatingToolBar {
nullptr };
345 double currentZoom { 0 };
350 uint8_t *m_ImageRoiBuffer {
nullptr };
352 uint32_t m_ImageRoiBufferSize { 0 };
356 void doStretch(
QImage *outputImage);
357 double scaleSize(
double size);
359 void updateFrameLargeImage();
360 void updateFrameSmallImage();
369 uint16_t currentWidth { 0 };
371 uint16_t currentHeight { 0 };
373 const double m_ZoomFactor;
380 bool firstLoad {
true };
381 bool markStars {
false };
382 bool showStarProfile {
false };
383 bool showCrosshair {
false };
384 bool showObjects {
false };
385 bool showEQGrid {
false };
386 bool showPixelGrid {
false };
387 bool showStarsHFR {
false };
388 bool showClipping {
false };
390 int m_NumClipped { 0 };
392 bool showSelectionRect {
false };
396 bool stretchImage {
false };
401 bool autoStretch {
true };
404 StretchParams stretchParams;
407 uint8_t m_PreviewSampling { 1 };
408 bool m_StretchingInProgress {
false};
410 uint8_t m_AdaptiveSampling {1};
416 return innerRadius != 0.0f || outerRadius != 1.0f;
418 float innerRadius { 0.0f };
419 float outerRadius { 1.0f };
422 CursorMode cursorMode { selectCursor };
423 bool zooming {
false };
431 QTimer m_UpdateFrameTimer;
436 bool trackingBoxEnabled {
false };
445 QAction *centerTelescopeAction {
nullptr };
446 QAction *toggleEQGridAction {
nullptr };
447 QAction *toggleObjectsAction {
nullptr };
448 QAction *toggleStarsAction {
nullptr };
449 QAction *toggleProfileAction {
nullptr };
450 QAction *toggleStretchAction {
nullptr };
453 int magnifyingGlassX { -1 };
454 int magnifyingGlassY { -1 };
455 bool showMagnifyingGlass {
false };
456 bool m_Suspended {
false};
461 #ifdef HAVE_DATAVISUALIZATION
466 void newStatus(
const QString &msg, FITSBar
id);
467 void debayerToggled(
bool);
468 void wcsToggled(
bool);
469 void actionUpdated(
const QString &name,
bool enable);
470 void trackingStarSelected(
int x,
int y);
472 void failed(
const QString &error);
473 void starProfileWindowClosed();
474 void rectangleUpdated(
QRect roi);
475 void setRubberBand(
QRect rect);
476 void showRubberBand(
bool on =
false);
477 void zoomRubberBand(
double scale);
479 friend class FITSLabel;
QFuture< void > filter(Sequence &sequence, KeepFunctor filterFunction)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Aug 15 2022 04:04:01 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.