mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-16 16:06:06 +09:00
arseiotnarseit
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
if (!exec_args[1]) {
|
||||
printerrln("Usage: jpdectest image.jpg")
|
||||
}
|
||||
|
||||
filesystem.open("A", exec_args[1], "R")
|
||||
|
||||
let status = com.getStatusCode(0)
|
||||
@@ -20,7 +24,8 @@ println(`dim: ${imgw}x${imgh}`)
|
||||
println(`converting to displayable format...`)
|
||||
|
||||
// convert colour
|
||||
graphics.imageToDisplayableFormat(imageData, -1048577, imgw, imgh, 4, 2)
|
||||
graphics.setGraphicsMode(0)
|
||||
graphics.imageToDisplayableFormat(imageData, -1048577, imgw, imgh, 4, 1)
|
||||
|
||||
sys.free(imageData)
|
||||
sys.free(infile)
|
||||
|
||||
31
assets/disk0/home/jpdectesthigh.js
Normal file
31
assets/disk0/home/jpdectesthigh.js
Normal file
@@ -0,0 +1,31 @@
|
||||
if (!exec_args[1]) {
|
||||
printerrln("Usage: jpdectesthigh image.jpg")
|
||||
}
|
||||
|
||||
filesystem.open("A", exec_args[1], "R")
|
||||
|
||||
let status = com.getStatusCode(0)
|
||||
let infile = undefined
|
||||
if (0 != status) return status
|
||||
|
||||
|
||||
let fileLen = filesystem.getFileLen("A")
|
||||
println(`DMA reading ${fileLen} bytes from disk...`)
|
||||
infile = sys.malloc(fileLen)
|
||||
dma.comToRam(0, 0, infile, fileLen)
|
||||
|
||||
|
||||
println("decoding")
|
||||
|
||||
// decode
|
||||
const [imgw, imgh, imageData] = graphics.decodeImageResample(infile, fileLen, -1, -1)
|
||||
|
||||
println(`dim: ${imgw}x${imgh}`)
|
||||
println(`converting to displayable format...`)
|
||||
|
||||
// convert colour
|
||||
graphics.setGraphicsMode(4)
|
||||
graphics.imageToDirectCol(imageData, -1048577, -1310721, imgw, imgh, 4, 0)
|
||||
|
||||
sys.free(imageData)
|
||||
sys.free(infile)
|
||||
Reference in New Issue
Block a user