import bitmap proc setPixel(img: Image; x, y: int; color: Color) {.inline.} = # Set a pixel at a given color. # Ignore if the point is outside of the image. if x in 0..= 0: dec y inc ddFY, 2 inc f, ddFY inc x inc ddFX, 2 inc f, ddFX + 1 img.setPixel(center.x + x, center.y + y, color) img.setPixel(center.x - x, center.y + y, color) img.setPixel(center.x + x, center.y - y, color) img.setPixel(center.x - x, center.y - y, color) img.setPixel(center.x + y, center.y + x, color) img.setPixel(center.x - y, center.y + x, color) img.setPixel(center.x + y, center.y - x, color) img.setPixel(center.x - y, center.y - x, color) #——————————————————————————————————————————————————————————————————————————————————————————————————— when isMainModule: var img = newImage(16, 16) img.fill(White) img.drawCircle((7, 7), 5, Black) img.print()