[Kstars-devel] ConstellationArt Class

Alexander Potashev aspotashev at gmail.com
Thu Jun 4 20:28:53 UTC 2015


Hi again,

I think you need to apply a complex transform to the constellation
image before drawing it - the same projection transform as KStars
applies to the positions of stars. Otherwise the stars drawn by KStars
will not always match the stars drawn inside constellation images.

This problem of transforming images sounds to me very similar to the
transform tool [1,2] in Krita (Disclaimer: I'm not an expert). So you
can employ similar tricks to make it fast. As far as I know Dmitry
decided not to apply a transform to each pixel routinely but instead
apply it to a grid of 8x8-pixel blocks and then use a linear transform
inside the blocks. But you'd better see the code, I might be even
getting it wrong.

[1] https://krita.org/item/another-kickstarter-feature-done-cage-transform/
[2] https://userbase.kde.org/Krita/Manual/Tools/Transform

--
Alexander Potashev

2015-05-29 12:57 GMT+03:00 M.S. Adityan <msadityan at gmail.com>:
> Hi Jasem,
>
> I have written some code, and would like your views on it.
>
> Here is the ConstellationArt class: https://paste.kde.org/ptjmjexsk
> Here is its implementation: https://paste.kde.org/peibzepto
>
> I am treating ConstellationArt as a SkyComponent. Currently what I have done
> is, I have opened the file constellationart.txt and read the values from
> that file. What I intend to do now is to make an array of 88 elements, each
> of which would be a structure that would hold information regarding the
> constellation art to be displayed. The structure would contain
> x1,y1,hd1,x2,y2,hd2,x3,y3,hd3,abbreviation,imageFileName where x1,y1,hd1
> stand for x coordinate of pixel, y coordinate of pixel, and HD number of
> Star 1. Like wise for star 2 and star 3.
>
> After this, I will have to pass them to the function draw(), which would
> draw the image on screen. But I am not very sure how to implement draw.
> Basically what I want it to do is to just draw the image contained in
> andromeda.png (for an example), and anchor the image to the stars used in
> Andromeda.
>
> A few questions I am wondering about is, if the constellation image is fixed
> to the 3 reference stars, then I don't need to worry about it going over the
> horizon, right? Meaning the image shouldn't display when it goes over the
> horizon. Secondly, the images used are atleast 256x256 pixels, some are
> 512x512, and others are 1024x1024, so I am not very sure how to account for
> zooming in an out. Is that taken care off automatically, or would I be
> required to write separate zoom functions?
>
> Regards
> M.S.Adityan
> Website: www.msadityan.com
> https://www.linkedin.com/in/msadityan
>
> _______________________________________________
> Kstars-devel mailing list
> Kstars-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kstars-devel
>



-- 
Alexander Potashev


More information about the Kstars-devel mailing list