B
This commit is contained in:
parent
e5e8880e41
commit
518da4a923
1019 changed files with 15877 additions and 0 deletions
22
Task/Bitmap/Lua/bitmap-1.lua
Normal file
22
Task/Bitmap/Lua/bitmap-1.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
function Allocate_Bitmap( width, height )
|
||||
local bitmap = {}
|
||||
for i = 1, width do
|
||||
bitmap[i] = {}
|
||||
for j = 1, height do
|
||||
bitmap[i][j] = {}
|
||||
end
|
||||
end
|
||||
return bitmap
|
||||
end
|
||||
|
||||
function Fill_Bitmap( bitmap, color )
|
||||
for i = 1, #bitmap do
|
||||
for j = 1, #bitmap[1] do
|
||||
bitmap[i][j] = color
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Get_Pixel( bitmap, x, y )
|
||||
return bitmap[x][y]
|
||||
end
|
||||
4
Task/Bitmap/Lua/bitmap-2.lua
Normal file
4
Task/Bitmap/Lua/bitmap-2.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
bitmap = Allocate_Bitmap( 100, 50 )
|
||||
Fill_Bitmap( bitmap, { 15, 200, 80 } )
|
||||
pixel = Get_Pixel( bitmap, 20, 25 )
|
||||
print( pixel[1], pixel[2], pixel[3] )
|
||||
Loading…
Add table
Add a link
Reference in a new issue