In the TGA file format, what is the purpose of the x origin and y origin?
Asked Answered
B

1

9

The TGA image specification contains these two fields:

Field 5.1 (2 bytes) - X-origin of Image:
    These bytes specify the absolute horizontal coordinate for the lower
    left corner of the image as it is positioned on a display device having
    an origin at the lower left of the screen (e.g., the TARGA series).

Field 5.2 (2 bytes) - Y-origin of Image:
    These bytes specify the absolute vertical coordinate for the lower
    left corner of the image as it is positioned on a display device having
    an origin at the lower left of the screen (e.g., the TARGA series).

This seems strange to me. Why is the position of an image on the screen contained in the data for the image itself? I would expect that images don't care about where they are positioned, since that's the responsibility of the rendering engine. Could it have to do with the fact that TGA images were designed for special video cards?

Here's a link to the TGA spec for reference: http://www.dca.fee.unicamp.br/~martino/disciplinas/ea978/tgaffs.pdf

Blossom answered 4/8, 2014 at 6:53 Comment(0)
B
5

After some conversation, we've deduced that these fields were used to decompose large images into many smaller images. For example, the 3Dfx video cards were most efficient at drawing full-screen images if you split the image into 256x256 blocks. The offset of those blocks on the screen could be represented using this field, which would allow the renderer to reconstruct the original image.

See this Twitter thread: https://twitter.com/Donzanoid/status/496248178799550464

Blossom answered 4/8, 2014 at 22:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.