langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
32
Task/Bitmap/Oz/bitmap-2.oz
Normal file
32
Task/Bitmap/Oz/bitmap-2.oz
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
%% For real task prefer QTk's images:
|
||||
%% http://www.mozart-oz.org/home/doc/mozart-stdlib/wp/qtk/html/node38.html
|
||||
|
||||
functor
|
||||
import
|
||||
Array2D
|
||||
export
|
||||
New
|
||||
Fill
|
||||
GetPixel
|
||||
SetPixel
|
||||
define
|
||||
Black = color(0x00 0x00 0x00)
|
||||
|
||||
fun {New Width Height}
|
||||
bitmap( {Array2D.new Width Height Black} )
|
||||
end
|
||||
|
||||
proc {Fill bitmap(Arr) Color}
|
||||
{Array2D.transform Arr fun {$ _} Color end}
|
||||
end
|
||||
|
||||
fun {GetPixel bitmap(Arr) X Y}
|
||||
{Array2D.get Arr X Y}
|
||||
end
|
||||
|
||||
proc {SetPixel bitmap(Arr) X Y Color}
|
||||
{Array2D.set Arr X Y Color}
|
||||
end
|
||||
|
||||
%% Omitted: MaxValue, ForAllPixels, Transform
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue