diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-07-08 09:26:55 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-07-08 09:26:55 -0700 |
commit | b628bbd68602b15523022d5e633e560a244a8848 (patch) | |
tree | 8cd44ce09e8c6387b014ebd6f3e295d358c3c04a | |
parent | afda7d59c02819b49ec66e8472d74121ab628d66 (diff) | |
download | mu-b628bbd68602b15523022d5e633e560a244a8848.tar.gz |
.
-rw-r--r-- | img.mu | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/img.mu b/img.mu index 5b916568..0f53eb03 100644 --- a/img.mu +++ b/img.mu @@ -212,34 +212,34 @@ fn initialize-image-from-ppm _self: (addr image), in: (addr stream byte) { } } -fn render-image screen: (addr screen), _self: (addr image), xmin: int, ymin: int, width: int, height: int { - var self/esi: (addr image) <- copy _self - var type-a/eax: (addr int) <- get self, type +fn render-image screen: (addr screen), _img: (addr image), xmin: int, ymin: int, width: int, height: int { + var img/esi: (addr image) <- copy _img + var type-a/eax: (addr int) <- get img, type { compare *type-a, 1/pbm break-if-!= - render-pbm-image screen, self, xmin, ymin, width, height + render-pbm-image screen, img, xmin, ymin, width, height return } { compare *type-a, 2/pgm break-if-!= - render-pgm-image screen, self, xmin, ymin, width, height + render-pgm-image screen, img, xmin, ymin, width, height return } { compare *type-a, 3/ppm break-if-!= - render-ppm-image screen, self, xmin, ymin, width, height + render-ppm-image screen, img, xmin, ymin, width, height return } abort "render-image: unrecognized image type" } -fn render-pbm-image screen: (addr screen), _self: (addr image), xmin: int, ymin: int, width: int, height: int { - var self/esi: (addr image) <- copy _self - var img-width-a/ecx: (addr int) <- get self, width - var data-ah/eax: (addr handle array byte) <- get self, data +fn render-pbm-image screen: (addr screen), _img: (addr image), xmin: int, ymin: int, width: int, height: int { + var img/esi: (addr image) <- copy _img + var img-width-a/ecx: (addr int) <- get img, width + var data-ah/eax: (addr handle array byte) <- get img, data var _data/eax: (addr array byte) <- lookup *data-ah var data/esi: (addr array byte) <- copy _data var y/edx: int <- copy ymin @@ -278,10 +278,10 @@ fn render-pbm-image screen: (addr screen), _self: (addr image), xmin: int, ymin: } } -fn render-pgm-image screen: (addr screen), _self: (addr image), xmin: int, ymin: int, width: int, height: int { - var self/esi: (addr image) <- copy _self - var img-width-a/ecx: (addr int) <- get self, width - var data-ah/eax: (addr handle array byte) <- get self, data +fn render-pgm-image screen: (addr screen), _img: (addr image), xmin: int, ymin: int, width: int, height: int { + var img/esi: (addr image) <- copy _img + var img-width-a/ecx: (addr int) <- get img, width + var data-ah/eax: (addr handle array byte) <- get img, data var _data/eax: (addr array byte) <- lookup *data-ah var data/esi: (addr array byte) <- copy _data var y/edx: int <- copy ymin @@ -319,10 +319,10 @@ fn nearest-grey level-255: int -> _/eax: int { return result } -fn render-ppm-image screen: (addr screen), _self: (addr image), xmin: int, ymin: int, width: int, height: int { - var self/esi: (addr image) <- copy _self - var img-width-a/ecx: (addr int) <- get self, width - var data-ah/eax: (addr handle array byte) <- get self, data +fn render-ppm-image screen: (addr screen), _img: (addr image), xmin: int, ymin: int, width: int, height: int { + var img/esi: (addr image) <- copy _img + var img-width-a/ecx: (addr int) <- get img, width + var data-ah/eax: (addr handle array byte) <- get img, data var _data/eax: (addr array byte) <- lookup *data-ah var data/esi: (addr array byte) <- copy _data var y/edx: int <- copy ymin |