This commit is contained in:
Ryan Oldenburg 2020-11-28 21:34:24 -06:00
parent a6b2f70249
commit 2bee400d47
2 changed files with 3 additions and 2 deletions

View file

@ -436,6 +436,8 @@ proc encodePng*(
else:
raise newException(PixieError, "Invalid PNG number of channels")
let data = cast[ptr UncheckedArray[uint8]](data)
# Add the PNG file signature
result.add([137.uint8, 80, 78, 71, 13, 10, 26, 10])
@ -456,7 +458,6 @@ proc encodePng*(
for x in 0 ..< width * channels:
# Move through the image data byte-by-byte
let
data = cast[ptr UncheckedArray[uint8]](data)
dataPos = y * width * channels + x
filteredPos = y * width * channels + y + 1 + x
var left, up: int

View file

@ -1,7 +1,7 @@
import pixie/fileformats/png, stb_image/read as stbi, stb_image/write as stbr,
fidget/opengl/perf, nimPNG
let data = readFile("tests/images/lenna.png")
let data = readFile("tests/images/png/lenna.png")
timeIt "pixie decode":
for i in 0 ..< 100: