line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Graphics::Framebuffer::Splash; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
18
|
|
|
1
|
|
|
|
|
39
|
|
4
|
1
|
|
|
1
|
|
5
|
no strict 'vars'; # We have to map a variable as the screen. So strict is going to whine about what we do with it. |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
5
|
1
|
|
|
1
|
|
13
|
no warnings; # We have to be as quiet as possible |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
44
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use constant { |
8
|
1
|
|
|
|
|
98
|
TRUE => 1, |
9
|
|
|
|
|
|
|
FALSE => 0 |
10
|
1
|
|
|
1
|
|
7
|
}; |
|
1
|
|
|
|
|
2
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
9
|
use List::Util qw(min max); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
135
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
BEGIN { |
15
|
1
|
|
|
1
|
|
8
|
require Exporter; |
16
|
1
|
|
|
|
|
19
|
our @ISA = qw( Exporter ); |
17
|
1
|
|
|
|
|
4
|
our $VERSION = '1.23'; |
18
|
1
|
|
|
|
|
2
|
our @EXPORT = qw( _perl_logo splash ); |
19
|
1
|
|
|
|
|
2526
|
our @EXPORT_OK = qw(); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _perl_logo { |
23
|
0
|
|
|
0
|
|
|
my $self = shift; |
24
|
0
|
0
|
|
|
|
|
return unless (exists($self->{'FONTS'}->{'DejaVuSerif'})); |
25
|
0
|
|
|
|
|
|
my $hf = $self->{'H_SCALE'}; |
26
|
0
|
|
|
|
|
|
my $vf = $self->{'V_SCALE'}; |
27
|
0
|
|
|
|
|
|
my $X = $self->{'H_OFFSET'}; |
28
|
0
|
|
|
|
|
|
my $Y = $self->{'V_OFFSET'}; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
$self->normal_mode(); |
31
|
0
|
|
|
|
|
|
$self->set_color({ 'red' => 0, 'green' => 0, 'blue' => 0, 'alpha' => 128 }); |
32
|
0
|
|
|
|
|
|
$self->ellipse( |
33
|
|
|
|
|
|
|
{ |
34
|
|
|
|
|
|
|
'x' => (965 * $hf) + $X, |
35
|
|
|
|
|
|
|
'y' => (96 * $vf) + $Y, |
36
|
|
|
|
|
|
|
'xradius' => 140 * $hf, |
37
|
|
|
|
|
|
|
'yradius' => 65 * $vf, |
38
|
|
|
|
|
|
|
'filled' => TRUE |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
); |
41
|
0
|
|
|
|
|
|
$self->set_color({ 'red' => 0, 'green' => 64, 'blue' => 255, 'alpha' => 255 }); |
42
|
0
|
|
|
|
|
|
$self->ellipse( |
43
|
|
|
|
|
|
|
{ |
44
|
|
|
|
|
|
|
'x' => (960 * $hf) + $X, |
45
|
|
|
|
|
|
|
'y' => (91 * $vf) + $Y, |
46
|
|
|
|
|
|
|
'xradius' => 140 * $hf, |
47
|
|
|
|
|
|
|
'yradius' => 65 * $vf, |
48
|
|
|
|
|
|
|
'filled' => TRUE |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
); |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
$self->xor_mode(); |
53
|
|
|
|
|
|
|
$self->ttf_print( |
54
|
|
|
|
|
|
|
$self->ttf_print( |
55
|
|
|
|
|
|
|
{ |
56
|
|
|
|
|
|
|
'bounding_box' => TRUE, |
57
|
|
|
|
|
|
|
'y' => (152 * $vf) + $Y, # 85 * $vf, |
58
|
|
|
|
|
|
|
'height' => 80 * $vf, |
59
|
|
|
|
|
|
|
'wscale' => 1, |
60
|
|
|
|
|
|
|
'color' => '0040FFFF', |
61
|
|
|
|
|
|
|
'text' => 'Perl', |
62
|
|
|
|
|
|
|
'face' => $self->{'FONTS'}->{'DejaVuSerif'}->{'font'}, |
63
|
|
|
|
|
|
|
'font_path' => $self->{'FONTS'}->{'DejaVuSerif'}->{'path'}, |
64
|
|
|
|
|
|
|
'bounding_box' => TRUE, |
65
|
0
|
|
|
|
|
|
'center' => $self->{'CENTER_X'}, |
66
|
|
|
|
|
|
|
'antialias' => FALSE |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
) |
69
|
|
|
|
|
|
|
); |
70
|
|
|
|
|
|
|
} ## end sub _perl_logo |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub splash { |
73
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
74
|
0
|
|
|
|
|
|
my $version = shift; |
75
|
0
|
0
|
|
|
|
|
return if ($self->{'SPLASH'} == 0); |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
my $X = $self->{'X_CLIP'}; |
78
|
0
|
|
|
|
|
|
my $Y = $self->{'Y_CLIP'}; |
79
|
0
|
|
|
|
|
|
my $W = $self->{'W_CLIP'}; |
80
|
0
|
|
|
|
|
|
my $H = $self->{'H_CLIP'}; |
81
|
0
|
|
|
|
|
|
my ($R,$G,$B); |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
# The logo was designed using 1920x1080 screen. It is scaled accordingly. |
84
|
0
|
|
|
|
|
|
my $hf = $W / 1920; # Scales the logo. Everything scales according to these values. |
85
|
0
|
|
|
|
|
|
my $vf = $H / 1080; |
86
|
0
|
|
|
|
|
|
$self->{'H_SCALE'} = $hf; |
87
|
0
|
|
|
|
|
|
$self->{'V_SCALE'} = $vf; |
88
|
0
|
|
|
|
|
|
$self->{'H_OFFSET'} = $X; |
89
|
0
|
|
|
|
|
|
$self->{'V_OFFSET'} = $Y; |
90
|
|
|
|
|
|
|
|
91
|
0
|
|
|
|
|
|
my $bold = $self->{'FONT_FACE'}; |
92
|
0
|
|
|
|
|
|
$bold =~ s/\.ttf$/Bold.ttf/; |
93
|
|
|
|
|
|
|
|
94
|
0
|
|
|
|
|
|
$self->cls(); |
95
|
0
|
|
|
|
|
|
$self->clip_reset(); |
96
|
0
|
|
|
|
|
|
$self->normal_mode(); |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
# If the screen is tiny, then we use a different splash screen |
99
|
0
|
|
|
|
|
|
$self->normal_mode(); |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
# Draws the main boxes |
102
|
0
|
|
|
|
|
|
$self->set_color({ 'red' => 0, 'green' => 32, 'blue' => 0, 'alpha' => 255 }); |
103
|
0
|
|
|
|
|
|
$self->rbox( |
104
|
|
|
|
|
|
|
{ |
105
|
|
|
|
|
|
|
'x' => $X, |
106
|
|
|
|
|
|
|
'y' => $Y, |
107
|
|
|
|
|
|
|
'width' => $W, |
108
|
|
|
|
|
|
|
'height' => $H, |
109
|
|
|
|
|
|
|
'filled' => TRUE, |
110
|
|
|
|
|
|
|
'hatch' => 'dots16' |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
); |
113
|
0
|
0
|
0
|
|
|
|
$self->alpha_mode() if ($self->{'GPU'} !~ /nouveaufb/ && $self->{'ACCELERATED'}); |
114
|
0
|
|
|
|
|
|
$self->set_color({ 'red' => 0, 'green' => 0, 'blue' => 128, 'alpha' => 255 }); |
115
|
0
|
|
|
|
|
|
$self->polygon( |
116
|
|
|
|
|
|
|
{ |
117
|
|
|
|
|
|
|
'coordinates' => [(400 * $hf) + $X, (80 * $vf) + $Y, (20 * $hf) + $X, (800 * $vf) + $Y, (1600 * $hf) + $X, (1078 * $vf) + $Y, (1900 * $hf) + $X, (5 * $vf) + $Y], |
118
|
|
|
|
|
|
|
'filled' => TRUE, |
119
|
|
|
|
|
|
|
'gradient' => { |
120
|
|
|
|
|
|
|
'colors' => { |
121
|
|
|
|
|
|
|
'red' => [0, 0], |
122
|
|
|
|
|
|
|
'green' => [0, 0], |
123
|
|
|
|
|
|
|
'blue' => [128, 255], |
124
|
|
|
|
|
|
|
'alpha' => [128, 255], |
125
|
|
|
|
|
|
|
}, |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
); |
129
|
|
|
|
|
|
|
|
130
|
0
|
|
|
|
|
|
$self->set_color({ 'red' => 255, 'green' => 0, 'blue' => 0, 'alpha' => 100 }); |
131
|
0
|
|
|
|
|
|
$self->rbox( |
132
|
|
|
|
|
|
|
{ |
133
|
|
|
|
|
|
|
'x' => (150 * $hf) + $X, |
134
|
|
|
|
|
|
|
'y' => (150 * $vf) + $Y, |
135
|
|
|
|
|
|
|
'width' => 1660 * $hf, |
136
|
|
|
|
|
|
|
'height' => 800 * $vf, |
137
|
|
|
|
|
|
|
'radius' => 15 * min($hf, $vf), |
138
|
|
|
|
|
|
|
'filled' => TRUE, |
139
|
|
|
|
|
|
|
'gradient' => { |
140
|
|
|
|
|
|
|
'direction' => 'vertical', |
141
|
|
|
|
|
|
|
'colors' => { |
142
|
|
|
|
|
|
|
'red' => [32, 200], |
143
|
|
|
|
|
|
|
'green' => [0, 0], |
144
|
|
|
|
|
|
|
'blue' => [0, 0], |
145
|
|
|
|
|
|
|
'alpha' => [96, 220], |
146
|
|
|
|
|
|
|
}, |
147
|
|
|
|
|
|
|
}, |
148
|
|
|
|
|
|
|
} |
149
|
|
|
|
|
|
|
); |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
### Draws the Circle with GFB in it ### |
152
|
|
|
|
|
|
|
# The dark shadow circle |
153
|
0
|
0
|
|
|
|
|
$self->set_color({ 'red' => 32, 'green' => 0, 'blue' => 0, 'alpha' => ($self->{'GPU'} !~ /nouveaufb/) ? 200 : 255 }); |
154
|
0
|
|
|
|
|
|
$self->circle( |
155
|
|
|
|
|
|
|
{ |
156
|
|
|
|
|
|
|
'x' => (207 * $hf) + $X, |
157
|
|
|
|
|
|
|
'y' => (207 * $vf) + $Y, |
158
|
|
|
|
|
|
|
'radius' => 200 * min($vf, $hf), |
159
|
|
|
|
|
|
|
'filled' => TRUE |
160
|
|
|
|
|
|
|
} |
161
|
|
|
|
|
|
|
); |
162
|
|
|
|
|
|
|
|
163
|
0
|
|
|
|
|
|
$self->normal_mode(); |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
# The "coin" |
166
|
0
|
|
|
|
|
|
$self->set_color({ 'red' => 255, 'green' => 255, 'blue' => 255, 'alpha' => 255 }); |
167
|
0
|
|
|
|
|
|
$self->circle( |
168
|
|
|
|
|
|
|
{ |
169
|
|
|
|
|
|
|
'x' => (200 * $hf) + $X, |
170
|
|
|
|
|
|
|
'y' => (200 * $vf) + $Y, |
171
|
|
|
|
|
|
|
'radius' => 200 * min($hf, $vf), |
172
|
|
|
|
|
|
|
'filled' => TRUE, |
173
|
|
|
|
|
|
|
'gradient' => { |
174
|
|
|
|
|
|
|
'direction' => 'horizontal', |
175
|
|
|
|
|
|
|
'colors' => { |
176
|
|
|
|
|
|
|
'red' => [255, 255, 255], |
177
|
|
|
|
|
|
|
'green' => [192, 96, 228], |
178
|
|
|
|
|
|
|
'blue' => [0, 0, 0], |
179
|
|
|
|
|
|
|
'alpha' => [255, 255, 255], |
180
|
|
|
|
|
|
|
}, |
181
|
|
|
|
|
|
|
} |
182
|
|
|
|
|
|
|
} |
183
|
|
|
|
|
|
|
); |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
# G |
186
|
0
|
|
|
|
|
|
$self->set_color({ 'red' => 32, 'green' => 32, 'blue' => 0, 'alpha' => 255 }); |
187
|
0
|
|
|
|
|
|
$self->filled_pie( |
188
|
|
|
|
|
|
|
{ |
189
|
|
|
|
|
|
|
'x' => (97 * $hf) + $X, |
190
|
|
|
|
|
|
|
'y' => (202 * $vf) + $Y, |
191
|
|
|
|
|
|
|
'radius' => 52 * $vf, |
192
|
|
|
|
|
|
|
'start_degrees' => 90, |
193
|
|
|
|
|
|
|
'end_degrees' => 10, |
194
|
|
|
|
|
|
|
'granularity' => 0.05 |
195
|
|
|
|
|
|
|
} |
196
|
|
|
|
|
|
|
); |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
# F |
199
|
0
|
|
|
|
|
|
$self->polygon( |
200
|
|
|
|
|
|
|
{ |
201
|
|
|
|
|
|
|
'coordinates' => [(162 * $hf) + $X, (252 * $vf) + $Y, (162 * $hf) + $X, (152 * $vf) + $Y, (262 * $hf) + $X, (152 * $vf) + $Y, (242 * $hf) + $X, (172 * $vf) + $Y, (182 * $hf) + $X, (172 * $vf) + $Y, (182 * $hf) + $X, (192 * $vf) + $Y, (222 * $hf) + $X, (192 * $vf) + $Y, (202 * $hf) + $X, (212 * $vf) + $Y, (182 * $hf) + $X, (212 * $vf) + $Y, (182 * $hf) + $X, (232 * $vf) + $Y], |
202
|
|
|
|
|
|
|
'filled' => TRUE, |
203
|
|
|
|
|
|
|
'pixel_size' => 1 |
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
); |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
# B |
208
|
0
|
|
|
|
|
|
$self->polygon( |
209
|
|
|
|
|
|
|
{ |
210
|
|
|
|
|
|
|
'coordinates' => [(272 * $hf) + $X, (252 * $vf) + $Y, (272 * $hf) + $X, (152 * $vf) + $Y, (322 * $hf) + $X, (152 * $vf) + $Y, (322 * $hf) + $X, (252 * $vf) + $Y], |
211
|
|
|
|
|
|
|
'filled' => TRUE, |
212
|
|
|
|
|
|
|
'pixel_size' => 1 |
213
|
|
|
|
|
|
|
} |
214
|
|
|
|
|
|
|
); |
215
|
0
|
|
|
|
|
|
$self->circle( |
216
|
|
|
|
|
|
|
{ |
217
|
|
|
|
|
|
|
'x' => (322 * $hf) + $X, |
218
|
|
|
|
|
|
|
'y' => (177 * $vf) + $Y, |
219
|
|
|
|
|
|
|
'radius' => 25 * $vf, |
220
|
|
|
|
|
|
|
'filled' => TRUE |
221
|
|
|
|
|
|
|
} |
222
|
|
|
|
|
|
|
); |
223
|
0
|
|
|
|
|
|
$self->circle( |
224
|
|
|
|
|
|
|
{ |
225
|
|
|
|
|
|
|
'x' => (322 * $hf) + $X, |
226
|
|
|
|
|
|
|
'y' => (227 * $vf) + $Y, |
227
|
|
|
|
|
|
|
'radius' => 25 * $vf, |
228
|
|
|
|
|
|
|
'filled' => TRUE |
229
|
|
|
|
|
|
|
} |
230
|
|
|
|
|
|
|
); |
231
|
|
|
|
|
|
|
|
232
|
0
|
0
|
|
|
|
|
if ($self->{'COLOR_ORDER'} == $self->{'BGR'}) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
233
|
0
|
|
|
|
|
|
($R,$G,$B) = (0,0,255); |
234
|
|
|
|
|
|
|
} elsif ($self->{'COLOR_ORDER'} == $self->{'BRG'}) { |
235
|
0
|
|
|
|
|
|
($R,$G,$B) = (0,0,255); |
236
|
|
|
|
|
|
|
} elsif ($self->{'COLOR_ORDER'} == $self->{'RGB'}) { |
237
|
0
|
|
|
|
|
|
($R,$G,$B) = (255,0,0); |
238
|
|
|
|
|
|
|
} elsif ($self->{'COLOR_ORDER'} == $self->{'RBG'}) { |
239
|
0
|
|
|
|
|
|
($R,$G,$B) = (255,0,0); |
240
|
|
|
|
|
|
|
} elsif ($self->{'COLOR_ORDER'} == $self->{'GRB'}) { |
241
|
0
|
|
|
|
|
|
($R,$G,$B) = (0,255,0); |
242
|
|
|
|
|
|
|
} elsif ($self->{'COLOR_ORDER'} == $self->{'GBR'}) { |
243
|
0
|
|
|
|
|
|
($R,$G,$B) = (0,255,0); |
244
|
|
|
|
|
|
|
} |
245
|
0
|
|
|
|
|
|
$self->set_color({ 'red' => $R, 'green' => $G, 'blue' => $B, 'alpha' => 255 }); |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
# G |
248
|
0
|
|
|
|
|
|
$self->filled_pie( |
249
|
|
|
|
|
|
|
{ |
250
|
|
|
|
|
|
|
'x' => (95 * $hf) + $X, |
251
|
|
|
|
|
|
|
'y' => (200 * $vf) + $Y, |
252
|
|
|
|
|
|
|
'radius' => 52 * $vf, |
253
|
|
|
|
|
|
|
'start_degrees' => 90, |
254
|
|
|
|
|
|
|
'end_degrees' => 10, |
255
|
|
|
|
|
|
|
'granularity' => 0.05 |
256
|
|
|
|
|
|
|
} |
257
|
|
|
|
|
|
|
); |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
# F |
260
|
0
|
0
|
|
|
|
|
if ($self->{'COLOR_ORDER'} == $self->{'BGR'}) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
261
|
0
|
|
|
|
|
|
($R,$G,$B) = (0,255,0); |
262
|
|
|
|
|
|
|
} elsif ($self->{'COLOR_ORDER'} == $self->{'BRG'}) { |
263
|
0
|
|
|
|
|
|
($R,$G,$B) = (255,0,0); |
264
|
|
|
|
|
|
|
} elsif ($self->{'COLOR_ORDER'} == $self->{'RGB'}) { |
265
|
0
|
|
|
|
|
|
($R,$G,$B) = (0,255,0); |
266
|
|
|
|
|
|
|
} elsif ($self->{'COLOR_ORDER'} == $self->{'RBG'}) { |
267
|
0
|
|
|
|
|
|
($R,$G,$B) = (0,0,255); |
268
|
|
|
|
|
|
|
} elsif ($self->{'COLOR_ORDER'} == $self->{'GRB'}) { |
269
|
0
|
|
|
|
|
|
($R,$G,$B) = (255,0,0); |
270
|
|
|
|
|
|
|
} elsif ($self->{'COLOR_ORDER'} == $self->{'GBR'}) { |
271
|
0
|
|
|
|
|
|
($R,$G,$B) = (0,0,255); |
272
|
|
|
|
|
|
|
} |
273
|
0
|
|
|
|
|
|
$self->set_color({ 'red' => $R, 'green' => $G, 'blue' => $B, 'alpha' => 255 }); |
274
|
|
|
|
|
|
|
|
275
|
0
|
|
|
|
|
|
$self->polygon( |
276
|
|
|
|
|
|
|
{ |
277
|
|
|
|
|
|
|
'coordinates' => [ |
278
|
|
|
|
|
|
|
(160 * $hf) + $X, |
279
|
|
|
|
|
|
|
(250 * $vf) + $Y, |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
(160 * $hf) + $X, |
282
|
|
|
|
|
|
|
(150 * $vf) + $Y, |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
(260 * $hf) + $X, |
285
|
|
|
|
|
|
|
(150 * $vf) + $Y, |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
(240 * $hf) + $X, |
288
|
|
|
|
|
|
|
(170 * $vf) + $Y, |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
(180 * $hf) + $X, |
291
|
|
|
|
|
|
|
(170 * $vf) + $Y, |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
(180 * $hf) + $X, |
294
|
|
|
|
|
|
|
(190 * $vf) + $Y, |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
(220 * $hf) + $X, |
297
|
|
|
|
|
|
|
(190 * $vf) + $Y, |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
(200 * $hf) + $X, |
300
|
|
|
|
|
|
|
(210 * $vf) + $Y, |
301
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
(180 * $hf) + $X, |
303
|
|
|
|
|
|
|
(210 * $vf) + $Y, |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
(180 * $hf) + $X, |
306
|
|
|
|
|
|
|
(230 * $vf) + $Y |
307
|
|
|
|
|
|
|
], |
308
|
|
|
|
|
|
|
'filled' => TRUE, |
309
|
|
|
|
|
|
|
'pixel_size' => 1 |
310
|
|
|
|
|
|
|
} |
311
|
|
|
|
|
|
|
); |
312
|
|
|
|
|
|
|
|
313
|
0
|
|
|
|
|
|
$self->normal_mode(); |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
# B |
316
|
0
|
0
|
|
|
|
|
if ($self->{'COLOR_ORDER'} == $self->{'BGR'}) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
317
|
0
|
|
|
|
|
|
($R,$G,$B) = (255,0,0); |
318
|
|
|
|
|
|
|
} elsif ($self->{'COLOR_ORDER'} == $self->{'BRG'}) { |
319
|
0
|
|
|
|
|
|
($R,$G,$B) = (0,255,0); |
320
|
|
|
|
|
|
|
} elsif ($self->{'COLOR_ORDER'} == $self->{'RGB'}) { |
321
|
0
|
|
|
|
|
|
($R,$G,$B) = (0,0,255); |
322
|
|
|
|
|
|
|
} elsif ($self->{'COLOR_ORDER'} == $self->{'RBG'}) { |
323
|
0
|
|
|
|
|
|
($R,$G,$B) = (0,255,0); |
324
|
|
|
|
|
|
|
} elsif ($self->{'COLOR_ORDER'} == $self->{'GRB'}) { |
325
|
0
|
|
|
|
|
|
($R,$G,$B) = (0,0,255); |
326
|
|
|
|
|
|
|
} elsif ($self->{'COLOR_ORDER'} == $self->{'GBR'}) { |
327
|
0
|
|
|
|
|
|
($R,$G,$B) = (255,0,0); |
328
|
|
|
|
|
|
|
} |
329
|
0
|
|
|
|
|
|
$self->set_color({ 'red' => $R, 'green' => $G, 'blue' => $B, 'alpha' => 255 }); |
330
|
|
|
|
|
|
|
|
331
|
0
|
|
|
|
|
|
$self->polygon( |
332
|
|
|
|
|
|
|
{ |
333
|
|
|
|
|
|
|
'coordinates' => [ |
334
|
|
|
|
|
|
|
(270 * $hf) + $X, |
335
|
|
|
|
|
|
|
(250 * $vf) + $Y, |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
(270 * $hf) + $X, |
338
|
|
|
|
|
|
|
(150 * $vf) + $Y, |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
(320 * $hf) + $X, |
341
|
|
|
|
|
|
|
(150 * $vf) + $Y, |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
(320 * $hf) + $X, |
344
|
|
|
|
|
|
|
(250 * $vf) + $Y, |
345
|
|
|
|
|
|
|
], |
346
|
|
|
|
|
|
|
'filled' => TRUE, |
347
|
|
|
|
|
|
|
} |
348
|
|
|
|
|
|
|
); |
349
|
0
|
|
|
|
|
|
$self->circle( |
350
|
|
|
|
|
|
|
{ |
351
|
|
|
|
|
|
|
'x' => (320 * $hf) + $X, |
352
|
|
|
|
|
|
|
'y' => (175 * $vf) + $Y, |
353
|
|
|
|
|
|
|
'radius' => 25 * $vf, |
354
|
|
|
|
|
|
|
'filled' => TRUE |
355
|
|
|
|
|
|
|
} |
356
|
|
|
|
|
|
|
); |
357
|
0
|
|
|
|
|
|
$self->circle( |
358
|
|
|
|
|
|
|
{ |
359
|
|
|
|
|
|
|
'x' => (320 * $hf) + $X, |
360
|
|
|
|
|
|
|
'y' => (225 * $vf) + $Y, |
361
|
|
|
|
|
|
|
'radius' => 25 * $vf, |
362
|
|
|
|
|
|
|
'filled' => TRUE |
363
|
|
|
|
|
|
|
} |
364
|
|
|
|
|
|
|
); |
365
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
# Accelerated shadow |
367
|
0
|
|
|
|
|
|
$self->set_color({ 'red' => 32, 'green' => 0, 'blue' => 0, 'alpha' => 255 }); |
368
|
0
|
|
|
|
|
|
$self->rbox( |
369
|
|
|
|
|
|
|
{ |
370
|
|
|
|
|
|
|
'x' => (478 * $hf) + $X, |
371
|
|
|
|
|
|
|
'y' => (208 * $vf) + $Y, |
372
|
|
|
|
|
|
|
'width' => (1230 * $hf), |
373
|
|
|
|
|
|
|
'height' => (150 * $vf), |
374
|
|
|
|
|
|
|
'radius' => 30 * $vf, |
375
|
|
|
|
|
|
|
'filled' => TRUE, |
376
|
|
|
|
|
|
|
} |
377
|
|
|
|
|
|
|
); |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
# Accelerated green-yellow |
380
|
0
|
|
|
|
|
|
$self->rbox( |
381
|
|
|
|
|
|
|
{ |
382
|
|
|
|
|
|
|
'x' => (470 * $hf) + $X, |
383
|
|
|
|
|
|
|
'y' => (200 * $vf) + $Y, |
384
|
|
|
|
|
|
|
'width' => (1230 * $hf), |
385
|
|
|
|
|
|
|
'height' => (150 * $vf), |
386
|
|
|
|
|
|
|
'radius' => 30 * $vf, |
387
|
|
|
|
|
|
|
'filled' => TRUE, |
388
|
|
|
|
|
|
|
'gradient' => { |
389
|
|
|
|
|
|
|
'direction' => 'vertical', |
390
|
|
|
|
|
|
|
'colors' => { |
391
|
|
|
|
|
|
|
'red' => [0, 255, 255, 255], |
392
|
|
|
|
|
|
|
'green' => [255, 255, 255, 0], |
393
|
|
|
|
|
|
|
'blue' => [0, 0, 0, 255], |
394
|
|
|
|
|
|
|
'alpha' => [255, 255, 255, 255], |
395
|
|
|
|
|
|
|
}, |
396
|
|
|
|
|
|
|
} |
397
|
|
|
|
|
|
|
} |
398
|
|
|
|
|
|
|
); |
399
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
{ |
401
|
0
|
|
|
|
|
|
my $t = 'Perl Drawing Mode'; |
|
0
|
|
|
|
|
|
|
402
|
0
|
0
|
|
|
|
|
if ($self->{'ACCELERATED'} == 1) { |
|
|
0
|
|
|
|
|
|
403
|
0
|
|
|
|
|
|
$t = 'C Assisted Mode'; |
404
|
|
|
|
|
|
|
} elsif ($self->{'ACCELERATED'} == 2) { |
405
|
0
|
|
|
|
|
|
$t = 'GPU Assisted Mode'; |
406
|
|
|
|
|
|
|
} |
407
|
|
|
|
|
|
|
$self->ttf_print( |
408
|
|
|
|
|
|
|
$self->ttf_print( |
409
|
|
|
|
|
|
|
{ |
410
|
|
|
|
|
|
|
'bounding_box' => TRUE, |
411
|
|
|
|
|
|
|
'x' => (510 * $hf) + $X, |
412
|
|
|
|
|
|
|
'y' => (351 * $vf) + $Y, |
413
|
|
|
|
|
|
|
'height' => 110 * $vf, |
414
|
|
|
|
|
|
|
'wscale' => .9, |
415
|
|
|
|
|
|
|
'color' => '0101FFFF', |
416
|
|
|
|
|
|
|
'text' => $t, |
417
|
|
|
|
|
|
|
'bounding_box' => TRUE, |
418
|
|
|
|
|
|
|
'center' => 0, |
419
|
0
|
0
|
|
|
|
|
'antialias' => ($self->{'BITS'} >= 24) ? TRUE : FALSE |
420
|
|
|
|
|
|
|
} |
421
|
|
|
|
|
|
|
) |
422
|
|
|
|
|
|
|
); |
423
|
|
|
|
|
|
|
} |
424
|
0
|
0
|
|
|
|
|
if ($self->{'BITS'} >= 24) { |
425
|
|
|
|
|
|
|
my $shadow = $self->ttf_print( |
426
|
|
|
|
|
|
|
{ |
427
|
|
|
|
|
|
|
'bounding_box' => TRUE, |
428
|
|
|
|
|
|
|
'x' => 0, |
429
|
|
|
|
|
|
|
'y' => (621 * $vf) + $Y, |
430
|
|
|
|
|
|
|
'height' => 200 * $vf, |
431
|
|
|
|
|
|
|
'wscale' => 1, |
432
|
|
|
|
|
|
|
'color' => ($self->{'GPU'} !~ /nouveaufb/) ? '221100A0' : '221100FF', |
433
|
|
|
|
|
|
|
'text' => 'Graphics-Framebuffer', |
434
|
|
|
|
|
|
|
'bounding_box' => TRUE, |
435
|
0
|
0
|
|
|
|
|
'center' => $self->{'CENTER_X'}, |
436
|
|
|
|
|
|
|
'antialias' => TRUE |
437
|
|
|
|
|
|
|
} |
438
|
|
|
|
|
|
|
); |
439
|
0
|
0
|
|
|
|
|
if ($shadow->{'pwidth'} > (1500 * $hf)) { |
440
|
0
|
|
|
|
|
|
$shadow->{'bounding_box'} = TRUE; |
441
|
0
|
|
|
|
|
|
$shadow->{'wscale'} = int(1500 * $hf) / $shadow->{'pwidth'}; |
442
|
0
|
|
|
|
|
|
$shadow = $self->ttf_print($shadow); |
443
|
|
|
|
|
|
|
} |
444
|
0
|
|
|
|
|
|
$shadow->{'x'} += max(1, 8 * $hf); |
445
|
0
|
|
|
|
|
|
$shadow->{'y'} += max(1, 8 * $vf); |
446
|
0
|
|
|
|
|
|
delete($shadow->{'center'}); |
447
|
0
|
|
|
|
|
|
$self->ttf_print($shadow); |
448
|
|
|
|
|
|
|
} ## end if ($self->{'BITS'} >=...) |
449
|
|
|
|
|
|
|
my $gfb = $self->ttf_print( |
450
|
|
|
|
|
|
|
{ |
451
|
|
|
|
|
|
|
'bounding_box' => TRUE, |
452
|
|
|
|
|
|
|
'x' => 0, |
453
|
|
|
|
|
|
|
'y' => (621 * $vf) + $Y, |
454
|
|
|
|
|
|
|
'height' => 200 * $vf, |
455
|
|
|
|
|
|
|
'wscale' => 1, |
456
|
|
|
|
|
|
|
'color' => 'FFFF00FF', |
457
|
|
|
|
|
|
|
'text' => 'Graphics-Framebuffer', |
458
|
|
|
|
|
|
|
'bounding_box' => TRUE, |
459
|
|
|
|
|
|
|
'center' => $self->{'CENTER_X'}, |
460
|
0
|
0
|
|
|
|
|
'antialias' => ($self->{'BITS'} >= 24) ? TRUE : FALSE |
461
|
|
|
|
|
|
|
} |
462
|
|
|
|
|
|
|
); |
463
|
0
|
0
|
|
|
|
|
if ($gfb->{'pwidth'} > (1500 * $hf)) { |
464
|
0
|
|
|
|
|
|
$gfb->{'bounding_box'} = TRUE; |
465
|
0
|
|
|
|
|
|
$gfb->{'wscale'} = int(1500 * $hf) / $gfb->{'pwidth'}; |
466
|
0
|
|
|
|
|
|
$gfb = $self->ttf_print($gfb); |
467
|
|
|
|
|
|
|
} |
468
|
0
|
|
|
|
|
|
$self->ttf_print($gfb); |
469
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
my $rk = $self->ttf_print( |
471
|
|
|
|
|
|
|
{ |
472
|
|
|
|
|
|
|
'bounding_box' => TRUE, |
473
|
|
|
|
|
|
|
'x' => 0, |
474
|
|
|
|
|
|
|
'y' => (632 * $vf) + $Y, |
475
|
|
|
|
|
|
|
'height' => 50 * $vf, |
476
|
|
|
|
|
|
|
'wscale' => 1, |
477
|
|
|
|
|
|
|
'color' => '00EE00FF', |
478
|
|
|
|
|
|
|
'text' => 'by Richard Kelsch', |
479
|
|
|
|
|
|
|
'bounding_box' => TRUE, |
480
|
|
|
|
|
|
|
'center' => FALSE, |
481
|
0
|
0
|
|
|
|
|
'antialias' => ($self->{'BITS'} >= 24) ? TRUE : FALSE |
482
|
|
|
|
|
|
|
} |
483
|
|
|
|
|
|
|
); |
484
|
0
|
|
|
|
|
|
$rk->{'x'} = (1710 * $hf) - $rk->{'pwidth'}; |
485
|
0
|
|
|
|
|
|
$self->ttf_print($rk); |
486
|
|
|
|
|
|
|
|
487
|
0
|
0
|
0
|
|
|
|
$self->alpha_mode() if ($self->{'GPU'} !~ /nouveaufb/ && $self->{'ACCELERATED'}); # Nouveau totally sucks for framebuffer work, so we disable alpha |
488
|
|
|
|
|
|
|
|
489
|
0
|
|
|
|
|
|
$self->rbox( |
490
|
|
|
|
|
|
|
{ |
491
|
|
|
|
|
|
|
'x' => (188 * $hf) + $X, |
492
|
|
|
|
|
|
|
'y' => (640 * $vf) + $Y, |
493
|
|
|
|
|
|
|
'width' => (1580 * $hf), |
494
|
|
|
|
|
|
|
'height' => (280 * $vf), |
495
|
|
|
|
|
|
|
|
496
|
|
|
|
|
|
|
# 'radius' => 30 * $vf, |
497
|
|
|
|
|
|
|
'filled' => TRUE, |
498
|
|
|
|
|
|
|
'gradient' => { |
499
|
|
|
|
|
|
|
'direction' => 'horizontal', |
500
|
|
|
|
|
|
|
'colors' => { |
501
|
|
|
|
|
|
|
'red' => [32, 0, 32], |
502
|
|
|
|
|
|
|
'green' => [0, 0, 0], |
503
|
|
|
|
|
|
|
'blue' => [0, 255, 0], |
504
|
|
|
|
|
|
|
'alpha' => [64, 128, 64] |
505
|
|
|
|
|
|
|
} |
506
|
|
|
|
|
|
|
} |
507
|
|
|
|
|
|
|
} |
508
|
|
|
|
|
|
|
); |
509
|
|
|
|
|
|
|
|
510
|
0
|
|
|
|
|
|
$self->normal_mode(); |
511
|
|
|
|
|
|
|
$self->ttf_print( |
512
|
|
|
|
|
|
|
$self->ttf_print( |
513
|
|
|
|
|
|
|
{ |
514
|
|
|
|
|
|
|
'bounding_box' => TRUE, |
515
|
|
|
|
|
|
|
'x' => 0, |
516
|
|
|
|
|
|
|
'y' => (785 * $vf) + $Y, |
517
|
|
|
|
|
|
|
'height' => 118 * $vf, |
518
|
|
|
|
|
|
|
'wscale' => 1, |
519
|
|
|
|
|
|
|
'color' => 'FFFFFFFF', |
520
|
|
|
|
|
|
|
'text' => sprintf('Version %.02f', $version), |
521
|
|
|
|
|
|
|
'bounding_box' => TRUE, |
522
|
|
|
|
|
|
|
'center' => $self->{'CENTER_X'}, |
523
|
0
|
0
|
|
|
|
|
'antialias' => ($self->{'BITS'} >= 24) ? TRUE : FALSE |
524
|
|
|
|
|
|
|
} |
525
|
|
|
|
|
|
|
) |
526
|
|
|
|
|
|
|
); |
527
|
|
|
|
|
|
|
my $scaleit = $self->ttf_print( |
528
|
|
|
|
|
|
|
{ |
529
|
|
|
|
|
|
|
'bounding_box' => TRUE, |
530
|
|
|
|
|
|
|
'x' => 0, |
531
|
|
|
|
|
|
|
'y' => (915 * $vf) + $Y, |
532
|
|
|
|
|
|
|
'height' => 118 * $vf, |
533
|
|
|
|
|
|
|
'wscale' => 1, |
534
|
|
|
|
|
|
|
'color' => 'FFFFFFFF', |
535
|
|
|
|
|
|
|
'text' => sprintf('%dx%d-%02d on %s', $self->{'XRES'}, $self->{'YRES'}, $self->{'BITS'}, $self->{'GPU'}), |
536
|
|
|
|
|
|
|
'bounding_box' => TRUE, |
537
|
|
|
|
|
|
|
'center' => $self->{'CENTER_X'}, |
538
|
0
|
0
|
|
|
|
|
'antialias' => ($self->{'BITS'} >= 24) ? TRUE : FALSE |
539
|
|
|
|
|
|
|
} |
540
|
|
|
|
|
|
|
); |
541
|
0
|
0
|
|
|
|
|
if ($scaleit->{'pwidth'} > int(1500 * $hf)) { |
542
|
0
|
|
|
|
|
|
$scaleit->{'bounding_box'} = TRUE; |
543
|
0
|
|
|
|
|
|
$scaleit->{'wscale'} = int(1500 * $hf) / $scaleit->{'pwidth'}; |
544
|
0
|
|
|
|
|
|
$scaleit = $self->ttf_print($scaleit); |
545
|
|
|
|
|
|
|
} |
546
|
0
|
|
|
|
|
|
$self->ttf_print($scaleit); |
547
|
0
|
|
|
|
|
|
$self->_perl_logo(); |
548
|
0
|
|
|
|
|
|
$self->normal_mode(); |
549
|
|
|
|
|
|
|
} ## end sub splash |
550
|
|
|
|
|
|
|
|
551
|
|
|
|
|
|
|
1; |
552
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
=head1 NAME |
554
|
|
|
|
|
|
|
|
555
|
|
|
|
|
|
|
Graphics::Framebuffer::Splash |
556
|
|
|
|
|
|
|
|
557
|
|
|
|
|
|
|
=head1 DESCRIPTION |
558
|
|
|
|
|
|
|
|
559
|
|
|
|
|
|
|
See the "Graphics::Frambuffer" documentation, as methods within here are pulled into the main module |
560
|
|
|
|
|
|
|
|
561
|
|
|
|
|
|
|
=cut |
562
|
|
|
|
|
|
|
|