From 1126f28ea74a1d88b8e39f85588b39c5b6a62bf3 Mon Sep 17 00:00:00 2001 From: treeform Date: Sat, 30 Jan 2021 13:38:18 -0800 Subject: [PATCH] add back superImage --- src/pixie/images.nim | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pixie/images.nim b/src/pixie/images.nim index 45dcbe1..973dd66 100644 --- a/src/pixie/images.nim +++ b/src/pixie/images.nim @@ -142,6 +142,13 @@ proc subImage*(image: Image, x, y, w, h: int): Image = w * 4 ) +proc superImage*(image: Image, x, y, w, h: int): Image = + ## Cuts either a sub image or super image with padded transparency. + result = newImage(w, h) + for y2 in 0 ..< h: + for x2 in 0 ..< w: + result.setRgbaUnsafe(x2, y2, image[x2 + x, y2 + y]) + proc minifyBy2*(image: Image, power = 1): Image = ## Scales the image down by an integer scale. if power < 0: