当前位置:网站首页>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
边栏推荐
- Typeerror: 'STR' object is not callable error reason
- Is there a "fingerprint" in the structure of AAAI 2022 | Gan? Generating network structure from forged image traceability
- EZDML reverse engineering import database analysis practical operation tutorial
- Gbase 8s UDR memory management_ 01_ mi_ alloc
- When AI encounters life and health, Huawei cloud builds three bridges for them
- Js分页插件支持表格、列表、文本、图像
- How does tiktok break zero?
- Detailed explanation of three methods of selenium setting element waiting
- 从瞳代到“瞳代”再到品牌,暴利的美瞳的变与未变
- What is the method to load the torch pre trained model for the mindspore model finetune?
猜你喜欢

随机梯度下降法、牛顿法、冲量法、AdaGrad、RMSprop以及Adam优化过程和理解
![[wp]ctfshow-web入门-爆破](/img/4b/6d8f4c044578382b9353d4d1c69c8f.png)
[wp]ctfshow-web入门-爆破

Timing analysis and constraints based on xlinx (1) -- what is timing analysis? What are temporal constraints? What is temporal convergence?

Connecting to the database warning establishing SSL connection without server's identity verification is not recommended

软件设计师下午真题:2009-2022

C # add multi line and multi column text watermark in word

9. < tag dynamic programming and subsequence, subarray> lt.718. Longest repeated subarray + lt.1143. Longest common subsequence

How to ensure the quality of customized slip rings

【云原生 | 从零开始学Kubernetes】八、命名空间资源配额以及标签

Mutual conversion of camera internal parameter matrix K and FOV
随机推荐
[wp]ctfshow-web入门-爆破
Binarysearch basic binary search
分享 25 个有用的 JS 单行代码
CarSim simulation quick start (XIV) - CarSim Simulink joint simulation
4、Nacos 配置中心源码解析之 服务端启动
Application of conductive slip ring in mechanical equipment
[artifact] screenshot + mapping tool snipaste
Rainbond插件扩展:基于Mysql-Exporter监控Mysql
LP dual currency pledge liquidity mining DAPP system development logic analysis
Six axis sensor use learning record
Distributed link logging minbox logging usage document
当AI邂逅生命健康,华为云为他们搭建三座桥
CarSim仿真快速入门(十五)—CarSim传感器仿真之ADAS Sensor Objects (1)
How to set tiktok mobile network environment? How can tiktok break the playback volume?
Deeplobv1 and V2
Export and call of onnx file of pytorch model
How does tiktok break zero?
Authorized wireless communication standard
笔记——记录一个CannotFindDataSourceException: dynamic-datasource can not find primary datasource问题解决
CarSim simulation quick start (XV) - ADAS sensor objects of CarSim sensor simulation (1)