当前位置:网站首页>tga文件格式(波形声音文件格式)
tga文件格式(波形声音文件格式)
2022-07-25 20:00:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
Tga常见的格式有非压缩RGB和压缩RGB两种格式,文件的第三个Byte位作为标记:2为非压缩RGB格式,10为压缩RGB格式。这里的类只实现读取非压缩格式的tga文件。
先给出tga文件的文件格式:
名称 | 偏移 | 长度 | 说明 | ||
|---|---|---|---|---|---|
图像信息字段长度 | 0 | 1 | 本字段是 1 字节无符号整型,指出图像信息字段(见本子表的后面)长度,其取值范围是 0 到 255 ,当它为 0 时表示没有图像的信息字段。 | ||
颜色表类型 | 1 | 1 | 0 表示没有颜色表,1 表示颜色表存在。由于本格式是无颜色表的,因此此项通常被忽略。 | ||
图像类型码 | 2 | 1 | 该字段总为 2 ,这也是此类型为格式 2 的原因。 | ||
颜色表规格字段 | 颜色表首址 | 3 | 2 | 颜色表首的入口索引,整型(低位-高位) | 如果颜色表字段为0,则忽略该字段 |
颜色表的长度 | 5 | 2 | 颜色表的表项总数,整型(低位–高位) | ||
颜色表项位数 | 7 | 1 | 位数(bit),16 代表 16 位 TGA ,24 代表 24 位 TGA ,32 代表 32 位 TGA | ||
图像规格字段 | 图像 X 坐标起始位置 | 8 | 2 | 图像左下角 X坐标的整型(低位–高位)值 | |
图像 Y 坐标起始位置 | 10 | 2 | 图像左下角 Y坐标的整型(低位–高位)值 | ||
图像宽度 | 12 | 2 | 以像素为单位,图像宽度的整型(低位–高位) | ||
图像高度 | 14 | 2 | 以像素为单位,图像宽度的整型(低位–高位) | ||
图像每像素存储占用位数 | 16 | 2 | 它的值为16,24 或 32 等等。决定了该图像是 TGA 16,TGA24,TGA 32 等等。 | ||
图像描述符字节 | 17 | 1 | bits 3-0 – 每像素对应的属性位的位数; 对于TGA 16,该值为 0 或 1,对于 TGA 24,该值为 0,对于 TGA 32,该值为 8。 bit 4 – 保留,必须为 0 bit 5 – 屏幕起始位置标志 0 = 原点在左下角 1 = 原点在左上角 对于 truevision 图像必须为 0 bits 7-6 – 交叉数据存储标志 00 = 无交叉 01 = 两路奇/偶交叉 10 = 四路交叉 11 = 保留 | ||
图像信息字段 | 18 | 可变 | 包含一个自由格式的,长度是图像由“图像信息字段”指定。它常常被忽略(即偏移 0 处值为 0 ),注意其最大可以含有 255 个字符。如果需要存储更多信息,可以放在图像数据之后。 | ||
颜色表数据 | 可变 | 可变 | 如果颜色表类型为 0,则该域不存在,否则越过该域直接读取图像颜色表规格中描述了每项的字节数,为 2,3,4 之一。 | ||
图像数据 | 可变 | 可变 | RGB颜色数据,存放顺序为:BBB GGG RRR (AAA) | ||
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/127750.html原文链接:https://javaforall.cn
边栏推荐
- How does tiktok break zero?
- 「分享」DevExpress ASP.NET v22.1最新版本系统环境配置要求
- [good book recommendation] - authoritative guide to Ethernet (2nd Edition)
- Detailed evaluation of current popular redis visual management tools
- 给容器添加3d效果的副标题
- 分享 25 个有用的 JS 单行代码
- PreScan快速入门到精通第十八讲之PreScan轨迹编辑的特殊功能
- Bash does not add single quotes to your string
- Three skills of interface request merging, and the performance is directly exploded!
- Global configuration and page configuration of wechat applet development
猜你喜欢

919. Complete binary tree inserter

wallys//IPQ5018/IPQ6010/PD-60 802.3AT Input Output 10/100/1000M

9.< tag-动态规划和子序列, 子数组>lt.718. 最长重复子数组 + lt.1143. 最长公共子序列

连接数据库警告 Establishing SSL connection without server‘s identity verification is not recommended.

Sentinel simple current limiting and degradation demo problem record

Advantages of network virtualization of various manufacturers

PMP每日一练 | 考试不迷路-7.25

Recommended system topic | Minet: cross domain CTR prediction

Univariate function integration_ Partial integral method

10.< tag-动态规划和子序列, 子数组>lt.53. 最大子数组和 + lt.392. 判断子序列 dbc
随机推荐
UNET and mask RCNN
什么是唯心主义
High number_ Chapter 3 learning experience and summary of multiple integral
919. Complete binary tree inserter
4. Server startup of source code analysis of Nacos configuration center
[good book recommendation] - authoritative guide to Ethernet (2nd Edition)
Siemens PLM Teamcenter download, installation and use tutorial
Software designer afternoon real topic: 2009-2022
How to ensure the quality of customized slip rings
VMware virtual machine download, installation and use tutorial
919. 完全二叉树插入器
CarSim simulation quick start (16) - ADAS sensor objects of CarSim sensor simulation (2)
Can you tell me whether mindspore supports torchvision Model directly uses the pre trained network, such as vgg16
Wxss template style and WXS scripting language for wechat applet development
Js分页插件支持表格、列表、文本、图像
[wp]ctfshow-web入门信息搜集
Google pixel 6A off screen fingerprint scanner has major security vulnerabilities
Prescan quick start to master the special functions of prescan track editing in lecture 18
Pytorch's transforms (numpy data type is converted to tensor, normalized and resized)
Mindspore1.1.1 source code compilation and installation -- errors in the core compilation stage