Register

[PRIZM] PNG viewer

Topics on released projects. Only the author of a program should start a topic on it.
Junior Member
Posts: 17
Joined: Mon Dec 16, 2013 6:50 am
Calculators: Casio fx-CG10, Casio fx-CG50

[PRIZM] PNG viewer

Postby ProgrammerNerd » Sun Jun 01, 2014 3:51 am

The source code can be found on GitHub and the add-in is available here
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.

Description: Show
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 filtering is used, but if there is intrest I may replace it with something better.

The version you downloaded is version 1.0
It is likely that there will be versions, so if you notice that I post in the thread
see what I put it may be an update.

Controls: Show
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 actully takes you to the menu) to go back to the file browser.

Notes and Tips: Show
Since the casio prizm does not have lots of memory run pngout on the images before putting them on your calculator.
I have included instructions on how to compile libpng and zlib here
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 containg rgb565 data.
I however would not use png instead I would just use zlib directly with a simpler image format.
For example uint32_t width,uint32_t height, deflate compressed sequential rgb565 data created by zlib's deflate(2) function.
But if you feel comfortable with png that is an option.
Also you can store the pngs as a const array it does not need to be a file. I just used files because this is an image viewer.
The purpse of this program is simply to show off how capable the casio prizm is.
The PNG image format is well know and I think some people wrongly precive 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
Ony enough ram to hold 2 rows is 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 interoplates 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

Member
User avatar
Posts: 31
Joined: Wed Apr 18, 2012 4:48 pm

Re: [PRIZM] PNG viewer

Postby Cartix » Mon Jun 09, 2014 4:35 pm

I edited your post to make it more stuctured, using appropriated BBCode template ;)
This seems to be a usefull program (it's easier to make a png than to make a .g3p)
Don't worry about releasing lots of version, if it's important and it can avoid bug :)
Image

Junior Member
Posts: 17
Joined: Mon Dec 16, 2013 6:50 am
Calculators: Casio fx-CG10, Casio fx-CG50

Re: [PRIZM] PNG viewer

Postby ProgrammerNerd » Mon Jun 16, 2014 3:07 am

Thank you Cartix. I do not have a problem with releasing lots of versions I just though some people may find it annoying to put the application on their calculator and then see that there is an update just hours after they put it on so they have to do it again. I am glad that you found my program useful. Also speaking of g3p I own the fx-CG10 meaning I cannot open a g3p. This program works on all casio prizms.

Return to Released Projects

Who is online

Users browsing this forum: No registered users and 12 guests