Alternatively, join us on Discord.

+-Recent Topics

Simple Image Viewer

Started by gameblabla, January 09, 2017, 03:01:29 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gameblabla

January 09, 2017, 03:01:29 am Last Edit: May 26, 2018, 02:04:37 am by gameblabla
Here's a simple image viewer for the TI Nspire CX & (maybe) Monochrome nspires.



It supports PNG, BMP, and JPEG files. (Baseline & Progressive)
It's pretty fast, fairly small and has a codebase that is easier to read than mViewerCX, which is absolutely monstrous...
However it struggles with big images files and there are some corruptions for BMP files.
So if you want to load huge image files on your nspire, stick with mViewerCX.

For big images, switch to cropping mode with the DEL key and it will benefit from a smoother framerate, much better than mViewerCX.
However, you can't zoom in/out in "cropping" mode, unlike the default "scaling" mode.
It also uses my explorer browser, which is much simpler to use unlike the one in mViewerCX which is horrible to use, seriously.

I originally made this so i can watch my pr0nographic images on my calc and because i did not enjoy using mViewerCX
with its slow framerate and awful interface.

Source code is here :
https://github.com/gameblabla/simpleimageviewer

[spoiler]
Here's an OS version for ControlX 4.3.6 (Deprecated, slower than ndless version) :
https://codewalr.us/index.php?topic=1820.msg50693#msg50693
[/spoiler]

Video of it running :
https://gameblabla.nl/files/imgviewer_speedcompar.mp4

Btw, this uses a modified version of n2DLib and OK_JPG as well as LodePNG.

Juju

ohai it's me as the example~

Anyway, nice.
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron



if you wanna throw money at me and/or CodeWalrus monthly it's here

gameblabla

January 09, 2017, 03:38:45 am #2 Last Edit: January 09, 2017, 03:44:14 am by gameblabla
Quote from: Juju on January 09, 2017, 03:19:21 am
ohai it's me as the example~

Yeah... my computer is filled with pr0n and this was the only rare image that was not pr0nographic on my PC.
glad you don't mind

Also, i would be happy if anyone could take a look at the cooode and tell me what could be possibly improved.

p2

having ONLY pron on your pc already sounds weird...
but it sounds even worse, having only pron aaaand pics of Juju on your PC :ninja:
I mean... WHY??  :ninja:

anyways, nice work, can you give us a gof of it and maybe some info on the speed and size? :)
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

Snektron

(maybe the pron and the pictures of juju are on his pc for the same reason  O.O)
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


p2

exactly what I was thinking...  :ninja:

inb4 kotu revealing Juju's and gameblabla's secret relationship....
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

Juju

Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron



if you wanna throw money at me and/or CodeWalrus monthly it's here

p4nix

Maybe you would switch your mind if you knew how @gameblabla looks like, please note it's only a identikit picture ;)

gameblabla

January 10, 2017, 04:25:34 pm #8 Last Edit: January 10, 2017, 04:28:26 pm by gameblabla
I look nothing like this p4nix...

Also, for the kicks, i made an OS version based on Dummy OS.
This version requires the very latest version of ControlX installed, as version 3.4.5 has a bug that prevents Dummy OS from running.

I compared the Ndless version and the OS version and here's the verdict :
https://gameblabla.nl/files/imgviewer_speedcompar.mp4

The OS version, which has no overhead, more memory available, is twice to three slower than the TI version !
Not only that, it's very unstable and it will refuse to run if the image is more than 2MB...
Why is that ? Stack issues ? Missing code to turn it in fast mode ? Underclocked cpu ?
Or even something else entirely ?
Because it seems that it does not use the full 64Mb...

Btw, the os version is flickering because it has no buffering, i hope this will figured out because i don't have access to malloc.
(maybe it is in boot1 but where ?)

Oh, no way i would be interested in juju, he's too hairy and beardy.

p2

that beard sure is worth zooming in  :thumbsup:
but it wurts to see you use inverted controls D:

anyways the speed is still impressive :)
I wonder how much the speed would drop for multi-layer games... O.O
what language is used for the CX CAS again...? (I happen to have that one, too)
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

gameblabla

Quote from: p2 on January 10, 2017, 04:31:30 pmthat beard sure is worth zooming in  :thumbsup:

worth the wait

Quote from: p2 on January 10, 2017, 04:31:30 pm
anyways the speed is still impressive :)
*
I disagree, the OS version is fricking horrible...
If anyone wants to take a look at the dummy os version, it's here :
https://github.com/gameblabla/simpleimageviewer/tree/dummyos

Quote from: p2 on January 10, 2017, 04:31:30 pm
I wonder how much the speed would drop for multi-layer games... O.O
what language is used for the CX CAS again...? (I happen to have that one, too)

It's entirely programmed in C here with the GCC toolchain.
Of course, this only works with Ndless or ControlX.

p2

ugh, havng to learn C first... D:

I still like it, even if you think its too slow xD
Fot an image viewer, it's perfect :)
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

gameblabla

Erm...
So back to TI-nspire dev now, somewhat.

I found another Jpeg decoder called OK_JPG. Although twice as large as Tiny JPEG Decoder, this one supports Progressive JPEGs, which are becoming more common.
In addition to that, the new lcd blit api is now used, which means it should work better on newer Nspires as well as older calcs.
A bug with PNG files has also been fixed.

Give it a try, download is at the first post.

I also have plans to add SVG support. (fairly basic support)

Powered by EzPortal