On my research for RLE decompression of Bitmaps i have stumbled across a possible "delta"-combination, which basically skips a certain amount of "dont care" pixels. I just cannot wrap my head around how this should work. How am i supposed to just skip the these pixels, they have to be filled with SOME value, and how do i pass this information of these pixels being "dont care" pixels. Im losing my mind..!
Here are the main two sources and a excerpt of the interesting part:
- http://www.fileformat.info/format/bmp/egff.htm
- https://learn.microsoft.com/de-de/windows/win32/gdi/bitmap-compression
The last marker is the run offset marker, also called a delta or vector code. This marker is four bytes in size, with the first two bytes being the values 00 and 02, and the last two values specifying a pixel address using unsigned X and Y values as an offset from the current bitmap cursor position. The X value is the number of pixels across the scan line, and the Y value is the number of rows forward in the bitmap.
This run offset marker indicates the location in the bitmap where the next decoded run of pixels should be written. For example, a run offset marker value of 00 02 05 03 would indicate that the offset of the bitmap cursor should move five pixels down the scan line, three rows forward, and write out the next run. The cursor then continues writing decoded data from its new position moving forward.
Run offset markers are used when a bitmap may contain a large amount of "don't care" pixels. For example, if the BMP file holds a bitmap used as a mask (such as those used with icons and pointers), many of the pixels in the rectangular bitmap may not be used. Rather than store these unused pixels in the BMP file, only the significant pixels are stored, and the delta markers are used as "jumps" to skip over the parts of the bitmap not actually used in the mask.
Thank you very much!