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

📄 tga.htm

📁 TGA格式
💻 HTM
📖 第 1 页 / 共 4 页
字号:
|        |        |  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 the |
|        |        |             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.                                           |
|        |        |                                                            |
|        |        |  the offset is determined by the size of the image         |
|        |        |  identification field.  the length is determined by        |
|        |        |  the color map specification, which describes the          |
|        |        |  size of each entry and the number of entries.             |
|        |        |  each color map entry is 2, 3, or 4 bytes.                 |
|        |        |  unused bits are assumed to specify attribute bits.        |
|        |        |                                                            |
|        |        |  the 4 byte entry contains 1 byte for blue, 1 byte         |
|        |        |  for green, 1 byte for red, and 1 byte of attribute        |
|        |        |  information, in that order.
|        |        |                                                            |
|        |        |  the 3 byte entry contains 1 byte each of blue, green,     |
|        |        |  and red.                                                  |
|        |        |                                                            |
|        |        |  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. |
|        |        |                                                            |
|--------|--------|------------------------------------------------------------|
| varies | varies |  image data field.                                         |
|        |        |                                                            |
|        |        |  this field specifies (width) x (height) color map         |
|        |        |  indices.  the indices are stored in packets.  there       |
|        |        |  two types of packets:  run-length packets, and raw        |
|        |        |  packets.  both types of packets consist of a 1-byte       |
|        |        |  header, identifying the type of packet and specifying a   |
|        |        |  count, followed by a variable-length body.                |
|        |        |  the high-order bit of the header is "1" for the           |
|        |        |  run length packet, and "0" for the raw packet.            |
|        |        |                                                            |
|        |        |  for the run-length packet, the header consists of:        |
|        |        |      __________________________________________________    |
|        |        |      | 1 bit |   7 bit repetition count minus 1.      |    |
|        |        |      |   id  |   since the maximum value of this      |    |
|        |        |      |       |   field is 127, the largest possible   |    |
|        |        |      |       |   run size would be 128.               |    |
|        |        |      |-------|----------------------------------------|    |
|        |        |      |   1   |  c     c     c     c     c     c    c  |    |
|        |        |      --------------------------------------------------    |
|        |        |                                                            |
|        |        |  for the raw packet, the header consists of:               |
|        |        |      __________________________________________________    |
|        |        |      | 1 bit |   7 bit number of pixels minus 1.      |    |
|        |        |      |   id  |   since the maximum value of this      |    |
|        |        |      |       |   field is 127, there can never be     |    |
|        |        |      |       |   more than 128 pixels per packet.     |    |
|        |        |      |-------|----------------------------------------|    |
|        |        |      |   0   |  n     n     n     n     n     n    n  |    |
|        |        |      --------------------------------------------------    |
|        |        |                                                            |
|        |        |  for the run length packet, the header is followed by      |
|        |        |  a single color index, which is assumed to be repeated     |
|        |        |  the number of times specified in the header.  the rle     |
|        |        |  packet may cross scan lines ( begin on one line and end   |
|        |        |  on the next ).                                            |
|        |        |                                                            |
|        |        |  for the raw packet, the header is followed by the number  |
|        |        |  of color indices specified in the header.  the raw        |
|        |        |  packet may cross scan lines ( begin on one line and end   |
|        |        |  on the next ).                                            |
|        |        |                                                            |
--------------------------------------------------------------------------------



</pre>
    <pre>--------------------------------------------------------------------------------
data type 10:  run length encoded, rgb 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 range  |
|        |        |  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.  wowie zowie.       |
|        |        |                                                            |
|--------|--------|------------------------------------------------------------|
|    2   |     1  |  image type code.                                          |
|        |        |                                                            |
|        |        |  binary 10 for this type of image.                         |
|        |        |                                                            |
|--------|--------|------------------------------------------------------------|
|    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.  this value is 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.          |
|        |        |                                                            |

⌨️ 快捷键说明

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