canvas_imp.h
2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/**
* \file canvas_imp.h
*
* \brief ein Prototyp einer Canvas Implementation
*
* Die Canvas Implementation dient Hauptsächlich dazu color,
* light und fogtables passend zum canvas zur verfügung zu stellen.
* Es werden auch Methoden bereit gestellt, über die man externe
* Farbdefinitionen (z.B. für jeweils rot, grün und blau
* Werte zwischen 0 und 255) in das von dem canvas benutzte Farbschema
* zu convertieren.
*
* \author Georg Steffers <georg@steffers.org> [gs]
*
* \date 04.12.2003
*
* \version ..2002 [gs]: erste funktionierende Implementation
* \version 22.12.2003 [gs]: <ul><li>
* beginn der Dokumentation via doxygen
* </li><li>
* Light und Fogtables hinzugefügt
* </li></ul>
*/
/*
* Copyright (C)2003 Georg Steffers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __canvas_imp_h__
#define __canvas_imp_h__
#define MAX_LIGHT_LEVELS 255
#define NUM_LIGHT_LEVELS (MAX_LIGHT_LEVELS+1)
#define MAX_FOG_LEVELS 255
#define NUM_FOG_LEVELS (MAX_FOG_LEVELS + 1)
class canvas;
class rasterizer;
class canvas_imp {
friend class canvas;
friend class rasterizer;
protected:
unsigned ext_max_red;
unsigned ext_max_green;
unsigned ext_max_blue;
virtual void compute_light_table(void)=0;
virtual void compute_fog_table(void)=0;
public:
virtual unsigned long ext_to_native(unsigned red,
unsigned green,
unsigned blue)=0;
virtual ~canvas_imp() {};
// virtual void light_to_native(unsigned char* pcolor,
// int intensity)=0;
// virtual void fog_to_native(unsigned char* pcolor,
// int intensity)=0;
virtual void set_color(unsigned long col) {};
virtual void light_native(unsigned long* col, unsigned intense) = 0;
unsigned char* p_screenbuf;
char bytes_per_pixel;
};
#endif // __canvas_imp_h__