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

kstars

  • extragear
  • edu
  • kstars
  • kstars
  • auxiliary
imageexporter.h
Go to the documentation of this file.
1 /***************************************************************************
2  imageexporter.h - K Desktop Planetarium
3  -------------------
4  begin : Sun 13 Jan 2013 00:44:47 CST
5  copyright : (c) 2013 by Akarsh Simha
6  email : [email protected]
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  ***************************************************************************/
17 
18 #ifndef IMAGEEXPORTER_H
19 #define IMAGEEXPORTER_H
20 
21 #include "../printing/legend.h"
22 
23 #include <QObject>
24 
25 class KStars;
26 class QSize;
27 
34 class ImageExporter : public QObject
35 {
36  Q_OBJECT
37 
38  public:
42  explicit ImageExporter(QObject *parent = nullptr);
43 
47  ~ImageExporter() override;
48 
52  inline QString getLastErrorMessage() const { return m_lastErrorMessage; }
53 
54  public Q_SLOTS:
61  bool exportImage(QString url);
62 
71  void setLegendProperties(Legend::LEGEND_TYPE type, Legend::LEGEND_ORIENTATION orientation,
72  Legend::LEGEND_POSITION position, int alpha = 160, bool include = true);
73 
78  inline void includeLegend(bool include) { m_includeLegend = include; }
79 
84  void setLegendAlpha(int alpha);
85 
91  void setRasterOutputSize(const QSize *size);
92 
96  inline Legend *getLegend() { return m_Legend; }
97 
98  private:
99  void exportSvg(const QString &fileName);
100  bool exportRasterGraphics(const QString &fileName);
101  void addLegend(SkyQPainter *painter);
102  void addLegend(QPaintDevice *pd);
103 
104  bool m_includeLegend;
105  Legend *m_Legend;
106  QSize *m_Size;
107  QString m_lastErrorMessage;
108 };
109 
110 #endif
ImageExporter::setLegendAlpha
void setLegendAlpha(int alpha)
Set legend transparency.
Definition: imageexporter.cpp:281
ImageExporter::~ImageExporter
~ImageExporter() override
Destructor.
Definition: imageexporter.cpp:268
ImageExporter::exportImage
bool exportImage(QString url)
Exports an image with the defined settings.
Definition: imageexporter.cpp:198
ImageExporter::setLegendProperties
void setLegendProperties(Legend::LEGEND_TYPE type, Legend::LEGEND_ORIENTATION orientation, Legend::LEGEND_POSITION position, int alpha=160, bool include=true)
Set the legend properties.
Definition: imageexporter.cpp:251
QPaintDevice
ImageExporter
Backends for exporting a sky image, either raster or vector, with a legend.
Definition: imageexporter.h:34
KStars
This is the main window for KStars.
Definition: kstars.h:101
SkyQPainter
The QPainter-based painting backend.
Definition: skyqpainter.h:39
QObject
Legend::LEGEND_POSITION
LEGEND_POSITION
Legend position enumeration.
Definition: legend.h:70
ImageExporter::getLegend
Legend * getLegend()
Definition: imageexporter.h:96
QString
Legend::LEGEND_TYPE
LEGEND_TYPE
Legend type enumeration.
Definition: legend.h:49
ImageExporter::includeLegend
void includeLegend(bool include)
Include legend?
Definition: imageexporter.h:78
ImageExporter::ImageExporter
ImageExporter(QObject *parent=nullptr)
Constructor.
Definition: imageexporter.cpp:32
QSize
Legend::LEGEND_ORIENTATION
LEGEND_ORIENTATION
Legend orientation enumeration.
Definition: legend.h:61
Legend
Legend class is used for painting legends on class inheriting QPaintDevice.
Definition: legend.h:43
ImageExporter::getLastErrorMessage
QString getLastErrorMessage() const
Definition: imageexporter.h:52
QObject::parent
QObject * parent() const
ImageExporter::setRasterOutputSize
void setRasterOutputSize(const QSize *size)
Set the size of output raster images.
Definition: imageexporter.cpp:273
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Sun Dec 15 2019 03:10:16 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
  • Modules
  • Related Pages

edu API Reference

Skip menu "edu API Reference"
  •     core
  • kstars

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