moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kstars / kstars / starpixmap.h
blobe37bb18e567fec5f4c606cb0a8ac124ab7cfb537
1 /***************************************************************************
2 starpixmap.h - K Desktop Planetarium
3 -------------------
4 begin : Wed Sep 19 2001
5 copyright : (C) 2001 by Thomas Kabelmann
6 email : tk78@gmx.de
7 ***************************************************************************/
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 ***************************************************************************/
18 #ifndef STARPIXMAP_H
19 #define STARPIXMAP_H
21 #include <qpixmap.h>
23 /**@class StarPixmap
24 *Stores a two-dimensional array of star images, indexed by both size and color.
25 *Based on a star's spectral type, brightness, and the current zoom level, the appropriate
26 *image is selected from the array in the SkyMap::drawSymbol() function.
27 *A two-dimensional array of QPixmap star images
28 *@author Thomas Kabelmann
29 *@version 1.0
32 class StarPixmap {
33 public:
34 /**Constructor. Build the array of images, based on a color mode and a colorintensity
35 *value.
36 *@param colorMode the color mode: 0 (real colors), 1 (solid red), 2 (solid black), or 3 (solid white).
37 *@param colorIntensity The thickness of the real-color circle drawn in mode 0 (it does nothing in the other color modes).
39 StarPixmap (int colorMode=0, int colorIntensity = 4);
41 /**Destructor (empty)*/
42 ~StarPixmap() {}
44 /**Retrieve the pixmap from the array indexed by color and size
45 *@param color the spectral type (one of O,B,A,F,G,K,M,N,P)
46 *@param s the size index
48 QPixmap* getPixmap (QChar *color, int s);
50 /**Change the Color mode. Regenerate the star image array.
51 *@param newMode the new Color Mode to use.
53 void setColorMode( int newMode );
55 /**Change the color Intensity. Regenerate the star image array.
56 *@param newIntensity the new colorIntensity value.
58 void setIntensity ( int newIntensity );
60 /**@return the current color mode*/
61 int mode() const { return colorMode; }
63 /**@return the current colorIntensity value*/
64 int intensity() const { return colorIntensity; }
66 private:
68 QPixmap starPixmaps[10][26]; // the preloaded starpixmaps 10 colors/ 24 sizes
69 int size, colorMode, colorIntensity;
71 /**Construct the array of star images*/
72 void loadPixmaps ( int colorMode = 0, int colorIntensity = 4 );
75 #endif