Indexed graphics for retro engine?

Adam D. Ruppe destructionator at gmail.com
Fri Sep 20 00:41:58 UTC 2019


On Thursday, 19 September 2019 at 03:47:05 UTC, Shadowblitz16 
wrote:
> Is there a way to make a indexed graphics library that can 
> handle importing and exporting true color images?
>
> I would guess something like this could be simulated with 
> pointers and references right?

My color.d actually can do it.

http://dpldocs.info/experimental-docs/arsd.color.html

it has a true color to indexed quantize function: 
http://dpldocs.info/experimental-docs/arsd.color.quantize.html

my png.d is capable of loading and saving them:

http://dpldocs.info/experimental-docs/arsd.png.readPng.html

you will want to cast it to IndexedImage or cast it to 
TrueColorImage and quantize to get an indexed one.

and my simpledisplay.d knows how to display them, but it does so 
via conversions so palette swaps won't just work live like on a 
real DOS system or whatever.

http://dpldocs.info/experimental-docs/arsd.simpledisplay.Image.fromMemoryImage.html


all the module's source code are in here:
https://github.com/adamdruppe/arsd


but otherwise the support is not great because it is just 
whenever I decide to answer emails and i'm gonna be busy this 
next week. but it might be useful to you


More information about the Digitalmars-d-learn mailing list