Changeset View
Changeset View
Standalone View
Standalone View
kstars/tools/eyepiecefield.cpp
Context not available. | |||||
15 | * * | 15 | * * | ||
---|---|---|---|---|---|
16 | ***************************************************************************/ | 16 | ***************************************************************************/ | ||
17 | 17 | | |||
18 | /* Project Includes */ | | |||
19 | #include "eyepiecefield.h" | 18 | #include "eyepiecefield.h" | ||
19 | | ||||
20 | #include "exporteyepieceview.h" | 20 | #include "exporteyepieceview.h" | ||
21 | #include "fov.h" | 21 | #include "fov.h" | ||
22 | #include "skypoint.h" | 22 | #include "ksdssdownloader.h" | ||
23 | #include "skymap.h" | 23 | #include "skymap.h" | ||
24 | #include "skyqpainter.h" | 24 | #include "skyqpainter.h" | ||
25 | #include "kstars.h" | | |||
26 | #include "Options.h" | 25 | #include "Options.h" | ||
27 | #include "ksdssimage.h" | | |||
28 | #include "kstarsdatetime.h" | | |||
29 | #include "ksdssdownloader.h" | | |||
30 | /* KDE Includes */ | | |||
31 | 26 | | |||
32 | /* Qt Includes */ | | |||
33 | #include <QString> | | |||
34 | #include <QLabel> | 27 | #include <QLabel> | ||
35 | #include <QSlider> | 28 | #include <QSlider> | ||
36 | #include <QComboBox> | 29 | #include <QComboBox> | ||
37 | #include <QVBoxLayout> | 30 | #include <QVBoxLayout> | ||
38 | #include <QHBoxLayout> | | |||
39 | #include <QCheckBox> | 31 | #include <QCheckBox> | ||
40 | #include <QImage> | | |||
41 | #include <QPixmap> | | |||
42 | #include <QBitmap> | 32 | #include <QBitmap> | ||
43 | #include <QTemporaryFile> | | |||
44 | #include <QSvgRenderer> | 33 | #include <QSvgRenderer> | ||
45 | #include <QSvgGenerator> | 34 | #include <QSvgGenerator> | ||
46 | 35 | | |||
Context not available. | |||||
308 | fovHeight = fovWidth; | 297 | fovHeight = fovWidth; | ||
309 | 298 | | |||
310 | // Get DSS image width / height | 299 | // Get DSS image width / height | ||
311 | double dssWidth, dssHeight; | 300 | double dssWidth = 0, dssHeight = 0; | ||
301 | | ||||
312 | if (QFile::exists(imagePath)) | 302 | if (QFile::exists(imagePath)) | ||
313 | { | 303 | { | ||
314 | KSDssImage dssImage(imagePath); | 304 | KSDssImage dssImage(imagePath); | ||
Context not available. | |||||
404 | // Prepare the sky image | 394 | // Prepare the sky image | ||
405 | if (QFile::exists(imagePath) && skyImage) | 395 | if (QFile::exists(imagePath) && skyImage) | ||
406 | { | 396 | { | ||
407 | QImage *mySkyImage = 0; | 397 | QImage *mySkyImage = new QImage(int(arcMinToScreen * fovWidth * 2.0), int(arcMinToScreen * fovHeight * 2.0), | ||
408 | mySkyImage = new QImage(int(arcMinToScreen * fovWidth * 2.0), int(arcMinToScreen * fovHeight * 2.0), | 398 | QImage::Format_ARGB32); | ||
409 | QImage::Format_ARGB32); | 399 | | ||
410 | mySkyImage->fill(Qt::transparent); | 400 | mySkyImage->fill(Qt::transparent); | ||
401 | | ||||
411 | QPainter p(mySkyImage); | 402 | QPainter p(mySkyImage); | ||
412 | QImage rawImg(imagePath); | 403 | QImage rawImg(imagePath); | ||
404 | | ||||
413 | if (rawImg.isNull()) | 405 | if (rawImg.isNull()) | ||
414 | { | 406 | { | ||
415 | qWarning() << "Image constructed from " << imagePath | 407 | qWarning() << "Image constructed from " << imagePath | ||
Context not available. | |||||
429 | qDebug() << "North angle = " << northBearing.toDMSString(); | 421 | qDebug() << "North angle = " << northBearing.toDMSString(); | ||
430 | 422 | | |||
431 | QTransform transform; | 423 | QTransform transform; | ||
424 | | ||||
432 | transform.rotate(northBearing.Degrees()); | 425 | transform.rotate(northBearing.Degrees()); | ||
433 | img = img.transformed(transform, Qt::SmoothTransformation); | 426 | img = img.transformed(transform, Qt::SmoothTransformation); | ||
434 | } | 427 | } | ||
Context not available. |