⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tga.htm

📁 TGA格式
💻 HTM
📖 第 1 页 / 共 4 页
字号:
_______________________________________________________________________________|
| offset | length |                     description                            |
|--------|--------|------------------------------------------------------------|
|--------|--------|------------------------------------------------------------|
|    0   |     1  |  number of characters in identification field.             |
|        |        |                                                            |
|        |        |  this field is a one-byte unsigned integer, specifying     |
|        |        |  the length of the image identification field.  its value  |
|        |        |  is 0 to 255.  a value of 0 means that no image            |
|        |        |  identification field is included.                         |
|        |        |                                                            |
|--------|--------|------------------------------------------------------------|
|    1   |     1  |  color map type.                                           |
|        |        |                                                            |
|        |        |  this field contains either 0 or 1.  0 means no color map  |
|        |        |  is included.  1 means a color map is included, but since  |
|        |        |  this is an unmapped image it is usually ignored.  tips    |
|        |        |  ( a targa paint system ) will set the border color        |
|        |        |  the first map color if it is present.                     |
|        |        |                                                            |
|--------|--------|------------------------------------------------------------|
|    2   |     1  |  image type code.                                          |
|        |        |                                                            |
|        |        |  this field will always contain a binary 2.                |
|        |        |  ( that's what makes it data type 2 ).                     |
|        |        |                                                            |
|--------|--------|------------------------------------------------------------|
|    3   |     5  |  color map specification.                                  |
|        |        |                                                            |
|        |        |  ignored if color map type is 0; otherwise, interpreted    |
|        |        |  as follows:                                               |
|        |        |                                                            |
|    3   |     2  |  color map origin.                                         |
|        |        |  integer ( lo-hi ) index of first color map entry.         |
|        |        |                                                            |
|    5   |     2  |  color map length.                                         |
|        |        |  integer ( lo-hi ) count of color map entries.             |
|        |        |                                                            |
|    7   |     1  |  color map entry size.                                     |
|        |        |  number of bits in color map entry.  16 for the targa 16,  |
|        |        |  24 for the targa 24, 32 for the targa 32.                 |
|        |        |                                                            |
|--------|--------|------------------------------------------------------------|
|    8   |    10  |  image specification.                                      |
|        |        |                                                            |
|    8   |     2  |  x origin of image.                                        |
|        |        |  integer ( lo-hi ) x coordinate of the lower left corner   |
|        |        |  of the image.                                             |
|        |        |                                                            |
|   10   |     2  |  y origin of image.                                        |
|        |        |  integer ( lo-hi ) y coordinate of the lower left corner   |
|        |        |  of the image.                                             |
|        |        |                                                            |
|   12   |     2  |  width of image.                                           |
|        |        |  integer ( lo-hi ) width of the image in pixels.           |
|        |        |                                                            |
|   14   |     2  |  height of image.                                          |
|        |        |  integer ( lo-hi ) height of the image in pixels.          |
|        |        |                                                            |
|   16   |     1  |  image pixel size.                                         |
|        |        |  number of bits in a pixel.  this is 16 for targa 16,      |
|        |        |  24 for targa 24, and .... well, you get the idea.         |
|        |        |                                                            |
|   17   |     1  |  image descriptor byte.                                    |
|        |        |  bits 3-0 - number of attribute bits associated with each  |
|        |        |             pixel.  for the targa 16, this would be 0 or   |
|        |        |             1.  for the targa 24, it should be 0.  for     |
|        |        |             targa 32, it should be 8.                      |
|        |        |  bit 4    - reserved.  must be set to 0.                   |
|        |        |  bit 5    - screen origin bit.                             |
|        |        |             0 = origin in lower left-hand corner.          |
|        |        |             1 = origin in upper left-hand corner.          |
|        |        |             must be 0 for truevision images.               |
|        |        |  bits 7-6 - data storage interleaving flag.                |
|        |        |             00 = non-interleaved.                          |
|        |        |             01 = two-way (even/odd) interleaving.          |
|        |        |             10 = four way interleaving.                    |
|        |        |             11 = reserved.                                 |
|        |        |                                                            |
|--------|--------|------------------------------------------------------------|
|   18   | varies |  image identification field.                               |
|        |        |  contains a free-form identification field of the length   |
|        |        |  specified in byte 1 of the image record.  it's usually    |
|        |        |  omitted ( length in byte 1 = 0 ), but can be up to 255    |
|        |        |  characters.  if more identification information is        |
|        |        |  required, it can be stored after the image data.          |
|        |        |                                                            |
|--------|--------|------------------------------------------------------------|
| varies | varies |  color map data.                                           |
|        |        |                                                            |
|        |        |  if the color map type is 0, this field doesn't exist.     |
|        |        |  otherwise, just read past it to get to the image.         |
|        |        |  the color map specification describes the size of each    |
|        |        |  entry, and the number of entries you'll have to skip.     |
|        |        |  each color map entry is 2, 3, or 4 bytes.                 |
|        |        |                                                            |
|--------|--------|------------------------------------------------------------|
| varies | varies |  image data field.                                         |
|        |        |                                                            |
|        |        |  this field specifies (width) x (height) pixels.  each     |
|        |        |  pixel specifies an rgb color value, which is stored as    |
|        |        |  an integral number of bytes.                              |
|        |        |                                                            |
|        |        |  the 2 byte entry is broken down as follows:               |
|        |        |  arrrrrgg gggbbbbb, where each letter represents a bit.    |
|        |        |  but, because of the lo-hi storage order, the first byte   |
|        |        |  coming from the file will actually be gggbbbbb, and the   |
|        |        |  second will be arrrrrgg. "a" represents an attribute bit. |
|        |        |                                                            |
|        |        |  the 3 byte entry contains 1 byte each of blue, green,     |
|        |        |  and red.                                                  |
|        |        |                                                            |
|        |        |  the 4 byte entry contains 1 byte each of blue, green,     |
|        |        |  red, and attribute.  for faster speed (because of the     |
|        |        |  hardware of the targa board itself), targa 24 images are  |
|        |        |  sometimes stored as targa 32 images.                      |
|        |        |                                                            |
--------------------------------------------------------------------------------



</pre>
    <pre>--------------------------------------------------------------------------------
data type 9:  run length encoded, color-mapped images.                         |
_______________________________________________________________________________|
| offset | length |                     description                            |
|--------|--------|------------------------------------------------------------|
|--------|--------|------------------------------------------------------------|
|    0   |     1  |  number of characters in identification field.             |
|        |        |                                                            |
|        |        |  this field is a one-byte unsigned integer, specifying     |
|        |        |  the length of the image identification field.  its value  |
|        |        |  is 0 to 255.  a value of 0 means that no image            |
|        |        |  identification field is included.                         |
|        |        |                                                            |
|--------|--------|------------------------------------------------------------|
|    1   |     1  |  color map type.                                           |
|        |        |                                                            |
|        |        |  this field is always 1 for color-mapped images.           |
|        |        |                                                            |
|--------|--------|------------------------------------------------------------|
|    2   |     1  |  image type code.                                          |
|        |        |                                                            |
|        |        |  a binary 9 for this data type.                            |
|        |        |                                                            |
|--------|--------|------------------------------------------------------------|
|    3   |     5  |  color map specification.                                  |
|        |        |                                                            |
|    3   |     2  |  color map origin.                                         |
|        |        |  integer ( lo-hi ) index of first color map entry.         |
|        |        |                                                            |
|    5   |     2  |  color map length.                                         |
|        |        |  integer ( lo-hi ) count of color map entries.             |
|        |        |                                                            |
|    7   |     1  |  color map entry size.                                     |
|        |        |  number of bits in each color map entry.  16 for the       |
|        |        |  targa 16, 24 for the targa 24, 32 for the targa 32.       |
|        |        |                                                            |
|--------|--------|------------------------------------------------------------|
|    8   |    10  |  image specification.                                      |
|        |        |                                                            |
|    8   |     2  |  x origin of image.                                        |
|        |        |  integer ( lo-hi ) x coordinate of the lower left corner   |
|        |        |  of the image.                                             |
|        |        |                                                            |
|   10   |     2  |  y origin of image.                                        |
|        |        |  integer ( lo-hi ) y coordinate of the lower left corner   |

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -