Author Topic: Casio prizm PNG viewer  (Read 9510 times)

0 Members and 1 Guest are viewing this topic.

Offline ProgrammerNerd

  • LV3 Member (Next: 100)
  • ***
  • Posts: 50
  • Rating: +9/-2
    • View Profile
Casio prizm PNG viewer
« on: May 31, 2014, 10:52:17 pm »
Download here http://www.casiopeia.net/forum/downloads.php?view=detail&df_id=147
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
===========================================
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 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
============================================
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
===========================================
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:
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 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
« Last Edit: June 01, 2014, 10:38:54 am by ProgrammerNerd »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Casio prizm PNG viewer
« Reply #1 on: June 01, 2014, 12:08:48 pm »
Nice to see this out. I can't check it now but is it compatible with mViewer GX?

Offline ProgrammerNerd

  • LV3 Member (Next: 100)
  • ***
  • Posts: 50
  • Rating: +9/-2
    • View Profile
Re: Casio prizm PNG viewer
« Reply #2 on: June 01, 2014, 03:53:58 pm »
I do not know. What format does it open if I can see the specifications I could make a viewer.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Casio prizm PNG viewer
« Reply #3 on: June 01, 2014, 03:57:23 pm »
Be careful with image viewers though. I hear Casio is tolerant towards native programs so long as we don't make cheating tools and this is totally in a gray area. Nice to see you did it though. :)

Offline ProgrammerNerd

  • LV3 Member (Next: 100)
  • ***
  • Posts: 50
  • Rating: +9/-2
    • View Profile
Re: Casio prizm PNG viewer
« Reply #4 on: June 01, 2014, 04:56:21 pm »
Where did you hear that? Has a Casio employee said so?
You do realize like many other graphing calculators you can cheat using only pre-installed software.
Why would this matter?

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Casio prizm PNG viewer
« Reply #5 on: June 01, 2014, 05:27:48 pm »
I know that the American models have images disabled for a reason. I've read that a few times here and on TI-Planet. As long as they do not complain it's fine I guess and I am aware that built in software allows cheating. Calculator = cheat anyway. Even when legitimately using it without any programs.

Offline ProgrammerNerd

  • LV3 Member (Next: 100)
  • ***
  • Posts: 50
  • Rating: +9/-2
    • View Profile
Re: Casio prizm PNG viewer
« Reply #6 on: June 01, 2014, 06:11:47 pm »
I do see your point. However I do think we will be fine, I do not expect this add-in to cause any trouble.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Casio prizm PNG viewer
« Reply #7 on: June 01, 2014, 09:57:37 pm »
We will be fine, because a PNG viewer doesn't tamper with the protection against full color g3p/b files on the American PRIZM models. People used to be concerned about image viewers in the past because they feared it would literally circumvent the exam/teacher limitations via some hack, which is the very reason why TI is blocking Ndless and nLaunchy, but if you just allow the calc to open a different image format such as PNG, you should be fine.

Also no employee directly said so, but in 2012 there were concerns from some community users about a g3p limitation removal program discussed on Omni because people feared Casio could lock the calc down. In early 2011, Casio apparently told some popular community members that ASM/C support isn't official, but they will not lock the calc down as long as we don't tamper with their exam/teacher restrictions.
« Last Edit: June 01, 2014, 10:00:10 pm by DJ Omnimaga »

Offline ProgrammerNerd

  • LV3 Member (Next: 100)
  • ***
  • Posts: 50
  • Rating: +9/-2
    • View Profile
Re: Casio prizm PNG viewer
« Reply #8 on: June 01, 2014, 11:31:31 pm »
Alright good to know. I do not have any plans to tamper with exam restrictions.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Casio prizm PNG viewer
« Reply #9 on: June 02, 2014, 12:54:04 am »
Oh OK then. Thanks for making it clear DJ.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Casio prizm PNG viewer
« Reply #10 on: July 27, 2014, 09:40:34 pm »
Bump:

On a side note, does this even make any sense for Casio to keep the restrictions intact on the FX-cg10 models now that the HP Prime and TI-84 Plus C Silver Edition are out? Both those models have built-in image support, yet they got approved at the SAT, PSAT and AP tests.


Also apparently the restrictions for the built-in PRIZM image format also apply to 3 bit images that can be created on-calc. I am unsure if that's the case for images created directly on-calc, but could someone try to display the following file on their own FX-cg10 to see if it works?

http://www.omnimaga.org/pixel-art-and-drawing/mockups-'please-say-this-is-going-to-be-a-game'/?action=dlattach;attach=16815