September Morn Update

This commit is contained in:
Ingy döt Net 2019-09-12 10:33:56 -07:00
parent 4e2d22a71d
commit aac6731f2c
6856 changed files with 141342 additions and 21127 deletions

View file

@ -0,0 +1,17 @@
integer i, h, j, w;
file f;
w = 640;
h = 320;
f.create("out.ppm", 00644);
f.form("P6\n~ ~\n255\n", w, h);
j = 0;
do {
srand(j >> 4);
i = 0;
do {
16.times(f_bytes, f, drand(255), drand(255), drand(255));
} while ((i += 16) < w);
} while ((j += 1) < h);

View file

@ -54,7 +54,7 @@ function Bitmap:writeP6(filename)
end
end
function Bitmap:fill(x, y, width, heigth, color)
function Bitmap:fill(x, y, width, height, color)
width = (width == nil) and self.width or width
height = (height == nil) and self.height or height
width = width + x

View file

@ -0,0 +1,8 @@
use Imager;
$image = Imager->new(xsize => 200, ysize => 200);
$image->box(filled => 1, color => red);
$image->box(filled => 1, color => black,
xmin => 50, ymin => 50,
xmax => 150, ymax => 150);
$image->write(file => 'bitmap.ppm') or die $image->errstr;