September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
|
|
@ -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);
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue