没有合适的资源?快使用搜索试试~ 我知道了~
TGA 文件格式标准
5星 · 超过95%的资源 需积分: 9 107 下载量 193 浏览量
2008-12-15
02:01:42
上传
评论 1
收藏 177KB PDF 举报
温馨提示
试读
29页
TGA标准TGA标准TGA标准TGA标准TGA标准TGA标准TGA标准TGA标准TGA标准TGA标准TGA标准TGA标准TGA标准TGA标准TGA标准TGA标准TGA标准
资源推荐
资源详情
资源评论
Truevision TGAª
FILE FORMAT SPECIFICATION
Version 2.0
Document prepared by:
Truevision, Inc.
7340 Shadeland Station
Indianapolis, IN 46256-3925
800-729-2656 - phone
317-576-7700 - FAX
317-577-8777 - BBS
http://www.truevision.com/
Technical Manual Version 2.2 January, 1991
Copyright© 1989, 1990, 1991 Truevision, Inc.
Truevision is a registered trademark of Truevision, Inc.
TARGA is a registered trademark of Truevision, Inc.
TrueVista is a registered trademark of Truevision, Inc.
ATVista is a registered trademark of Truevision, Inc.
NuVista is a registered trademark of Truevision, Inc.
TIPS is a registered trademark of Truevision, Inc.
TGA is a trademark of Truevision, Inc.
Disclaimer of Warranties and Limitations of Liabilities
This manual and the enclosed software were prepared by Truevision, Inc. While the authors and program
developers have taken reasonable care in preparing this manual to assure accuracy, the authors assume no
liability resulting from any inaccuracy or omissions contained in them or from the use of the information or
programs contained herein.
The authors and Truevision, Inc. have no expressed or implied warranty
of any kind with regard to these programs or to the supplemental
documentation in this manual. In no event shall the authors, the program
developers, or Truevision, Inc. be liable for incidental or consequential
damages in connection with or arising out of the furnishing, performance
or use of any of these programs or documentation. This disclaimer
includes but is not limited to any loss of service, loss of business or
anticipatory profits, or consequential damages resulting from the use or
operation of the enclosed software.
INTRODUCTION.........................................................................................................................1
DEFINITIONS .............................................................................................................................2
TGA FILE FORMAT SPECIFICATION........................................................................................4
TGA FILE HEADER....................................................................................................................6
ID Length - Field 1 (1 byte): ............................................................................................6
Color Map Type - Field 2 (1 byte): ..................................................................................6
Image Type - Field 3 (1 byte): .........................................................................................6
Color Map Specification - Field 4 (5 bytes):...................................................................7
Image Specification - Field 5 (10 bytes):........................................................................8
IMAGE/COLOR MAP DATA ...........................................................10
Image ID - Field 6 (variable):......................................................................................... 10
Color Map Data - Field 7 (variable):.............................................................................. 10
Image Data - Field 8 (variable):.....................................................................................10
DEVELOPER AREA........................................................................11
Developer Data - Field 9 (variable):..............................................................................11
EXTENSION AREA.........................................................................13
Extension Size - Field 10 (2 Bytes):..............................................................................13
Author Name - Field 11 (41 Bytes): .............................................................................. 13
Author Comments - Field 12 (324 Bytes):....................................................................13
Date/Time Stamp - Field 13 (12 Bytes):........................................................................14
Job Name/ID - Field 14 (41 Bytes):............................................................................... 14
Job Time - Field 15 (6 Bytes):....................................................................................... 14
Software ID - Field 16 (41 Bytes):................................................................................. 15
Software Version - Field 17 (3 Bytes):.......................................................................... 15
Key Color - Field 18 (4 Bytes):......................................................................................15
Pixel Aspect Ratio - Field 19 (4 Bytes):........................................................................ 16
Color Correction Offset - Field 21 (4 Bytes): ............................................................... 16
Postage Stamp Offset - Field 22 (4 Bytes):.................................................................. 16
Scan Line Offset - Field 23 (4 Bytes):........................................................................... 17
Attributes Type - Field 24 (1 Byte): .............................................................................. 17
Scan Line Table - Field 25 (Variable): ..........................................................................18
Postage Stamp Image - Field 26 (Variable):................................................................ 18
Color Correction Table - Field 27 (2K Bytes):.............................................................. 18
TGA FILE FOOTER.........................................................................19
Byte 0-3 - Extension Area Offset - Field 28.................................................................. 19
Byte 4-7 - Developer Directory Offset - Field 29 .......................................................... 19
Byte 8-23 - Signature - Field 30 .................................................................................... 20
Byte 24 - Reserved Character - Field 31....................................................................... 20
Byte 25 - Binary Zero String Terminator - Field 32...................................................... 20
IMAGE TYPES ...............................................................................21
DATA TYPE 1 - COLOR-MAPPED IMAGES..................................................................21
DATA TYPE 2 - TRUE-COLOR IMAGES ....................................................................... 21
DATA TYPE 3 - BLACK AND WHITE (UNMAPPED) IMAGES....................................... 22
DATATYPE9-RUN-LENGTHENCODED(RLE),COLOR-MAPPED
IMAGES.........................................................................................................................22
DATA TYPE 10 - RUN-LENGTH ENCODED (RLE), TRUE-COLOR
IMAGES.........................................................................................................................23
DATA TYPE 11 - RUN-LENGTH ENCODED (RLE), ...................................................... 23
BLACK AND WHITE IMAGES .......................................................................................23
RUN-LENGTH ENCODING OF IMAGES........................................24
Run-Length Packet:...................................................................................................... 25
Raw Packet (i.e., Non-Run-Length Encoded): ............................................................26
1
INTRODUCTION
The success of the TGAª File Format for storing color images can be attributed to its ease of use, the small
amount of program memory needed to parse the file, and the fact that it was the first true-color file format
widely available. Truevision¨ defined the TGA file format in 1984 for use with its first videographics
products. Since then, it has been estimated that today over 80 percent of the color images stored on hard
drives employ some variation of the TGA file format. Many government offices, corporations, service
bureaus, production shops and nearly all Truevision developers have standardized on the TGA format as a
means of allowing cross-product and cross-application compatibility. Truevision recommends that this
format be used by all software developed for Truevision products since it allows customers flexibility in
combining many applications together to provide a total solution to meet their needs.
The original Truevision TGA File Format has been widely accepted by the graphics industry. However,
newer technology and techniques have created the need for additional image information to be recorded in
the file. In 1989, Truevision introduced extensions to the TGA File Format to satisfy requests made by the
graphics industry and to ensure that the standard will meet future needs of the color imaging marketplace.
The extensions are optional and will have no impact on existing packages (assuming the packages followed
the original TGA File Format guidelines). In particular, the new TGA File Format addresses the following
needs:
* The inclusion of a scaled-down “postage stamp” copy of the image
* Date and Time of image file creation
* Author Name
* Author Comments
* Job Name
* Job Accumulated Time
* Gamma Value
* Correct Color LUT
* Pixel Aspect Ratio
* Scan Line Offset Table
*KeyColor
* Software Package Name and Version Number
* Developer Definable Areas
* Attribute (Alpha) channel Type
* The ability for simple expansion
2
DEFINITIONS
Throughout this document, we will be using the terms Pseudo-Color, True-Color and Direct-Color.
These terms are defined as follows:
Pseudo-Color
- Each pixel value is used as a single index into a programmable color map which contains
the actual red, green and blue intensities to be displayed. The Truevision products that use this type
of image are: VDA, VDA/D, TARGA¨ M8, ATVista¨, NuVista¨ and HRª videographics boards.
True-Color
- Each pixel value is sub-divided into red, green and blue fields that directly determine the
intensities of each primary color. The Truevision products that use this type of image are: ICB,
TARGA 16, TARGA 24, TARGA 32, ATVista and NuVista videographics boards.
Direct-Color
- Each pixel value is sub-divided into red, green and blue fields which are used as separate
indices to access independent, programmable look-up tables. The outputs of the individual color
maps directly determine the intensities of each primary color. A Direct-Color system is similar to
Pseudo-Color except that the values in the color maps can be altered individually for the red, green
and blue channels; whereas, the red, green and blue values in a Pseudo-Color system are loaded into
one map which is accessed by a single index. Truevision products that use this type of image are:
ATVista and NuVista videographics boards.
The TrueVista¨ (ATVista and NuVista) videographics cards can be programmed to accept images which
are Pseudo-Color, True-Color and Direct-Color. When they are functioning in any of the Linked Modes,
they are said to be acting as Pseudo-Color devices. When they are configured for any of the Independent
Modes, they are said to be acting as Direct-Color devices. When bypassing the look-up tables altogether,
they are said to be acting as True-Color devices.
The VDA, VDA/D, TARGA M8 and HR can only be used as Pseudo-Color devices.
The ICB, TARGA 16, 24 and 32 can only be used as True-Color devices.
Long
= 32 bit value
Short
= 16 bit value
Byte
= 8 bit value
ASCII
= sequence of bytes conforming to the ASCII definition (Truevision recommends that the ASCII
fields contain only printable ASCII characters, with exception of the null terminator, and that all
formatting be performed by the application)
Bit Numbering (for diagrams in this document)
剩余28页未读,继续阅读
资源评论
- yu_chaoo2012-11-11很详细,很清楚,感谢
- raaland2012-10-29好用,表格简单明了
- perfect28082015-06-23有点复杂,不好懂
- littleliang2012-03-16是英文的TGA的标准,详细的介绍了其格式,对游戏、视频、图片开发的人员很有用处。谢谢分享。
- chenzhen86100862012-12-05好东西,做字幕就靠它了。
ChrisAK
- 粉丝: 617
- 资源: 17
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功