TGA Decoder

Hi all,

I’ve been using the TWL PNGDecoder quite regularly but couldn’t find a comparable decoder for TGA images which I use sometimes, so I thought I’d have a go at writing one. I’ve written it to work in the same way as the PNGDecoder (create a new decoder object with an input stream, then call decode and supply a bytebuffer). You can find it here:

It supports 24-bit (RGB) and 32-bit (RGBA) formats, and uncompressed or RLE Compressed formats. On my 2.7ghz i7 it took 180ms to decode a 40mb compressed 2988×5312x24 photo and around 80ms to decode a 15mb compressed 2048x2048x32 image. Uncompressed images take around half that time.

Hope someone finds this helpful!