Author Topic: mViewer - Nspire BMP viewer  (Read 34131 times)

0 Members and 1 Guest are viewing this topic.

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: mViewer - Nspire BMP viewer
« Reply #75 on: December 15, 2010, 11:03:21 pm »
Nice, I'll have to try this eventually. :)

By the way what does RGB/BGR? I only think of red-green-blue, but the Nspire is grayscale so I am a bit confused... ???

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: mViewer - Nspire BMP viewer
« Reply #76 on: December 15, 2010, 11:07:45 pm »
Nice, I'll have to try this eventually. :)

By the way what does RGB/BGR? I only think of red-green-blue, but the Nspire is grayscale so I am a bit confused... ???
The driver takes full 16-bit RGB color values, but only 4 of the bits are used for the Nspire grayscale (it can be selected from the Red or Blue fields)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: mViewer - Nspire BMP viewer
« Reply #77 on: December 15, 2010, 11:07:56 pm »
Nice, I'll have to try this eventually. :)

By the way what does RGB/BGR? I only think of red-green-blue, but the Nspire is grayscale so I am a bit confused... ???

The screen does not support colors, but the LCD controller does.
So the LCD controller takes standard colors values in RGB OR BGR format.
TI-Planet co-admin.

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: mViewer - Nspire BMP viewer
« Reply #78 on: December 16, 2010, 04:57:43 am »
Oh right, I forgot about that. I see why it uses RGB/BGR, now.

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: mViewer - Nspire BMP viewer
« Reply #79 on: December 16, 2010, 09:40:57 pm »
Here is mviewer2 beta build 2.


Clearing code (when zooming out) has been optimized in order to clear only a box (although you'll probably won't notice any speed improvement, as I have to wait for the screen...).

I've added the parsing image progress in the top right hand corner, as you've asked for.


Remaining minor bugs:
* strange zoom in some situations
* the contrast delay is causing problems when in 31 gray levels mode
* when going back to the 16 gray levels mode, display mode is not reset to RGB: you may end in BGR mode and so get a slightly darker image, until the next time you press 'C'


You may get a new release before the end of the week.


Todo list:
* develop a "safest" way of waiting for the screen
* test 31 gray levels mode, by changing the screen base pointer, instead of switching between RGB and BGR.
* test modes with more than 31 gray levels
* change internal data from 16-bits to indexed 8-bits
* include PNG support
* include JPEG support
* include GIF support
* iinclude PDF support
« Last Edit: December 16, 2010, 09:41:51 pm by critor »
TI-Planet co-admin.

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: mViewer - Nspire BMP viewer
« Reply #80 on: December 16, 2010, 10:10:42 pm »
Nice. By the way, can those pictures be integrated in games?

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: mViewer - Nspire BMP viewer
« Reply #81 on: December 16, 2010, 10:18:29 pm »
Nice. By the way, can those pictures be integrated in games?

By taking my code and recompiling, yes.
As I'm "waiting" for the screen most of the time, the CPU is available if something has to be done while the image is displayed.

I don't know if it is possible without including my source and compiling: for example, I don't know if it is possible for a Ndless program to launch another Ndless program, and go on once the program has ended.
« Last Edit: December 16, 2010, 10:19:33 pm by critor »
TI-Planet co-admin.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: mViewer - Nspire BMP viewer
« Reply #82 on: December 16, 2010, 10:21:26 pm »
If you mean just displaying an image in an Ndless program, that can easily be done without any of critor's code
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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: mViewer - Nspire BMP viewer
« Reply #83 on: December 16, 2010, 10:23:11 pm »
Ah ok, well I meant a 31 level grayscale one like the ones generated with Critor's program. Thanks for the info.

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: mViewer - Nspire BMP viewer
« Reply #84 on: December 17, 2010, 08:43:22 am »
I've managed to compile zlib 1.2.5 library for the TI-Nspire, a light version customized for my needs.

I've removed everything related to compression, file reading, and file writing.
It is only intended to decompress data in buffers.

This is going to be needed for PNG support.


When compiling C code for the TI-Nspire, you have to remove all references to unsupported stdlib functions.
There were such problems in the removed files, but the included files are totally unaltered.


This is totally untested for now, but in case it can be usefull to someone, I've attached it.
Note: as you can guess, the produced binary "dummy.tns" souldn't do anything at all.
« Last Edit: December 17, 2010, 08:44:38 am by critor »
TI-Planet co-admin.

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: mViewer - Nspire BMP viewer
« Reply #85 on: December 17, 2010, 09:46:12 am »
PNG support sounds cool. Nice update Critor. :)

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: mViewer - Nspire BMP viewer
« Reply #86 on: January 03, 2011, 06:09:14 pm »
Finally, it's not easy to recompile existing C libraries (lPNG, libJPEG, zlib, sumatraPDF...) for the TI-Nspire.

You've got to remove most #include lines...
You've got to implement some missing functions...
Some libraries are using very OS-dependant functions (memory manager for exemple) which are implemented only for PC/Mac...

And after changing all this, you're getting something that compiles itself.
But it doesn't prove it is going to work...


For exemple, I managed to compile libJPEG and got... a reboot.

I've identified the problem. A similar problem has allready been reported by Mrakoplaz.

A function is stored as a pointer in a struct during initialisation.
And when that function is used (through the pointer) -> reboot... even if the function does nothing.
« Last Edit: January 03, 2011, 06:11:27 pm by critor »
TI-Planet co-admin.

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: mViewer - Nspire BMP viewer
« Reply #87 on: January 04, 2011, 02:24:00 pm »
I'm trying to make program ports easier.
I would be interested by the list of missing include files and functions to see how they could be added to Ndless.
May be you could share your patched version once ready (or even if you give up and stop working on it), I could just "diff" it with the orignal version.
Ndless.me with the finest TI-Nspire programs

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: mViewer - Nspire BMP viewer
« Reply #88 on: January 04, 2011, 02:24:53 pm »
zlib is already included in the OS by the way, and we have already identified some of its entry points, exporting them as syscalls shouldn't be too hard.
Ndless.me with the finest TI-Nspire programs

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: mViewer - Nspire BMP viewer
« Reply #89 on: January 04, 2011, 04:34:13 pm »
On a side note I would recommend to not double-post when there have been less than a few hours between your last reply (if it's the last one) or 1 hour when it's a project update, since on english forums, people tend to not like that ;) (unlike on french ones). In that case it's best to use the edit button. Otherwise I recommend a topic bump, though, else your update will be missed.
« Last Edit: January 04, 2011, 04:34:34 pm by DJ Omnimaga »