I decided to write a utility to do a number of things with a targa image, one of which is to decompress it.
Using a targa image I have, I am looking at the encoding it has.
This snippet contains the tga header and a small amount of pixel data.Code:00 00 0A 00 00 00 00 00 00 00 00 00 1C 00 18 01 18 00 01 BD AD 6F B5 A8 6E 81 88 81 5A 02
Noting the 0x0A (10), it has run-length encoding.
From what I have read about RLE, I have found tutorials that are completely opposite of each other. I am not sure which result is correct:
Data - AAAAAAAAAAAAABBCCCCCCCCCCCC
Would this be encoded as:
Looking at the data above, you can see the pixel data starts with this snippet:
How would i separate this out?Code:01 BD AD 6F B5 A8 6E 81 88 81 5A 02
1 pixel of BD, AD, 6F?
181 pixels! of A8, 6E, 81?