Talk:Image Formats

From UFOpaedia
Jump to navigation Jump to search

BDY format algorithm

The following line isn't quite right:

If "a" is 129 or greater, then draw 257-a pixels of the next byte; otherwise, read "a" bytes from the file and draw those colors sequentially.

It appears to be "read a+1 bytes" for BDY files, which makes sense. If this were not the case, the value of '0' would mean "read 0 bytes and draw", which would be wasting a whole code.

~ Renegrade 10:23, 19 August 2010 (EDT)

You're right, a+1 is correct. - Bomb Bloke 19:54, 19 August 2010 (EDT)


Typically images are stored sequentially in their archives, so once you know the offset to an image and the image after that you can then read out "x" number of bytes starting at TAB[i] (where "x" is TAB[i+1]-TAB[i] and "i" is the index of the image you wish to view).

This is not right. What if "i" was the last image, TAB[i+1] would point outside the TAB data. The system starts reading PCK data at the offset in the TAB data and stopped when 0xFF was read, that is where the 0xFF byte is for. I assume it is ok that I rewrite this a bit.

That is the exception that makes "Typically" right. Clearly if i is the last image then the "next image" doesn't exist, and any reader who was paying attention would know the delta procedure didn't apply.
Generally, these articles are written to be read vernacularly, rather than with philosophical or mathematical precision. That said, rewrites that increase clarity are welcome even if they convey the same information as before. -- Zaimoni, 23:09 Aug 31 2010 CDT