diff --git a/src/pixie.nim b/src/pixie.nim index 58cf715..7d71504 100644 --- a/src/pixie.nim +++ b/src/pixie.nim @@ -1,3 +1,16 @@ ## Public interface to you library. -import pixie/common +import pixie/images, pixie/masks, pixie/paths +export images, masks, paths + +proc toMask*(image: Image): Mask = + ## Converts an Image to a Mask. + result = newMask(image.width, image.height) + for i in 0 ..< image.data.len: + result.data[i] = image.data[i].a + +proc toImage*(mask: Mask): Image = + ## Converts a Mask to Image. + result = newImage(mask.width, mask.height) + for i in 0 ..< mask.data.len: + result.data[i].a = mask.data[i]