COVERAGE SUMMARY
FILE SUMMARY
NameExecutedRoutines%ExecutedLines%Unexecuted
/home/matt/eu/rds/include/std/graphcst.e030.00%365072.00%14
ROUTINE SUMMARY
RoutineExecutedLinesUnexecuted
mixture()0100.00%10
color()020.00%2
video_config()020.00%2
LINE COVERAGE DETAIL
#Executed
1
-- (c) Copyright - See License.txt
2
--
3
4
--****
5
-- === Error Code Constants
6
--
7
namespace graphcst
8
9
public enum
104
BMP_SUCCESS,
114
BMP_OPEN_FAILED,
124
BMP_UNEXPECTED_EOF,
134
BMP_UNSUPPORTED_FORMAT,
144
BMP_INVALID_MODE
15
16
--****
17
-- === video_config sequence accessors
18
19
public enum
204
VC_COLOR,
214
VC_MODE,
224
VC_LINES,
234
VC_COLUMNS,
244
VC_XPIXELS,
254
VC_YPIXELS,
264
VC_NCOLORS,
274
VC_PAGES,
284
VC_SCRNLINES,
294
VC_SCRNCOLS
30
31
-- COLOR values -- for characters and pixels
32
--** in graphics modes BLACK is "transparent"
33
34
35
--****
36
-- ==== Colors
37
--
38
39
public constant
404
BLACK = 0,
414
BLUE = 1,
424
GREEN = 2,
434
CYAN = 3,
444
RED = 4,
454
MAGENTA = 5,
464
BROWN = 6,
474
WHITE = 7,
484
GRAY = 8,
494
BRIGHT_BLUE = 9,
504
BRIGHT_GREEN = 10,
514
BRIGHT_CYAN = 11,
524
BRIGHT_RED = 12,
534
BRIGHT_MAGENTA = 13,
544
YELLOW = 14,
554
BRIGHT_WHITE = 15,
56
$
57
584
ifdef OSX then
59
export constant true_color = { 0, 4, 2, 6, 1, 5, 3, 7, 8,12,10,14, 9,13,11,15,
60
16,20,18,22,17,21,19,23,24,28,26,28,25,29,17,31}
61
-- BLACK = 0,
62
-- RED = 1,
63
-- GREEN = 2,
64
-- BROWN = 3,
65
-- BLUE = 4,
66
-- MAGENTA = 5,
67
-- CYAN = 6,
68
-- WHITE = 7,
69
-- GRAY = 8,
70
-- BRIGHT_RED = 9,
71
-- BRIGHT_GREEN = 10,
72
-- YELLOW = 11,
73
-- BRIGHT_BLUE = 12,
74
-- BRIGHT_MAGENTA = 13,
75
-- BRIGHT_CYAN = 14,
76
-- BRIGHT_WHITE = 15,
77
elsifdef UNIX then
784
export constant true_color = { 0, 4, 2, 6, 1, 5, 3, 7, 8,12,10,14, 9,13,11,15,
79
16,20,18,22,17,21,19,23,24,28,26,28,25,29,17,31}
80
-- BLACK = 0,
81
-- RED = 1,
82
-- GREEN = 2,
83
-- BROWN = 3,
84
-- BLUE = 4,
85
-- MAGENTA = 5,
86
-- CYAN = 6,
87
-- WHITE = 7,
88
-- GRAY = 8,
89
-- BRIGHT_RED = 9,
90
-- BRIGHT_GREEN = 10,
91
-- YELLOW = 11,
92
-- BRIGHT_BLUE = 12,
93
-- BRIGHT_MAGENTA = 13,
94
-- BRIGHT_CYAN = 14,
95
-- BRIGHT_WHITE = 15,
96
end ifdef
97
98
--**
99
-- Add to color to get blinking text
1004
public constant BLINKING = 16
101
1024
public constant BYTES_PER_CHAR = 2
103
1040
1050
return x >= 0 and x <= 255
106
end type
107
108
--****
109
-- === Routines
110
111
--**
112
-- Mixture Type
113
--
114
-- Comments:
115
--
116
-- A mixture is a ##{red, green, blue}## triple of intensities, which enables you to define
117
-- custom colors. Intensities must be from 0 (weakest) to 63 (strongest). Thus, the brightest
118
-- white is {63, 63, 63}.
119
1200
1210
if length(s) != 3 then
1220
return 0
123
end if
1240
for i=1 to 3 do
1250
if not integer(s[i]) then
1260
return 0
127
end if
1280
if and_bits(s[i],#FFFFFFC0) then
1290
return 0
130
end if
1310
end for
1320
return 1
133
end type
134
135
constant
1364
M_VIDEO_CONFIG = 13
137
138
--**
139
-- Return a description of the current video configuration:
140
--
141
-- Returns:
142
-- A **sequence**, of 10 non-negative integers, laid out as follows:
143
-- # color monitor? ~-- 1 0 if monochrome, 1 otherwise
144
-- # current video mode
145
-- # number of text rows in console buffer
146
-- # number of text columns in console buffer
147
-- # screen width in pixels
148
-- # screen height in pixels
149
-- # number of colors
150
-- # number of display pages
151
-- # number of text rows for current screen size
152
-- # number of text columns for current screen size
153
--
154
-- Comments:
155
--
156
-- A public enum is available for convenient access to the returned configuration data:
157
-- * ##VC_COLOR##
158
-- * ##VC_MODE##
159
-- * ##VC_LINES##
160
-- * ##VC_COLUMNS##
161
-- * ##VC_XPIXELS##
162
-- * ##VC_YPIXELS##
163
-- * ##VC_NCOLORS##
164
-- * ##VC_PAGES##
165
-- * ##VC_LINES##
166
-- * ##VC_COLUMNS##
167
-- * ##VC_SCRNLINES##
168
-- * ##VC_SCRNCOLS##
169
--
170
-- This routine makes it easy for you to parameterize a program so it will work in many
171
-- different graphics modes.
172
--
173
-- Example:
174
--
175
-- vc = video_config()
176
-- -- vc could be {1, 3, 300, 132, 0, 0, 32, 8, 37, 90}
177
--
178
--
179
-- See Also:
180
-- [[:graphics_mode]]
181
1820
1830
return machine_func(M_VIDEO_CONFIG, 0)
184
end function
185