diff options
Diffstat (limited to 'src/img/bitmap.nim')
-rw-r--r-- | src/img/bitmap.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/img/bitmap.nim b/src/img/bitmap.nim index 76d36747..9f9b3401 100644 --- a/src/img/bitmap.nim +++ b/src/img/bitmap.nim @@ -2,7 +2,7 @@ import types/color type Bitmap* = ref object of RootObj - px*: seq[RGBAColor] + px*: seq[ARGBColor] width*: uint64 height*: uint64 @@ -10,18 +10,18 @@ type proc newBitmap*(width, height: uint64): Bitmap = return ImageBitmap( - px: newSeq[RGBAColor](width * height), + px: newSeq[ARGBColor](width * height), width: width, height: height ) -proc setpx*(bmp: Bitmap; x, y: uint64; color: RGBAColor) {.inline.} = +proc setpx*(bmp: Bitmap; x, y: uint64; color: ARGBColor) {.inline.} = bmp.px[bmp.width * y + x] = color -proc getpx*(bmp: Bitmap; x, y: uint64): RGBAColor {.inline.} = +proc getpx*(bmp: Bitmap; x, y: uint64): ARGBColor {.inline.} = return bmp.px[bmp.width * y + x] -proc setpxb*(bmp: Bitmap; x, y: uint64; color: RGBAColor) {.inline.} = +proc setpxb*(bmp: Bitmap; x, y: uint64; color: ARGBColor) {.inline.} = if color.a == 255: bmp.setpx(x, y, color) else: |