-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathff_api_blend_menu_overlay.lua
376 lines (353 loc) · 20.8 KB
/
ff_api_blend_menu_overlay.lua
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
-- Replicates an input map as an array
-- needs these controls
-- map - Pattern (DOT)
-- map - Background (BACKGROUND)
function prepare()
-- blending mode inputs and initialization
BL_MODE = get_intslider_input(BLENDING_MODE)
if (get_checkbox_input(HDR)) then
hdr = true
else
hdr = false
end
-- function add_offset(x, y) controls
xo = 0.98 -- 1 - get_slider_input(X_OFFSET)
yo = 0.98 -- 1 - get_slider_input(Y_OFFSET)
-- text display initialization code; hardcoding can be used in text display mode
NumberOfColumns = 40 -- get_intslider_input(COLUMNS)
NumberOfRows = 20 -- get_intslider_input(ROWS)
xScaleFactor = OUTPUT_WIDTH / OUTPUT_HEIGHT
TextOption = BL_MODE -- get_intslider_input(TEXT_SELECTOR)
messages = {}
messages[1] = " Blend Normal"
messages[2] = " Blend Darken"
messages[3] = " Blend Multiply"
messages[4] = " Blend Color Burn"
messages[5] = " Blend Linear Burn"
messages[6] = " Blend Lighten"
messages[7] = " Blend Screen"
messages[8] = " Blend Color Dodge"
messages[9] = " Blend Linear Dodge"
messages[10] = " Blend Overlay"
messages[11] = " Blend Soft Light"
messages[12] = " Blend Hard Light"
messages[13] = " Blend Vivid Light"
messages[14] = " Blend Linear Light"
messages[15] = " Blend Difference"
messages[16] = " Blend Hue"
messages[17] = " Blend Saturation"
messages[18] = " Blend Color"
messages[19] = " Blend Luminosity"
message = messages[TextOption]
msgColRow = {} -- define a table with the message chars in it NOTE: 0 based Table
local charIndex = 1
local sl = string.len(message)
local r, c, cv
for r = 0, NumberOfRows - 1 do
msgColRow[r] = {}
for c = 0, NumberOfColumns - 1 do
if charIndex <= sl then
cv = string.byte(message,charIndex)
msgColRow[r][c] = cv -- get the char as a number
else
msgColRow[r][c] = -1
end
charIndex = charIndex + 1
end
end
matrix = {}
state = true -- get_checkbox_input(SMALL_FONT)
if state then
matrixRows = 12
matrixCols = 7
matrix[32]={0,0,0,0,0,0,0,0,0,0,0} -- [ ]
matrix[33]={0,8,8,8,8,8,0,12,12,0,0} -- [!]
matrix[34]={0,20,20,20,0,0,0,0,0,0,0} -- ["]
matrix[35]={0,20,20,126,20,40,126,40,40,0,0} -- [#]
matrix[36]={8,28,40,40,24,12,10,18,60,16,0} -- [$]
matrix[37]={0,113,82,84,120,14,26,42,78,0,0} -- [%]
matrix[38]={0,28,36,36,24,42,78,70,63,0,0} -- [&]
matrix[39]={0,8,8,8,0,0,0,0,0,0,0} -- [']
matrix[40]={4,8,8,16,16,16,16,16,8,8,4} -- [(]
matrix[41]={16,8,8,4,4,4,4,4,8,8,16} -- [)]
matrix[42]={0,8,42,28,42,8,0,0,0,0,0} -- [*]
matrix[43]={0,0,0,8,8,62,8,8,0,0,0} -- [+]
matrix[44]={0,0,0,0,0,0,0,24,24,24,48} -- [,]
matrix[45]={0,0,0,0,0,30,0,0,0,0,0} -- [-]
matrix[46]={0,0,0,0,0,0,0,24,24,0,0} -- [.]
matrix[47]={0,2,4,4,8,8,8,16,16,32,0} -- [/]
matrix[48]={0,30,19,35,37,41,49,50,30,0,0} -- [0]
matrix[49]={0,24,40,8,8,8,8,8,62,0,0} -- [1]
matrix[50]={0,28,34,2,2,4,8,16,62,0,0} -- [2]
matrix[51]={0,60,2,2,28,2,2,2,60,0,0} -- [3]
matrix[52]={0,12,12,20,36,68,126,4,4,0,0} -- [4]
matrix[53]={0,62,32,32,60,2,2,6,60,0,0} -- [5]
matrix[54]={0,28,16,32,60,34,34,34,28,0,0} -- [6]
matrix[55]={0,62,2,4,4,8,8,24,16,0,0} -- [7]
matrix[56]={0,28,34,50,28,54,34,34,28,0,0} -- [8]
matrix[57]={0,28,34,34,34,30,2,4,56,0,0} -- [9]
matrix[58]={0,0,0,24,24,0,0,24,24,0,0} -- [:]
matrix[59]={0,0,0,24,24,0,0,24,24,24,48} -- [;]
matrix[60]={0,0,2,12,16,32,16,12,2,0,0} -- [<]
matrix[61]={0,0,0,0,62,0,62,0,0,0,0} -- [=]
matrix[62]={0,0,32,24,4,2,4,24,32,0,0} -- [>]
matrix[63]={0,24,6,2,2,28,0,24,24,0,0} -- [?]
matrix[64]={0,30,51,33,77,85,85,94,64,32,60} -- [@]
matrix[65]={0,8,20,20,20,34,62,34,34,0,0} -- [A]
matrix[66]={0,60,34,34,60,34,34,34,60,0,0} -- [B]
matrix[67]={0,14,16,32,32,32,32,48,30,0,0} -- [C]
matrix[68]={0,60,38,34,34,34,34,36,60,0,0} -- [D]
matrix[69]={0,60,32,32,60,32,32,32,60,0,0} -- [E]
matrix[70]={0,60,32,32,60,32,32,32,32,0,0} -- [F]
matrix[71]={0,30,32,64,78,66,66,34,30,0,0} -- [G]
matrix[72]={0,34,34,34,62,34,34,34,34,0,0} -- [H]
matrix[73]={0,62,8,8,8,8,8,8,62,0,0} -- [I]
matrix[74]={0,60,4,4,4,4,4,4,56,0,0} -- [J]
matrix[75]={0,34,36,40,48,48,40,36,34,0,0} -- [K]
matrix[76]={0,32,32,32,32,32,32,32,60,0,0} -- [L]
matrix[77]={0,34,34,54,54,42,34,34,35,0,0} -- [M]
matrix[78]={0,50,50,50,42,42,38,38,38,0,0} -- [N]
matrix[79]={0,60,38,66,66,66,66,100,60,0,0} -- [O]
matrix[80]={0,60,34,34,34,60,32,32,32,0,0} -- [P]
matrix[81]={0,60,38,66,66,66,66,100,60,16,14} -- [Q]
matrix[82]={0,60,34,34,34,60,38,34,35,0,0} -- [R]
matrix[83]={0,30,32,32,24,4,2,2,60,0,0} -- [S]
matrix[84]={0,62,8,8,8,8,8,8,8,0,0} -- [T]
matrix[85]={0,34,34,34,34,34,34,34,28,0,0} -- [U]
matrix[86]={0,34,34,34,52,20,20,20,8,0,0} -- [V]
matrix[87]={0,34,34,34,42,54,54,54,34,0,0} -- [W]
matrix[88]={0,102,36,28,24,24,20,34,99,0,0} -- [X]
matrix[89]={0,65,34,54,20,8,8,8,8,0,0} -- [Y]
matrix[90]={0,62,4,4,8,8,16,16,62,0,0} -- [Z]
matrix[91]={0,28,16,16,16,16,16,16,16,16,28} -- [[]
matrix[92]={0,32,16,16,8,8,8,4,4,2,0} -- [\]
matrix[93]={0,28,4,4,4,4,4,4,4,4,28} -- []]
matrix[94]={0,8,20,34,34,0,0,0,0,0,0} -- [^]
matrix[95]={0,0,0,0,0,0,0,0,0,0,127} -- [_]
matrix[96]={48,24,0,0,0,0,0,0,0,0,0} -- [`]
matrix[97]={0,0,0,28,2,30,34,38,30,0,0} -- [a]
matrix[98]={0,32,32,60,50,34,34,34,60,0,0} -- [b]
matrix[99]={0,0,0,30,48,32,32,48,30,0,0} -- [c]
matrix[100]={0,2,2,30,34,34,34,38,26,0,0} -- [d]
matrix[101]={0,0,0,28,34,62,32,48,30,0,0} -- [e]
matrix[102]={0,15,16,16,126,16,16,16,16,0,0} -- [f]
matrix[103]={0,0,0,31,34,34,60,32,62,34,60} -- [g]
matrix[104]={0,32,32,44,50,34,34,34,34,0,0} -- [h]
matrix[105]={12,12,0,56,8,8,8,8,62,0,0} -- [i]
matrix[106]={12,12,0,60,4,4,4,4,4,4,56} -- [j]
matrix[107]={0,32,32,36,40,48,40,36,34,0,0} -- [k]
matrix[108]={0,56,8,8,8,8,8,8,62,0,0} -- [l]
matrix[109]={0,0,0,62,42,42,42,42,42,0,0} -- [m]
matrix[110]={0,0,0,60,50,34,34,34,34,0,0} -- [n]
matrix[111]={0,0,0,28,34,34,34,34,28,0,0} -- [o]
matrix[112]={0,0,0,60,50,34,34,34,60,32,32} -- [p]
matrix[113]={0,0,0,30,34,34,34,38,26,2,2} -- [q]
matrix[114]={0,0,0,46,50,32,32,32,32,0,0} -- [r]
matrix[115]={0,0,0,28,32,48,12,4,56,0,0} -- [s]
matrix[116]={0,16,16,124,16,16,16,16,28,0,0} -- [t]
matrix[117]={0,0,0,34,34,34,34,38,30,0,0} -- [u]
matrix[118]={0,0,0,34,34,34,20,20,8,0,0} -- [v]
matrix[119]={0,0,0,34,42,42,46,54,18,0,0} -- [w]
matrix[120]={0,0,0,54,20,8,20,34,99,0,0} -- [x]
matrix[121]={0,0,0,34,34,20,20,24,8,16,112} -- [y]
matrix[122]={0,0,0,62,4,8,8,16,62,0,0} -- [z]
matrix[123]={0,6,8,8,8,48,8,8,8,8,6} -- [{]
matrix[124]={8,8,8,8,8,8,8,8,8,8,8} -- [|]
matrix[125]={0,48,8,8,8,6,8,8,8,8,48} -- [}]
matrix[126]={0,0,0,0,0,114,78,0,0,0,0} -- [~]
else
matrixRows = 24
matrixCols = 14
matrix[32]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} -- [ ]
matrix[33]={0,0,384,384,384,384,384,384,384,384,384,384,384,384,0,0,448,448,448,0,0,0,0,0} -- [!]
matrix[34]={0,0,1848,1848,1848,1848,1848,1848,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} -- ["]
matrix[35]={0,0,0,0,408,408,408,408,4094,4094,816,816,816,8188,8188,1632,1632,1632,1632,0,0,0,0,0} -- [#]
matrix[36]={0,192,192,1008,4080,7296,6272,6272,7552,3968,1984,480,496,408,280,280,4920,8176,4032,768,768,768,0,0} -- [$]
matrix[37]={0,0,3846,8076,12696,12696,12720,16224,7776,192,384,384,828,638,1734,3270,3270,6396,12408,0,0,0,0,0} -- [%]
matrix[38]={0,0,960,2016,3696,3120,3120,3184,1760,1984,1792,3980,7628,6380,6264,6200,7288,4092,1998,0,0,0,0,0} -- [&]
matrix[39]={0,0,448,448,448,448,448,448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} -- [']
matrix[40]={0,0,16,56,112,96,192,384,384,384,768,768,768,768,768,768,896,384,384,192,224,112,56,16} -- [(]
matrix[41]={0,0,512,1792,896,448,192,96,96,112,48,48,48,48,48,48,96,96,96,192,384,896,1792,512} -- [)]
matrix[42]={0,0,192,192,1224,3804,480,480,3804,3272,192,192,0,0,0,0,0,0,0,0,0,0,0,0} -- [*]
matrix[43]={0,0,0,0,0,0,192,192,192,192,192,8190,8190,192,192,192,192,192,0,0,0,0,0,0} -- [+]
matrix[44]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,448,480,480,224,224,448,1920,1792,0} -- [,]
matrix[45]={0,0,0,0,0,0,0,0,0,0,0,0,2032,2032,0,0,0,0,0,0,0,0,0,0} -- [-]
matrix[46]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,480,480,192,0,0,0,0,0} -- [.]
matrix[47]={0,0,24,48,48,48,96,96,192,192,192,384,384,768,768,768,1536,1536,3072,3072,3072,6144,0,0} -- [/]
matrix[48]={0,0,0,0,992,2032,3640,3096,6172,6204,6380,6604,7052,7692,7180,3096,3640,2032,992,0,0,0,0,0} -- [0]
matrix[49]={0,0,0,0,448,1984,3776,1216,192,192,192,192,192,192,192,192,192,4092,4092,0,0,0,0,0} -- [1]
matrix[50]={0,0,0,0,992,2032,3640,1048,24,24,56,48,96,192,384,768,1536,4092,4092,0,0,0,0,0} -- [2]
matrix[51]={0,0,0,0,1984,4064,2160,48,48,96,960,1008,56,24,24,24,48,4080,4032,0,0,0,0,0} -- [3]
matrix[52]={0,0,0,0,112,240,240,432,816,816,1584,1584,3120,6192,8190,8190,48,48,48,0,0,0,0,0} -- [4]
matrix[53]={0,0,0,0,4080,4080,3072,3072,3072,3072,4064,4080,56,24,24,24,48,4064,4032,0,0,0,0,0} -- [5]
matrix[54]={0,0,0,0,496,1008,1792,3072,2048,6144,7136,8176,7224,6168,6168,6168,3120,4080,960,0,0,0,0,0} -- [6]
matrix[55]={0,0,0,0,8184,8184,24,48,48,96,96,192,192,384,384,768,768,1792,1536,0,0,0,0,0} -- [7]
matrix[56]={0,0,0,0,2016,4080,7224,6168,6168,3696,2016,2016,3696,7224,6168,6168,7224,4080,2016,0,0,0,0,0} -- [8]
matrix[57]={0,0,0,0,960,4080,3120,6168,6168,6168,7224,4088,2008,24,48,48,224,4032,3968,0,0,0,0,0} -- [9]
matrix[58]={0,0,0,0,0,0,0,128,448,448,128,0,0,0,0,128,448,448,128,0,0,0,0,0} -- [:]
matrix[59]={0,0,0,0,0,0,0,128,448,448,128,0,0,0,0,448,480,480,224,224,448,1920,1792,0} -- [;]
matrix[60]={0,0,0,0,0,0,16,56,112,192,896,1792,3584,1792,896,192,112,56,16,0,0,0,0,0} -- [<]
matrix[61]={0,0,0,0,0,0,0,0,0,4092,4092,0,0,4092,4092,0,0,0,0,0,0,0,0,0} -- [=]
matrix[62]={0,0,0,0,0,0,1024,3584,1792,384,224,112,56,112,224,384,1792,3584,1024,0,0,0,0,0} -- [>]
matrix[63]={0,0,896,992,112,56,24,24,24,56,240,240,192,192,0,0,448,448,448,0,0,0,0,0} -- [?]
matrix[64]={0,0,496,792,1548,3084,3078,6150,6390,6646,12726,13110,13094,13158,13158,13158,13164,13308,12728,6144,6144,6144,3600,992} -- [@]
matrix[65]={0,0,0,0,448,352,864,864,816,1584,1584,1560,1048,3096,4092,4092,6158,6150,6150,0,0,0,0,0} -- [A]
matrix[66]={0,0,0,0,4064,4080,3128,3096,3096,3120,4064,4088,3096,3084,3084,3084,3096,4088,4064,0,0,0,0,0} -- [B]
matrix[67]={0,0,0,0,496,2040,3592,3072,7168,6144,6144,6144,6144,6144,7168,3072,3592,2040,496,0,0,0,0,0} -- [C]
matrix[68]={0,0,0,0,8128,8176,6200,6168,6156,6156,6156,6156,6156,6156,6172,6168,6264,8176,8128,0,0,0,0,0} -- [D]
matrix[69]={0,0,0,0,4088,4088,3072,3072,3072,3072,4088,4088,3072,3072,3072,3072,3072,4088,4088,0,0,0,0,0} -- [E]
matrix[70]={0,0,0,0,4088,4088,3072,3072,3072,3072,4088,4088,3072,3072,3072,3072,3072,3072,3072,0,0,0,0,0} -- [F]
matrix[71]={0,0,0,0,504,1020,1796,3072,3072,6144,6268,6268,6156,6156,7180,3084,3596,2044,504,0,0,0,0,0} -- [G]
matrix[72]={0,0,0,0,6156,6156,6156,6156,6156,6156,8188,8188,6156,6156,6156,6156,6156,6156,6156,0,0,0,0,0} -- [H]
matrix[73]={0,0,0,0,4092,4092,192,192,192,192,192,192,192,192,192,192,192,4092,4092,0,0,0,0,0} -- [I]
matrix[74]={0,0,0,0,4080,4080,48,48,48,48,48,48,48,48,48,48,2160,4064,1984,0,0,0,0,0} -- [J]
matrix[75]={0,0,0,0,3084,3096,3120,3168,3296,3264,3456,3840,3456,3264,3296,3184,3120,3096,3084,0,0,0,0,0} -- [K]
matrix[76]={0,0,0,0,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,2044,2044,0,0,0,0,0} -- [L]
matrix[77]={0,0,0,0,7196,7196,7196,7740,6700,7020,7020,6476,6604,6284,6156,6156,6156,6158,6158,0,0,0,0,0} -- [M]
matrix[78]={0,0,0,0,7180,7692,7692,6924,6924,6412,6540,6284,6348,6348,6252,6252,6204,6204,6172,0,0,0,0,0} -- [N]
matrix[79]={0,0,0,0,496,2040,3612,3084,6150,6150,6150,6150,6150,6150,6150,3084,3612,2040,992,0,0,0,0,0} -- [O]
matrix[80]={0,0,0,0,4064,4088,3096,3084,3084,3084,3084,3096,4080,4064,3072,3072,3072,3072,3072,0,0,0,0,0} -- [P]
matrix[81]={0,0,0,0,496,2040,3612,3084,6150,6150,6150,6150,6150,6150,6150,3084,3612,2040,992,192,227,127,60,0} -- [Q]
matrix[82]={0,0,0,0,4064,4080,3128,3096,3096,3096,3120,4080,4032,3168,3184,3120,3128,3096,3100,0,0,0,0,0} -- [R]
matrix[83]={0,0,0,0,992,4080,7184,6144,6144,7168,3840,992,240,56,24,24,4152,8176,4032,0,0,0,0,0} -- [S]
matrix[84]={0,0,0,0,8190,8190,192,192,192,192,192,192,192,192,192,192,192,192,192,0,0,0,0,0} -- [T]
matrix[85]={0,0,0,0,6156,6156,6156,6156,6156,6156,6156,6156,6156,6156,6156,6156,7192,4088,992,0,0,0,0,0} -- [U]
matrix[86]={0,0,0,0,12294,12294,14350,6156,6156,3096,3096,3608,1584,1584,1904,864,864,960,448,0,0,0,0,0} -- [V]
matrix[87]={0,0,0,0,6156,6156,6156,6156,6156,6284,6348,6476,6476,6476,3432,3960,3960,3640,3640,0,0,0,0,0} -- [W]
matrix[88]={0,0,0,0,7182,3084,1560,1848,880,992,448,448,480,880,1840,3640,3096,7196,14350,0,0,0,0,0} -- [X]
matrix[89]={0,0,0,0,8198,12300,14364,6168,3120,3632,1632,2016,960,384,384,384,384,384,384,0,0,0,0,0} -- [Y]
matrix[90]={0,0,0,0,8184,8184,48,112,96,192,192,384,768,768,1536,3584,3072,8188,8188,0,0,0,0,0} -- [Z]
matrix[91]={0,0,1008,1008,768,768,768,768,768,768,768,768,768,768,768,768,768,768,768,768,768,768,1008,1008} -- [[]
matrix[92]={0,0,3072,1536,1536,1536,768,768,384,384,384,192,192,96,96,96,48,48,24,24,24,12,0,0} -- [\]
matrix[93]={0,0,2016,2016,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,2016,2016} -- []]
matrix[94]={0,0,0,0,448,448,864,544,1584,3096,3096,0,0,0,0,0,0,0,0,0,0,0,0,0} -- [^]
matrix[95]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16382,16382} -- [_]
matrix[96]={0,0,1792,896,448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} -- [`]
matrix[97]={0,0,0,0,0,0,0,1008,2040,1052,12,12,1020,2044,3596,3084,3132,4092,1004,0,0,0,0,0} -- [a]
matrix[98]={0,0,3072,3072,3072,3072,3072,3312,4088,3864,3596,3084,3084,3084,3084,3100,3128,4080,2016,0,0,0,0,0} -- [b]
matrix[99]={0,0,0,0,0,0,0,496,1016,1800,3584,3072,3072,3072,3072,3584,1800,2040,496,0,0,0,0,0} -- [c]
matrix[100]={0,0,24,24,24,24,24,1016,2040,3608,7192,6168,6168,6168,6168,6200,3192,4056,1944,0,0,0,0,0} -- [d]
matrix[101]={0,0,0,0,0,0,0,960,2032,3120,6168,6168,8184,8184,6144,6144,3088,4080,992,0,0,0,0,0} -- [e]
matrix[102]={0,0,124,252,448,384,384,384,8184,8184,384,384,384,384,384,384,384,384,384,0,0,0,0,0} -- [f]
matrix[103]={0,0,0,0,0,0,0,1020,2044,3640,3096,3096,3640,2032,4064,6144,6144,4080,4092,6156,6156,7196,4088,2016} -- [g]
matrix[104]={0,0,3072,3072,3072,3072,3072,3296,4080,3896,3608,3096,3096,3096,3096,3096,3096,3096,3096,0,0,0,0,0} -- [h]
matrix[105]={0,0,448,448,448,0,0,4032,4032,192,192,192,192,192,192,192,192,4088,4088,0,0,0,0,0} -- [i]
matrix[106]={0,0,112,112,112,0,0,4080,4080,48,48,48,48,48,48,48,48,48,48,48,48,2144,4064,1984} -- [j]
matrix[107]={0,0,3072,3072,3072,3072,3072,3100,3128,3184,3296,3456,3840,3456,3264,3168,3120,3096,3084,0,0,0,0,0} -- [k]
matrix[108]={0,0,4032,4032,192,192,192,192,192,192,192,192,192,192,192,192,192,4088,4088,0,0,0,0,0} -- [l]
matrix[109]={0,0,0,0,0,0,0,7068,8190,7398,7398,6342,6342,6342,6342,6342,6342,6342,6342,0,0,0,0,0} -- [m]
matrix[110]={0,0,0,0,0,0,0,3296,4080,3896,3608,3096,3096,3096,3096,3096,3096,3096,3096,0,0,0,0,0} -- [n]
matrix[111]={0,0,0,0,0,0,0,992,2040,3640,7196,6156,6156,6156,6156,7196,3640,4080,992,0,0,0,0,0} -- [o]
matrix[112]={0,0,0,0,0,0,0,3312,4088,3864,3596,3084,3084,3084,3084,3100,3128,4080,4064,3072,3072,3072,3072,3072} -- [p]
matrix[113]={0,0,0,0,0,0,0,1016,2040,3608,7192,6168,6168,6168,6168,6200,3192,4088,1944,24,24,24,24,24} -- [q]
matrix[114]={0,0,0,0,0,0,0,3312,3576,3868,3596,3084,3072,3072,3072,3072,3072,3072,3072,0,0,0,0,0} -- [r]
matrix[115]={0,0,0,0,0,0,0,992,2032,3088,3072,3584,1984,496,56,24,2072,4080,2016,0,0,0,0,0} -- [s]
matrix[116]={0,0,0,256,768,768,768,8188,8188,768,768,768,768,768,768,896,384,508,252,0,0,0,0,0} -- [t]
matrix[117]={0,0,0,0,0,0,0,3096,3096,3096,3096,3096,3096,3096,3096,3128,3704,2040,920,0,0,0,0,0} -- [u]
matrix[118]={0,0,0,0,0,0,0,6156,6156,7192,3096,3096,1584,1584,1568,864,864,320,448,0,0,0,0,0} -- [v]
matrix[119]={0,0,0,0,0,0,0,6156,6156,6156,6284,6604,6476,6476,7016,2920,2600,3640,3640,0,0,0,0,0} -- [w]
matrix[120]={0,0,0,0,0,0,0,7196,3608,1584,1904,992,448,448,864,1904,1584,3640,7196,0,0,0,0,0} -- [x]
matrix[121]={0,0,0,0,0,0,0,6156,6156,7192,3096,3096,1584,1584,1888,864,832,448,448,384,896,1792,15872,15360} -- [y]
matrix[122]={0,0,0,0,0,0,0,4088,4088,48,96,96,192,384,768,768,1536,4088,4088,0,0,0,0,0} -- [z]
matrix[123]={0,0,112,240,448,384,384,384,384,384,896,3840,3840,896,384,384,384,384,384,384,384,448,240,112} -- [{]
matrix[124]={192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192} -- [|]
matrix[125]={0,0,1792,1920,448,192,192,192,192,192,224,120,120,224,192,192,192,192,192,192,192,448,1920,1792} -- [}]
matrix[126]={0,0,0,0,0,0,0,0,0,0,1792,3974,6342,6268,56,0,0,0,0,0,0,0,0,0} -- [~]
end
end;
function testBit(number, bit)
if ((number == nil) or (bit == nil) or (bit <= 0)) then
return false
end
p = 2 ^ (bit - 1) -- note: 1-based indexing
return number % (p + p) >= p
end
function get_sample(x, y)
local rf, gf, bf, af = get_sample_map(x, y, FOREGROUND)
local rb, gb, bb, ab = get_sample_map(x, y, BACKGROUND)
local opacity = get_sample_grayscale(x, y, OPACITY)
-- local ro, go, bo, ao = get_sample_map(x , y, DOT)
-- establish overlay - an empty frame
local ro, go, bo, ao = 0, 0, 0, 0
-- this offsets the entire image. text padding must be done another way.
-- x = x + xo
-- if x > 1 then x = x -1 end
-- if x < 0 then x = x + 1 end
-- y = y + yo
-- if y > 1 then y = y -1 end
-- if y < 0 then y = y + 1 end
scaledX = x / xScaleFactor -- get into range [0..1]
if (scaledX >=0 and scaledX <= 1 and y >= 0 and y<= 1) then -- out of range [0..1] numbers cause an error
-- now need to work out which row,col is beiung requested. Then replace it with the one from the table
-- map the inpout x,y into equivalent cols and rows by scaling up from [0..1][0..1]
scaledX = scaledX * NumberOfColumns
scaledY = y * NumberOfRows
col = math.floor(scaledX + 0.000001)
row = math.floor(scaledY + 0.000001)
fractX = scaledX - col -- get fractional part of x
fractY = scaledY - row -- get fractional part of y
reqdChar = msgColRow[row][col] -- find which character should be in this cell
if reqdChar == -1 then
ro, go, bo, ao = 0, 0, 0, 0 -- return get_sample_map(x / xScaleFactor, y, BACKGROUND)
else -- there is a character to process
dscaledX = fractX * matrixCols
dscaledY = fractY * matrixRows
dcolx = math.floor(dscaledX + 0.000001)
drowy = math.floor(dscaledY + 0.000001)
drow = drowy + 1 -- get the row in reverse order as least sig digit is at top
dcol = matrixCols - dcolx -- get the col (1 based table)
dx = dscaledX - dcolx
dy = dscaledY - drowy
leds = matrix[reqdChar][drow] -- get the matrix row info
pz = testBit(leds, dcol)
if pz == false then -- OFF so use background
ro, go, bo, ao = 0, 0, 0, 0 -- get_sample_map(x / xScaleFactor, y, BACKGROUND)
else -- ON so need to get the DOT - but it needs scaling
ro, go, bo, ao = get_sample_map(dx , dy, DOT)
end
end
end
-- out of range default
if (BL_MODE == 1) then
r, g, b, a = blend_normal(rb, gb, bb, ab, rf, gf, bf, af, opacity, hdr)
elseif (BL_MODE == 2) then
r, g, b, a = blend_darken(rb, gb, bb, ab, rf, gf, bf, af, opacity, hdr)
elseif (BL_MODE == 3) then
r, g, b, a = blend_multiply(rb, gb, bb, ab, rf, gf, bf, af, opacity, hdr)
elseif (BL_MODE == 4) then
r, g, b, a = blend_color_burn(rb, gb, bb, ab, rf, gf, bf, af, opacity)
elseif (BL_MODE == 5) then
r, g, b, a = blend_linear_burn(rb, gb, bb, ab, rf, gf, bf, af, opacity)
elseif (BL_MODE == 6) then
r, g, b, a = blend_lighten(rb, gb, bb, ab, rf, gf, bf, af, opacity, hdr)
elseif (BL_MODE == 7) then
r, g, b, a = blend_screen(rb, gb, bb, ab, rf, gf, bf, af, opacity)
elseif (BL_MODE == 8) then
r, g, b, a = blend_color_dodge(rb, gb, bb, ab, rf, gf, bf, af, opacity)
elseif (BL_MODE == 9) then
r, g, b, a = blend_linear_dodge(rb, gb, bb, ab, rf, gf, bf, af, opacity, hdr)
elseif (BL_MODE == 10) then
r, g, b, a = blend_overlay(rb, gb, bb, ab, rf, gf, bf, af, opacity)
elseif (BL_MODE == 11) then
r, g, b, a = blend_soft_light(rb, gb, bb, ab, rf, gf, bf, af, opacity)
elseif (BL_MODE == 12) then
r, g, b, a = blend_hard_light(rb, gb, bb, ab, rf, gf, bf, af, opacity)
elseif (BL_MODE == 13) then
r, g, b, a = blend_vivid_light(rb, gb, bb, ab, rf, gf, bf, af, opacity)
elseif (BL_MODE == 14) then
r, g, b, a = blend_linear_light(rb, gb, bb, ab, rf, gf, bf, af, opacity)
elseif (BL_MODE == 15) then
r, g, b, a = blend_difference(rb, gb, bb, ab, rf, gf, bf, af, opacity, hdr)
elseif (BL_MODE == 16) then
r, g, b, a = blend_hue(rb, gb, bb, ab, rf, gf, bf, af, opacity, hdr)
elseif (BL_MODE == 17) then
r, g, b, a = blend_saturation(rb, gb, bb, ab, rf, gf, bf, af, opacity, hdr)
elseif (BL_MODE == 18) then
r, g, b, a = blend_color(rb, gb, bb, ab, rf, gf, bf, af, opacity, hdr)
elseif (BL_MODE == 19) then
r, g, b, a = blend_luminosity(rb, gb, bb, ab, rf, gf, bf, af, opacity, hdr)
end
r, g, b, a = blend_normal(r, g, b, a, ro, go, bo, ao, 1, hdr)
return r, g, b, a
-- return get_sample_map(x / xScaleFactor, y, BACKGROUND)
end;