- PNGview: a PNG viewer for the Prizm [nevermind]
- 25 Apr 2012 01:18:36 pm
- Last edited by gbl08ma on 25 Apr 2012 02:33:35 pm; edited 1 time in total
I'm trying to develop a PNG viewing add-in for the Prizm. I don't usually need to view images on the Prizm, but sometimes it's handy to have some schemes and diagrams in the calc. Since it's a pain to create them in-calc using the Geometry app, and since the g3p format is proprietary and IMO doesn't compress full-color images very well, I thought a PNG viewer would be the way to go.
I think I have managed to port http://lodev.org/lodepng/ . I chose to port this because it has no external dependencies, and I found the code to be fairly easy to understand. I found other options to have too bloated for the simpleness of my project and external dependencies like zlib, which would only add more code to port. Also, LodePNG is both a decoder and an encoder, which may be useful for e.g. developing an on-calc BMP to PNG converter (for converting and seeing the BMP screen captures).
However, my add-in doesn't work quite right. It is at a very, very basic stage, and my test code is meant to display the width and height of the file test.png located in the storage memory of the Prizm.
But, no matter what picture the file test.png has, LodePNG will always say "empty input or file doesn't exist".
I have gone through the code over than 20 times and can't understand what's wrong - it's as if the file didn't exit on the calc, period. However, I can see it in the memory menu, so it's definitely there. Trust me, I banged my head on the wall many times: I started this project in March and whenever I have time I debug it, still I haven't managed to make it work.
I think I'm probably doing something wrong with the syscalls for reading files. Perhaps I'm not passing the filename to LodePNG correctly.
I invite you to download the ZIP file with source code and a pre-compiled g3a from here: http://l.f.nu/dl/casioprizm/PNGview.zip
...and put a (small) PNG file called "test.png" in the root of your calc. Then launch the add-in, press F1 and verify it doesn't work (or otherwise).
If you could check the source code for mistakes, it'd be highly appreciated. Compilation issues some warnings I don't know very well how to solve either.
Help the noob, please!
EDIT: nevermind, the project was cancelled as well as all Prizm development on my behalf until further notice. See http://www.cemetech.net/forum/viewtopic.php?p=182130#182130
I think I have managed to port http://lodev.org/lodepng/ . I chose to port this because it has no external dependencies, and I found the code to be fairly easy to understand. I found other options to have too bloated for the simpleness of my project and external dependencies like zlib, which would only add more code to port. Also, LodePNG is both a decoder and an encoder, which may be useful for e.g. developing an on-calc BMP to PNG converter (for converting and seeing the BMP screen captures).
However, my add-in doesn't work quite right. It is at a very, very basic stage, and my test code is meant to display the width and height of the file test.png located in the storage memory of the Prizm.
But, no matter what picture the file test.png has, LodePNG will always say "empty input or file doesn't exist".
I have gone through the code over than 20 times and can't understand what's wrong - it's as if the file didn't exit on the calc, period. However, I can see it in the memory menu, so it's definitely there. Trust me, I banged my head on the wall many times: I started this project in March and whenever I have time I debug it, still I haven't managed to make it work.
I think I'm probably doing something wrong with the syscalls for reading files. Perhaps I'm not passing the filename to LodePNG correctly.
I invite you to download the ZIP file with source code and a pre-compiled g3a from here: http://l.f.nu/dl/casioprizm/PNGview.zip
...and put a (small) PNG file called "test.png" in the root of your calc. Then launch the add-in, press F1 and verify it doesn't work (or otherwise).
If you could check the source code for mistakes, it'd be highly appreciated. Compilation issues some warnings I don't know very well how to solve either.
Help the noob, please!
EDIT: nevermind, the project was cancelled as well as all Prizm development on my behalf until further notice. See http://www.cemetech.net/forum/viewtopic.php?p=182130#182130