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

0 Members and 1 Guest are viewing this topic.

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: mViewer - Nspire BMP viewer
« Reply #15 on: December 12, 2010, 11:00:55 pm »
Awesome Critor! Is it based on Bwang's BMP viewer by the way?

No it is not.
(I would first have asked for his permission)

The display code is based on the demo that was published on TI-Bank a year ago.
I've added some scrolling code and double-buffering.
Levak helped me to add zoom in/out code.

And BMP support was started from scratch and is designed to be very generic
Bwang's was only supporting 24-bits if i remember well.


Please go on telling me about your good/bad BMP experiences with the viewer.
This might be the 1st program I'm going to submit to Ticalc.

Thank you all again.
TI-Planet co-admin.

SirCmpwn

  • Guest
Re: mViewer - Nspire BMP viewer
« Reply #16 on: December 12, 2010, 11:06:15 pm »
Size: 1.54 MB
Dimensions: 1024x768

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: mViewer - Nspire BMP viewer
« Reply #17 on: December 12, 2010, 11:16:28 pm »
Size: 1.54 MB
Dimensions: 1024x768



Strangely, I've got a working 1.75Mb bitmap.
So size doesn't seem to be a problem.

Could you upload that file too?


When you get a reboot, you should try again immediatly.
If it does reboot again, the problem comes from the image.

If it does not, then it was a bug from mViewer or Ndless.


I got some reboots while using mViewer, but they were quite rare and non reproduceable.
I alose got some rare reboots while not using mViewer... (reboots which could then be Ndless related)
TI-Planet co-admin.

SirCmpwn

  • Guest
Re: mViewer - Nspire BMP viewer
« Reply #18 on: December 12, 2010, 11:17:24 pm »
I'd like to suggest having it zoom in on the currently scrolled-to spot as well, instead of jumping to the top-left.

Image (PNG format, I converted it to a bmp first with the same software as before):
« Last Edit: December 12, 2010, 11:18:03 pm by SirCmpwn »

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 #19 on: December 12, 2010, 11:19:01 pm »
Awesome Critor! Is it based on Bwang's BMP viewer by the way?

No it is not.
(I would first have asked for his permission)

The display code is based on the demo that was published on TI-Bank a year ago.
I've added some scrolling code and double-buffering.
Levak helped me to add zoom in/out code.

And BMP support was started from scratch and is designed to be very generic
Bwang's was only supporting 24-bits if i remember well.


Please go on telling me about your good/bad BMP experiences with the viewer.
This might be the 1st program I'm going to submit to Ticalc.

Thank you all again.
Ah ok. I'll probably try it tomorrow unless I forget. I will install OS 1.7 anyway to try Ndless. I wonder how great will the original Omnimaga logo (2001) look like on my Nspire screen. ;D

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: mViewer - Nspire BMP viewer
« Reply #20 on: December 12, 2010, 11:26:58 pm »
Wow SirCmpwn... that's a huge picture.

The PNG is allready 1.5Mb large...
The 24-bits uncompressed BMP is going to be... bigger! :p


Maybe a malloc did fail...
(any segmentation fault is triggering a reboot on the Nspire)
I suppose I should test for the return of the malloc.
« Last Edit: December 12, 2010, 11:27:11 pm by critor »
TI-Planet co-admin.

SirCmpwn

  • Guest
Re: mViewer - Nspire BMP viewer
« Reply #21 on: December 12, 2010, 11:29:09 pm »
I went for stress-testing, and I got it :)

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: mViewer - Nspire BMP viewer
« Reply #22 on: December 12, 2010, 11:31:16 pm »
I went for stress-testing, and I got it :)

I've converted your PNG to a 24-bits uncompressed BMP (2.25Mb) using The GIMP.
It works on calc, and it looks very great. My Nspire looks great, thanks to you!

Maybe you had less available RAM than me...
Or maybe there was a difference in the file again.

I'll try to install Paint.net tomorrow.
Thanks again.
TI-Planet co-admin.

SirCmpwn

  • Guest
Re: mViewer - Nspire BMP viewer
« Reply #23 on: December 12, 2010, 11:35:01 pm »
Sounds good, and you're welcome for the epic pics :)
Can you attach the bmp to a post here, so I can try it, too?

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: mViewer - Nspire BMP viewer
« Reply #24 on: December 12, 2010, 11:40:55 pm »
Here's the BMP.
It worked on my calc, so it should work on yours... after a reboot in the worst case (RAM cleared).

We should take a memorial photo after cleaning the screen :p
TI-Planet co-admin.

SirCmpwn

  • Guest
Re: mViewer - Nspire BMP viewer
« Reply #25 on: December 12, 2010, 11:57:33 pm »
Thanks.  Also, in your source code, you have browse.c which exposes chooseFile(char*, char*).  This returns an int.  What is represented by that int?

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: mViewer - Nspire BMP viewer
« Reply #26 on: December 13, 2010, 12:03:30 am »
Thanks.  Also, in your source code, you have browse.c which exposes chooseFile(char*, char*).  This returns an int.  What is represented by that int?

It just indicates if the choice was validated (enter key with a file selected) or cancelled (esc key).
It's like a basic "ok/cancel" borwsing dialog box.
TI-Planet co-admin.

SirCmpwn

  • Guest
Re: mViewer - Nspire BMP viewer
« Reply #27 on: December 13, 2010, 12:06:52 am »
Ah, I see.  Also, given file and dispHex(char), the following should display the first 5 bytes, correct?
Code: [Select]
file = fopen(path, "rb");
clrScr();
resetConsole();
for (i = 0; i < 5; i++)
{
fread(currentByte, 1, 1, file);
dispHex(currentByte);
}
« Last Edit: December 13, 2010, 12:07:10 am by SirCmpwn »

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: mViewer - Nspire BMP viewer
« Reply #28 on: December 13, 2010, 12:19:29 am »
Ah, I see.  Also, given file and dispHex(char), the following should display the first 5 bytes, correct?
Code: [Select]
file = fopen(path, "rb");
clrScr();
resetConsole();
for (i = 0; i < 5; i++)
{
fread(currentByte, 1, 1, file);
dispHex(currentByte);
}

yes, correct
TI-Planet co-admin.

SirCmpwn

  • Guest
Re: mViewer - Nspire BMP viewer
« Reply #29 on: December 13, 2010, 12:23:53 am »
That's odd, because it means that all of my files on my Nspire have five zeros to start them.