mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-14 00:14:05 +09:00
graphics: image bayer dithering; movie test using image decoding of tsvm's gpu
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -53,3 +53,4 @@ tsvmman.pdf
|
|||||||
*.toc
|
*.toc
|
||||||
|
|
||||||
assets/disk0/home/basic/*
|
assets/disk0/home/basic/*
|
||||||
|
assets/disk0/movtestimg/*.jpg
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ println(`dim: ${imgw}x${imgh}`)
|
|||||||
println(`converting to displayable format...`)
|
println(`converting to displayable format...`)
|
||||||
|
|
||||||
// convert colour
|
// convert colour
|
||||||
graphics.imageToDisplayableFormat(imageData, -1048577, imgw, imgh, 4, true)
|
graphics.imageToDisplayableFormat(imageData, -1048577, imgw, imgh, 4, 2)
|
||||||
|
|
||||||
sys.free(imageData)
|
sys.free(imageData)
|
||||||
sys.free(infile)
|
sys.free(infile)
|
||||||
|
|||||||
20
assets/disk0/movtest.js
Normal file
20
assets/disk0/movtest.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
let infile = sys.malloc(752704)
|
||||||
|
let imagearea = sys.malloc(560*448*3)
|
||||||
|
|
||||||
|
con.clear()
|
||||||
|
|
||||||
|
for (let f = 1; f <= 52; f++) {
|
||||||
|
let fname = `/movtestimg/${(''+f).padStart(3,'0')}.jpg`
|
||||||
|
filesystem.open("A", fname, "R")
|
||||||
|
let fileLen = filesystem.getFileLen("A")
|
||||||
|
dma.comToRam(0, 0, infile, fileLen)
|
||||||
|
|
||||||
|
graphics.decodeImageTo(infile, fileLen, imagearea)
|
||||||
|
|
||||||
|
graphics.imageToDisplayableFormat(imagearea, -1048577, 560, 448, 3, 2)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
sys.free(imagearea)
|
||||||
|
sys.free(infile)
|
||||||
BIN
assets/disk0/movtestimg/UNZIP_BEFORE_TESTING.zip
LFS
Normal file
BIN
assets/disk0/movtestimg/UNZIP_BEFORE_TESTING.zip
LFS
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -73,8 +73,8 @@ internal class UnsafePtr(pointer: Long, allocSize: Long) {
|
|||||||
|
|
||||||
fun destroy() {
|
fun destroy() {
|
||||||
if (!destroyed) {
|
if (!destroyed) {
|
||||||
println("[UnsafePtr] Destroying pointer $this; called from:")
|
// println("[UnsafePtr] Destroying pointer $this; called from:")
|
||||||
printStackTrace(this)
|
// printStackTrace(this)
|
||||||
|
|
||||||
UnsafeHelper.unsafe.freeMemory(ptr)
|
UnsafeHelper.unsafe.freeMemory(ptr)
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ internal class UnsafePtr(pointer: Long, allocSize: Long) {
|
|||||||
//// appear (e.g. getting garbage values when it fucking shouldn't)
|
//// appear (e.g. getting garbage values when it fucking shouldn't)
|
||||||
|
|
||||||
assert(!destroyed) { throw NullPointerException("The pointer is already destroyed ($this)") }
|
assert(!destroyed) { throw NullPointerException("The pointer is already destroyed ($this)") }
|
||||||
if (index !in 0 until size) throw IndexOutOfBoundsException("Index: $index; alloc size: $size")
|
if (index !in 0 until size) throw IndexOutOfBoundsException("Index: $index; alloc size: $size; pointer: ${this}\n${Thread.currentThread().stackTrace.joinToString("\n", limit=10) { " $it" }}")
|
||||||
}
|
}
|
||||||
|
|
||||||
operator fun get(index: Long): Byte {
|
operator fun get(index: Long): Byte {
|
||||||
|
|||||||
Reference in New Issue
Block a user