- Casio prizm PNG viewer
- 31 May 2014 09:51:31 pm
- Last edited by ProgrammerNerd on 19 Jan 2016 10:54:09 pm; edited 6 times in total
Download here https://github.com/ComputerNerd/Casio-ImageView/blob/master/PNGviewer.7z
Edit two: Another minor release see the changelog.
Edit sorry to release a new version so soon but I just noticed that in certain instances Libpng would output a harmless warning however this is annoying as it overlaps the image so I fixed the cause of the warning.
The source code can be found here https://github.com/ComputerNerd/Casio-ImageView
From the readme:
Code:
Edit two: Another minor release see the changelog.
Edit sorry to release a new version so soon but I just noticed that in certain instances Libpng would output a harmless warning however this is annoying as it overlaps the image so I fixed the cause of the warning.
The source code can be found here https://github.com/ComputerNerd/Casio-ImageView
From the readme:
Code:
===============================================================================
Casio Prizm PNG viewer
===============================================================================
This is a PNG viewer for the Casio Prizm. It uses Libpng (which is paired with
zlib) to decompress a PNG file. When you load a png file it is resampled to
fill the screen but aspect ratio is preserved. As of now a simple bilinear fil-
tering is used but if there is interest I may replace it with something better.
The version you downloaded is version 1.003. Note that there is always the pos-
sibility for a new version, so if you noticed that I posted in the PNG viewer
thread see what I posted, there may be an update.
===============================================================================
How to use the PNG viewer
===============================================================================
You will see a file browser on startup use the arrow pad to select a file. Then
press either F1 or EXE to select the PNG file. Press any key except menu (which
actually takes you to the menu) to go back to the file browser.
===============================================================================
Notes and tips
===============================================================================
Since the Casio Prizm does not have lots of flash memory run Pngout or
pngwolf-zopfli on the images before putting them on your calculator.
I have included instructions on how to compile Libpng and Zlib here:
https://github.com/ComputerNerd/Casio-ImageView/blob/master/Compile%20Libpng
Following these instructions gets you a libraries (Libpng and Zlib) that you
could link against your add-in.
If you want to use a PNG in an add-in a good option would be to make a 16bit 1
channel image containing RGB565 data. Doing so introduces additional overhead
with no benefit so instead it would be better to use Zlib directly with a sim-
pler image format. For example uint32_t width,uint32_t height, deflate com-
pressed sequential RGB565 data created by zlib's deflate() function. But if you
feel comfortable with PNG that is an option. Also you can store the PNGs as a
const array so that it does not need to be a file. Note that LZMA works well on
the Casio Prizm and gets a better compression ratio. Try that in favor of Zlib
first.
The purpose of this program is simply to show off how capable the Casio Prizm
is. The PNG image format is well known and I think some people wrongly perceive
it as a very ram intensive thing to decode. Libpng can output a row at a time
or N amount of rows. When width!=384 or if height>=216 then the image is scaled
Only enough ram to hold 2 rows are needed which is 6*width bytes of ram. I use
bilinear scaling that is why two rows are needed to be read. After the code in-
terpolates the pixels the resulting pixel is converted to RGB565 and sent to
VRAM. When the width==384 and height<=216 a buffer is created and the image is
read all at once then simply converted to RGB565 and send to VRAM