Stellarium  HEAD
Public Member Functions
scm::ScmConstellationArtwork Class Reference

Public Member Functions

 ScmConstellationArtwork (const std::array< Anchor, 3 > &anchors, const QImage &artwork)
 
void setupArt ()
 Setups the artwork in the frame based on the anchors.
 
void setAnchor (int index, const Anchor &anchor)
 Sets an anchor value at the selected index. More...
 
const std::array< Anchor, 3 > & getAnchors () const
 Gets the anchors of the artwork. More...
 
void setArtwork (const QImage &artwork)
 Sets the size of the artwork in pixels. More...
 
const QImage & getArtwork () const
 Gets the artwork. More...
 
bool getHasArt () const
 Get the indicator if the artwork contains art. More...
 
void draw (StelCore *core) const
 Draws the artwork. More...
 
void draw (StelCore *core, StelPainter &painter) const
 Draws the artwork. More...
 
QJsonObject toJson (const QString &relativePath) const
 Converts the artwork into stalleriums json format. More...
 
bool save (const QString &filepath) const
 Writes the image of the artwork to the disk. More...
 
void reset ()
 Resets the artwork state.
 

Member Function Documentation

◆ draw() [1/2]

void scm::ScmConstellationArtwork::draw ( StelCore core) const

Draws the artwork.

Parameters
coreThe core to use to draw the artwork.

◆ draw() [2/2]

void scm::ScmConstellationArtwork::draw ( StelCore core,
StelPainter painter 
) const

Draws the artwork.

Parameters
coreThe core to use to draw the artwork.

◆ getAnchors()

const std::array<Anchor, 3>& scm::ScmConstellationArtwork::getAnchors ( ) const

Gets the anchors of the artwork.

Returns
const std::array<Anchor, 3>& The artwork anchors.

◆ getArtwork()

const QImage& scm::ScmConstellationArtwork::getArtwork ( ) const

Gets the artwork.

Returns
const QPixmap& The artwork.

◆ getHasArt()

bool scm::ScmConstellationArtwork::getHasArt ( ) const

Get the indicator if the artwork contains art.

Returns
true Contains art.
false Does not contain art.

◆ save()

bool scm::ScmConstellationArtwork::save ( const QString &  filepath) const

Writes the image of the artwork to the disk.

Parameters
filepathThe filepath to write the artwork to.
Returns
true Successful saved.
false Failed to save.

◆ setAnchor()

void scm::ScmConstellationArtwork::setAnchor ( int  index,
const Anchor anchor 
)

Sets an anchor value at the selected index.

Parameters
indexThe index to set the anchor.
anchorThe anchor to be set.

◆ setArtwork()

void scm::ScmConstellationArtwork::setArtwork ( const QImage &  artwork)

Sets the size of the artwork in pixels.

Parameters
ArtworkThe size of the artwork.

◆ toJson()

QJsonObject scm::ScmConstellationArtwork::toJson ( const QString &  relativePath) const

Converts the artwork into stalleriums json format.

Parameters
relativePathThe relative path to the artwork on disk.
Returns
QJsonObject The json format.