Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,25 @@
|
|||
$ include "seed7_05.s7i";
|
||||
include "draw.s7i";
|
||||
include "color.s7i";
|
||||
|
||||
const proc: writePPM (in string: fileName, in PRIMITIVE_WINDOW: aWindow) is func
|
||||
local
|
||||
var file: ppmFile is STD_NULL;
|
||||
var integer: x is 0;
|
||||
var integer: y is 0;
|
||||
var color: pixColor is black;
|
||||
begin
|
||||
ppmFile := open(fileName, "w");
|
||||
if ppmFile <> STD_NULL then
|
||||
writeln(ppmFile, "P6");
|
||||
writeln(ppmFile, width(aWindow) <& " " <& height(aWindow));
|
||||
writeln(ppmFile, "255");
|
||||
for y range 0 to pred(height(aWindow)) do
|
||||
for x range 0 to pred(width(aWindow)) do
|
||||
pixColor := getPixelColor(aWindow, x, y);
|
||||
write(ppmFile, str(chr(pixColor.redLight)) <& chr(pixColor.greenLight) <& chr(pixColor.blueLight));
|
||||
end for;
|
||||
end for;
|
||||
close(ppmFile);
|
||||
end if;
|
||||
end func;
|
||||
Loading…
Add table
Add a link
Reference in a new issue