-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkshop.lua
More file actions
4535 lines (3609 loc) · 86 KB
/
Copy pathworkshop.lua
File metadata and controls
4535 lines (3609 loc) · 86 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
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
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
local Modules = {
['workshop.base'] = [=[
--[[
Lua base libraries extension. Used almost in any piece of my code.
This module installs global function "request" which is based on
"require" and makes possible relative module names.
Also this function tracks module dependencies. This allows to
get dependencies list for any module. Which is used to create
deploys without unused code.
Price for tracking dependencies is global table "dependencies"
and function "get_require_name".
Lastly, global functions are added for convenience. Such functions
are "new" and families of "is_<type>" and "assert_<type>".
]]
-- Last mod.: 2024-03-02
-- Export request function:
local split_name =
function(qualified_name)
local prefix_name_pattern = '^(.+%.)([^%.]+)$' -- a.b.c --> (a.b.) (c)
local prefix, name = qualified_name:match(prefix_name_pattern)
if not prefix then
prefix = ''
name = qualified_name
if not name:find('^([^%.]+)$') then
name = ''
end
end
return prefix, name
end
local unite_prefixes =
function(base_prefix, rel_prefix)
local init_base_prefix, init_rel_prefix = base_prefix, rel_prefix
local list_without_tail_pattern = '(.+%.)[^%.]-%.$' -- a.b.c. --> (a.b.)
local list_without_head_pattern = '[^%.]+%.(.+)$' -- a.b.c. --> (b.c.)
while rel_prefix:find('^%^%.') do
if (base_prefix == '') then
error(
([[Link "%s" is outside caller's prefix "%s".]]):format(
init_rel_prefix,
init_base_prefix
)
)
end
base_prefix = base_prefix:match(list_without_tail_pattern) or ''
rel_prefix = rel_prefix:match(list_without_head_pattern) or ''
end
return base_prefix .. rel_prefix
end
local names = {}
local depth = 1
local get_caller_prefix =
function()
local result = ''
if names[depth] then
result = names[depth].prefix
end
return result
end
local get_caller_name =
function()
local result = 'anonymous'
if names[depth] then
result = names[depth].prefix .. names[depth].name
end
return result
end
local push =
function(prefix, name)
depth = depth + 1
names[depth] = {prefix = prefix, name = name}
end
local pop =
function()
depth = depth - 1
end
local dependencies = {}
local add_dependency =
function(src_name, dest_name)
dependencies[src_name] = dependencies[src_name] or {}
dependencies[src_name][dest_name] = true
end
local base_prefix = split_name((...))
local get_require_name =
function(qualified_name)
local is_absolute_name = (qualified_name:sub(1, 2) == '!.')
if is_absolute_name then
qualified_name = qualified_name:sub(3)
end
local prefix, name = split_name(qualified_name)
local caller_prefix =
is_absolute_name and base_prefix or get_caller_prefix()
prefix = unite_prefixes(caller_prefix, prefix)
return prefix .. name, prefix, name
end
local request =
function(qualified_name)
local src_name = get_caller_name()
local require_name, prefix, name = get_require_name(qualified_name)
push(prefix, name)
local dest_name = get_caller_name()
add_dependency(src_name, dest_name)
local results = table.pack(require(require_name))
pop()
return table.unpack(results)
end
local IsFirstRun = (_G.request == nil)
if IsFirstRun then
_G.request = request
_G.dependencies = dependencies
_G.get_require_name = get_require_name
--[[
At this point we installed "request()", so it's usable from
outer code.
Below we call optional modules which install additional
global functions.
Functions made global because they are widely used in my code.
They are inside other files. We use freshly added "request()"
to load them and add them to dependencies of this module.
We need add record to call stack with our name because these
calls of "request()" are inside "if", so the call will not be
done until actual execution.
]]
-- First element is invocation module name, second - module file path
local our_require_name = (...)
push('', our_require_name)
request('!.system.install_is_functions')()
request('!.system.install_assert_functions')()
_G.new = request('!.table.new')
pop()
end
--[[
2016-06
2017-09
2018-02
2018-05
2024-03
]]
]=],
['workshop.concepts.Counter.Interface'] = [=[
-- Counter class
return
{
-- Interface
-- Initialization setup
Init =
function(self, StartValue)
assert_integer(self.MinValue)
assert_integer(self.MaxValue)
assert(self.MinValue <= self.MaxValue)
if is_nil(StartValue) then
if is_nil(self.Value) then
-- Fallback to min value
self.Value = self.MinValue
end
else
assert_integer(StartValue)
if
(StartValue < self.MinValue) or
(StartValue > self.MaxValue)
then
local ErrorMsgFmt =
'[Counter] Starting value out of range: (%d not in [%d, %d]).'
local ErrorMsg =
string.format(
ErrorMsgFmt,
StartValue,
self.MinValue,
self.MaxValue
)
error(ErrorMsg)
end
self.Value = StartValue
end
end,
-- Return current value
Get =
function(self)
return self.Value
end,
-- Move one unit forward
Increase =
function(self)
if (self.Value >= self.MaxValue) then
if (self.Value > self.MaxValue) then
self.Value = self.MaxValue
end
return false
end
self.Value = self.Value + 1
return true
end,
-- Move one unit backward
Decrease =
function(self)
if (self.Value <= self.MinValue) then
if (self.Value < self.MinValue) then
self.Value = self.MinValue
end
return false
end
self.Value = self.Value - 1
return true
end,
-- Intensities
-- Current value
Value = nil,
-- Range min value
MinValue = 0,
-- Range max value
MaxValue = 100,
}
--[[
2024-08-31
]]
]=],
['workshop.concepts.Image.Color.Denormalize'] = [=[
-- Map normalized color components to byte range
-- Last mod.: 2024-11-25
-- Imports:
local MapTo = request('MapTo')
local ToInt = math.floor
local ApplyFunc = request('!.concepts.List.ApplyFunc')
local Denormalize =
function(Color)
local DestRange = { 0, 255 }
local SourceRange = { 0.0, 1.0 }
MapTo(DestRange, Color, SourceRange)
return ApplyFunc(ToInt, Color)
end
-- Exports:
return Denormalize
--[[
2024-11-24
]]
]=],
['workshop.concepts.Image.Color.Grayscale'] = [=[
-- Grayscale color structure
-- Last mod.: 2025-03-28
-- Damn, that was worth a standalone file!
return { 0.0 }
--[[
2025-03-28
]]
]=],
['workshop.concepts.Image.Color.MapTo'] = [=[
-- Map color components to given range
-- Last mod.: 2024-11-25
-- Imports:
local MapToRange = request('!.number.map_to_range')
local ApplyFunc = request('!.concepts.List.ApplyFunc')
local MapTo =
function(DestRange, Color, SrcRange)
local CurrentMapToRange =
function(ColorComponent)
return MapToRange(DestRange, ColorComponent, SrcRange)
end
return ApplyFunc(CurrentMapToRange, Color)
end
-- Exports:
return MapTo
--[[
2024-11-24
]]
]=],
['workshop.concepts.Image.Color.Normalize'] = [=[
-- Normalize image color components that are in byte range [0, 255]
-- Last mod.: 2024-11-25
-- Imports:
local MapTo = request('MapTo')
local Normalize =
function(Color)
local DestRange = { 0.0, 1.0 }
local SourceRange = { 0, 255 }
return MapTo(DestRange, Color, SourceRange)
end
-- Exports:
return Normalize
--[[
2024-11-24
]]
]=],
['workshop.concepts.Image.Color.Randomize'] = [=[
-- Randomize components of given color
-- Last mod.: 2025-04-04
-- Imports:
local ApplyFunc = request('!.concepts.List.ApplyFunc')
-- Return number from unit interval [0.0, 1.0]
local GetRandom_Ui =
function()
return math.random()
end
--[[
Randomize color components
Modifies given table!
Fact that it returns table is just convenience feature.
]]
local Randomize =
function(Color)
ApplyFunc(GetRandom_Ui, Color)
return Color
end
-- Exports:
return Randomize
--[[
2025-04-04
]]
]=],
['workshop.concepts.Image.Color.Rgb'] = [=[
-- RGB color structure for images
-- Last mod.: 2025-04-05
--[[
For our processing "color" is just a fixed-length list of
something. Type of "something" depends what functions you will
call for that list.
Okay, for RGB it's list of three floats.
For grayscale it's list of one float.
For bitmap it's list of one integer.
(Text above is not a contract, just trying describe structure
in simple terms.)
]]
-- Imports:
local NameList = request('!.concepts.List.AddNames')
local Color = { 0.0, 0.0, 0.0 }
local Names = { 'Red', 'Green', 'Blue' }
-- Annotate component indices (sets metatable)
NameList(Color, Names)
-- Exports:
return Color
--[[
2024-11-24
2024-11-25
2025-03-28
]]
]=],
['workshop.concepts.Image.Color.SpawnColor'] = [=[
-- Create color record, depending of color format
-- Last mod.: 2025-03-31
-- Imports:
local RgbColor = request('Rgb')
local GsColor = request('Grayscale')
-- Exports:
return
function(ColorType)
if (ColorType == 'Rgb') then
return new(RgbColor)
elseif (ColorType == 'Gs') then
return new(GsColor)
end
end
--[[
2025-03-29
2025-03-31
]]
]=],
['workshop.concepts.Image.Matrix.CreateFromLine'] = [=[
-- Create 2-d image by duplicating line
-- Last mod.: 2025-04-06
--[[
Stack line image N times
]]
local StackLineImage =
function(ImageLine, NumTimes)
local Result = {}
for Index = 1, NumTimes do
Result[Index] = new(ImageLine)
end
return Result
end
-- Exports:
return StackLineImage
--[[
2024-11-25
2025-04-06
]]
]=],
['workshop.concepts.Indent.Interface'] = [=[
return
{
-- Interface
-- Initialization setup
Init =
function(self, IndentValue, ChunkValue)
-- Tune counter for our needs
self.Counter.MinValue = 0
self.Counter.MaxValue = 1000
self.Counter:Init(IndentValue)
-- Set chunk if passed
if not is_nil(ChunkValue) then
assert_string(ChunkValue)
self.Chunk = ChunkValue
end
end,
-- Increase indent
Increase =
function(self)
return self.Counter:Increase()
end,
-- Decrease indent
Decrease =
function(self)
return self.Counter:Decrease()
end,
-- Return current indent value (integer)
GetDepth =
function(self)
return self.Counter:Get()
end,
-- Return current indent string
GetString =
function(self)
return string.rep(self.Chunk, self:GetDepth())
end,
-- Intensities
-- Indent counter
Counter = request('!.concepts.Counter.Interface'),
-- Indent chunk
Chunk = ' ',
}
--[[
2024-08-31
]]
]=],
['workshop.concepts.List.AddNames'] = [=[
-- Add names to list entries
-- Last mod.: 2024-11-25
-- Imports:
local InvertTable = request('!.table.invert')
--[[
Name list entries by attaching metatable to list
Example:
local Color = { 128, 0, 255 }
local ColorNames = { 'Red', 'Green', 'Blue' }
NameList(Color, ColorNames)
assert(Color.Red == Color[1])
]]
local NameList =
function(List, Names)
local NamesKeys = InvertTable(Names)
local Metatable = {}
Metatable.__index =
function(Table, Key)
return rawget(Table, NamesKeys[Key])
end
Metatable.__newindex =
function(Table, Key, Value)
if NamesKeys[Key] then
rawset(Table, NamesKeys[Key], Value)
return
end
rawset(Table, Key, Value)
end
setmetatable(List, Metatable)
end
-- Exports:
return NameList
--[[
2024-11-23
2024-11-24
]]
]=],
['workshop.concepts.List.ApplyFunc'] = [=[
-- Modify list by applying function to each element. Returns list
--[[
Here we're breaking functional paradigm "result of function is new
value". We're modifying argument. It's practical.
]]
-- Last mod.: 2024-11-25
-- Exports:
return
function(Func, List)
assert_function(Func)
assert_table(List)
for Index = 1, #List do
List[Index] = Func(List[Index])
end
return List
end
--[[
2024-11-24
]]
]=],
['workshop.concepts.List.ToString'] = [=[
-- Concatenate list of string values to string
-- Last mod.: 2024-10-20
return
function(List, Separator)
Separator = Separator or ''
-- Meh, in Lua it's simple
return table.concat(List, Separator)
end
--[[
2024-10-20
2024-10-24
]]
]=],
['workshop.concepts.Netpbm.Compiler_IsToNif.CompileColor'] = [=[
-- Compile pixel to string
-- Last mod.: 2025-04-09
-- Imports:
local ListToString = request('!.concepts.List.ToString')
-- Exports:
return
function(self, ColorIs)
return ListToString(ColorIs, ' ')
end
--[[
2024-11-03
2025-03-28
2025-04-09
]]
]=],
['workshop.concepts.Netpbm.Compiler_IsToNif.Interface'] = [=[
-- Serialize to pixmap format
-- Last mod.: 2025-04-09
-- Exports:
return
{
-- [Config]
Output = request('!.concepts.StreamIo.Output'),
-- [Main]
Run = request('Run'),
-- [Internals]
Settings = request('^.Settings.Interface'),
WriteLine = request('WriteLine'),
WriteHeader = request('WriteHeader'),
CompileColor = request('CompileColor'),
WriteData = request('WriteData'),
}
--[[
2024-11 # #
2025-03-28
2025-04-09
]]
]=],
['workshop.concepts.Netpbm.Compiler_IsToNif.Internals.FormatDescriptions'] = [=[
-- Return lookup table with human-readable format description
-- Last mod.: 2025-04-09
-- Exports:
return
{
Text =
{
Bw = 'Bitmap, text format',
Gs = 'Grayscale, text format',
Rgb = 'Color, text format',
},
Binary =
{
Bw = 'Bitmap, binary format',
Gs = 'Grayscale, binary format',
Rgb = 'Color, binary format',
},
}
--[[
2025-04-09
]]
]=],
['workshop.concepts.Netpbm.Compiler_IsToNif.Run'] = [=[
-- Convert from .is to .ppm
-- Last mod.: 2025-04-09
--[[
Receives list of strings/lists structure.
Writes to <.Output> in .ppm format.
Contract obliges us to return true at end.
]]
local SerializePpm =
function(self, PpmIs)
self:WriteHeader(PpmIs)
self:WriteData(PpmIs)
return true
end
-- Exports:
return SerializePpm
--[[
2024-11 # # #
2024-12-12
2025-04-09
]]
]=],
['workshop.concepts.Netpbm.Compiler_IsToNif.WriteData'] = [=[
-- Write pixels to output
-- Last mod.: 2025-04-09
-- Imports:
local ListToString = request('!.concepts.List.ToString')
-- Exports:
return
function(self, DataIs)
local Settings = self.Settings
assert(Settings.DataEncoding == 'Text')
local ColorFormat = Settings.ColorFormat
local NumColorsPerDataLine
if (ColorFormat == 'Rgb') then
NumColorsPerDataLine = 4
elseif (ColorFormat == 'Gs') then
NumColorsPerDataLine = 12
end
local Height = #DataIs
local Width = #DataIs[1]
local ColumnsDelim = ' '
self:WriteLine(LinesDelim)
for Row = 1, Height do
local Chunk = {}
self:WriteLine('')
self:WriteLine(nil, ('Line %d'):format(Row))
for Column = 1, Width do
local ColorIs = DataIs[Row][Column]
local ColorStr = self:CompileColor(ColorIs)
table.insert(Chunk, ColorStr)
if (Column % NumColorsPerDataLine == 0) then
local ChunksStr = ListToString(Chunk, ColumnsDelim)
Chunk = {}
self:WriteLine(ChunksStr)
end
end
-- Write remained chunk
if (Width % NumColorsPerDataLine ~= 0) then
local ChunksStr = ListToString(Chunk, ColumnsDelim)
self:WriteLine(ChunksStr)
end
end
end
--[[
2024-11 # #
2025-04-09
]]
]=],
['workshop.concepts.Netpbm.Compiler_IsToNif.WriteHeader'] = [=[
-- Write header to output
-- Last mod.: 2025-04-09
-- Imports:
local FormatDescriptions = request('Internals.FormatDescriptions')
-- Exports:
return
function(self, DataIs)
local Settings = self.Settings
local Data
local Comment
do
Data = Settings:GetFormatLabel()
Comment =
FormatDescriptions[Settings.DataEncoding][Settings.ColorFormat]
self:WriteLine(Data, Comment)
end
do
local Height = #DataIs
local Width = #DataIs[1]
local MaxColorValue = Settings.MaxColorValue
Data =
tostring(Width) .. ' ' ..
tostring(Height) .. ' ' ..
tostring(MaxColorValue)
Comment = 'Width, Height, 255'
self:WriteLine(Data, Comment)
end
end
--[[
2024-11 # #
2024-12-12
2025-03-28
2025-04-09
]]
]=],
['workshop.concepts.Netpbm.Compiler_IsToNif.WriteLine'] = [=[
-- Write string as line to output
-- Last mod.: 2025-04-09
-- Exports:
return
function(self, Data, Comment)
if Data then
self.Output:Write(Data)
end
if Comment then
if Data then
self.Output:Write(' ')
end
self.Output:Write('# ')
self.Output:Write(Comment)
end
if Data or Comment then
self.Output:Write('\n')
end
end
--[[
2024-11-02
2025-04-09
]]
]=],
['workshop.concepts.Netpbm.Compiler_LuaToIs.CompileColor'] = [=[
-- Anonymize color to list
-- Last mod.: 2025-03-29
-- Imports:
local SpawnColor = request('!.concepts.Image.Color.SpawnColor')
local DenormalizeColor = request('!.concepts.Image.Color.Denormalize')
local PatchTable = request('!.table.patch')
-- Exports:
return
function(self, Color)
local ByteColor = SpawnColor(self.Settings.ColorFormat)
PatchTable(ByteColor, Color)
DenormalizeColor(ByteColor)
local Result = {}
for _, Component in ipairs(ByteColor) do
local SerializedComponent = self:CompileColorComponent(Component)
if not SerializedComponent then
return
end
table.insert(Result, SerializedComponent)
end
return Result
end
--[[
2024-11 # #
2024-12-12
2025-03-28
]]
]=],
['workshop.concepts.Netpbm.Compiler_LuaToIs.CompileColorComponent'] = [=[
-- Serialize color component integer
-- Last mod.: 2025-03-29
-- Imports:
local MaxColorValue = request('^.Settings.Interface').MaxColorValue
local NumberInRange = request('!.number.in_range')
-- Exports:
return
function(self, ColorComponent)
if not is_integer(ColorComponent) then
return
end
if not NumberInRange(ColorComponent, 0, MaxColorValue) then
return
end
return string.format(self.ColorComponentFmt, ColorComponent)
end
--[[
2024-11-03
2025-03-28
]]
]=],
['workshop.concepts.Netpbm.Compiler_LuaToIs.Interface'] = [=[
-- Compile named Lua table to anonymous structure (list of strings/lists)
-- Last mod.: 2025-03-31
-- Exports:
return
{
-- [Config]
-- Image format settings
Settings = request('^.Settings.Interface'),
-- Color component serialization format
ColorComponentFmt = '%03d',
-- [Main]
-- Convert table with image to anonymous tree
Run = request('Run'),
-- [Internals]
-- Compile color
CompileColor = request('CompileColor'),
-- Serialize color component
CompileColorComponent = request('CompileColorComponent'),
}
--[[
2024-11 # # # #
2024-12 #
2025-03-28
2025-03-31
]]
]=],
['workshop.concepts.Netpbm.Compiler_LuaToIs.Run'] = [=[
-- Anonymize parsed .ppm
-- Last mod.: 2025-03-29
--[[
Compile Lua table with pixels to anonymous structure
]]
return
function(self, Image)
local MatrixIs = {}
for RowIndex, Row in ipairs(Image) do
MatrixIs[RowIndex] = {}
for ColumnIndex, Color in ipairs(Row) do
local ValueIs = self:CompileColor(Color)
if not ValueIs then
return
end
MatrixIs[RowIndex][ColumnIndex] = ValueIs
end
end
return MatrixIs
end
--[[
2024-11 # # #