We're on Discord! Please join our server now if you don't want to miss anything! (More info) | Join the UCC4 contest! (More info)

* WalrusIRC & Discord main room

If you have a forum account, have more than 4 posts and are not part of a restricted usergroup, then you can chat in our main Discord server room directly from here and continue using the forums at the same time. Or you can join our server directly and access many more discussion rooms!

Author Topic: Custom Bitmap Format  (Read 600 times)

0 Members and 1 Guest are viewing this topic.

Offline rowan_futurerave

  • Full User
  • Disabled shoutbox mode
  • Restricted (shoutbox)
  • Join Date: Aug 2018
  • Location:
  • Posts: 39
  • Post Rating Ratio: +0/-0
    • rowanmedhurst
    • Futurerave
  • Gender: Male
Custom Bitmap Format
« on: November 16, 2018, 08:46:55 am »
Hi all. Am thinking of creating a custom bitmap format due to awkwardness I am experiencing with a lib (glaux.lib) which has been deprecated.

What would anyone else add to a custom bitmap format?

Not RLE. Possibly encryption. What else??

 >:D

*edit - one idea - strangely ordered scanlines
« Last Edit: November 16, 2018, 09:13:39 am by rowan_futurerave »


  • Calculators owned: TI-84 Plus CE-T, CASIO fx-CG50

Offline gameblabla

  • Super User
  • Join Date: May 2015
  • Location:
  • Posts: 818
  • Post Rating Ratio: +15/-7
  • TI-nspire porter
Re: Custom Bitmap Format
« Reply #1 on: November 16, 2018, 01:39:14 pm »
You could use a raw format (RGB565, RGB8, RGB555 etc...) then compress it with an algorithm known to decompress pretty fast such as lz4.If your compiler is somewhat modern, then the best choice would probably be zStandard. It has higher compression rates than lz4 while being much faster than its other alternatives. (although lz4 is still faster)
If your platform is using a Motorola 68000 cpu, stef made a fast decompressor called lz4w for that CPU family. It can be found in assembly form here :https://github.com/Stephane-D/SGDK/blob/e8d6e7e6668579e1299e19f1c024dd8dc16d430e/src/tools_a.s
Function call in C is as such :
Code: [Select]
u16 lz4w_unpack(const u8 *src, u8 *dest); On the same platform, aplib is also another good alternative but it's a fair amount slower.
As for encryption, well it's just easier to do it outside out of the file format because that would require more work (separate the actual image data from the header then compare it to a hash etc...).
Make sure the file format meets your needs only. On the Atari falcon, space was of no concern so i simply made a raw RGB565 format except flipped for Big endian cpus. Of course on little endian machines, this is not a concern and you can go for compression for example.
  • Calculators owned: TI Nspire CX, TI-89

Offline rowan_futurerave

  • Full User
  • Disabled shoutbox mode
  • Restricted (shoutbox)
  • Join Date: Aug 2018
  • Location:
  • Posts: 39
  • Post Rating Ratio: +0/-0
    • rowanmedhurst
    • Futurerave
  • Gender: Male
Re: Custom Bitmap Format
« Reply #2 on: November 16, 2018, 11:29:58 pm »
Nice thoughts gameblabla you have inspired me, I now have decided on the file spec. Woot  (-_(//));
  • Calculators owned: TI-84 Plus CE-T, CASIO fx-CG50

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games