Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -1,16 +1,14 @@
class Pixel { has Int ($.R, $.G, $.B) }
class Pixel { has UInt ($.R, $.G, $.B) }
class Bitmap {
has Int ($.width, $.height);
has Pixel @.data;
has UInt ($.width, $.height);
has Pixel @!data;
method fill(Pixel $p) {
for ^$!width X ^$!height -> $i, $j {
self.pixel($i, $j) = $p.clone;
}
@!data = $p.clone xx ($!width*$!height)
}
method pixel(
$i where ^self.width,
$j where ^self.height
$i where ^$!width,
$j where ^$!height
--> Pixel
) is rw { @!data[$i*$!height + $j] }