1
/****************************************************************************
2
Xplanet 0.94 - render an image of a planet into an X window
3
Copyright (C) 2002 Hari Nair <hari@alumni.caltech.edu>
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program; if not, write to the Free Software
17
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
****************************************************************************/
27
#include "checkfuncs.h"
29
#ifdef HAVE_LIBFREETYPE
31
#include FT_FREETYPE_H
42
virtual ~DisplayBase();
47
// routines which must be defined in derived classes
48
virtual const char *identifyMe() = 0;
49
virtual void render(ProjectionBase *image) = 0;
51
// routines to be optionally overridden by derived classes
52
virtual void initialize();
53
virtual void drawMarker(Marker &m);
54
virtual int getFontAscent();
55
virtual int getFontDescent();
56
virtual void getRGB(string color, unsigned char *RGB);
57
virtual string getTempdir();
58
virtual int getTextHeight(const string text);
59
virtual int getTextWidth(const string text);
60
virtual void setFont(string fontname);
61
virtual void setFontSize(const int size);
64
int window_width, window_height;
67
unsigned char *png_alpha;
68
unsigned char *rgb_data;
69
unsigned char bg[3]; // background color for annotation
70
unsigned char fg[3]; // foreground color for annotation
73
void doAnnotation(ProjectionBase *image);
75
void setAlpha(unsigned char *c);
76
void setImage(unsigned char *c);
78
// routines to be optionally overridden by derived classes
79
virtual int fontExists(string &filename);
80
virtual void drawCircle(const int x, const int y, const int r);
81
virtual void drawImage(Marker &m);
82
virtual void drawLabel(const string body_label, const string date_label,
83
const string illum_label, const string obs_label,
84
const string rotate_label, const string sun_label);
85
virtual void drawOutlinedString(const int x, const int y,
87
virtual void printError(const string error);
88
virtual void setColor(string color);
89
virtual void setForeground(unsigned char *color);
90
virtual void setPixel(const int x, const int y);
91
virtual void setPixel(const int x, const int y, double opacity);
92
virtual int getTextHeight();
95
#ifdef HAVE_LIBFREETYPE
101
unsigned char current_color[3];
102
map<string, unsigned int> RGBColors;
104
void drawText(const int x, const int y, const string text);