Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
itdan3344
stb
提交
5753c13f
S
stb
项目概览
itdan3344
/
stb
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
stb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5753c13f
编写于
6月 15, 2014
作者:
S
Sean Barrett
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'load-bmp-v5-header' of
https://github.com/saitoha/stb
into working
Update version number
上级
fa30cdba
381ae029
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
8 deletion
+15
-8
stb_image.h
stb_image.h
+15
-8
未找到文件。
stb_image.h
浏览文件 @
5753c13f
/* stb_image - v1.3
8
- public domain JPEG/PNG reader - http://nothings.org/stb_image.c
/* stb_image - v1.3
9
- public domain JPEG/PNG reader - http://nothings.org/stb_image.c
when you control the images you're loading
no warranty implied; use at your own risk
...
...
@@ -26,13 +26,13 @@
- overridable dequantizing-IDCT, YCbCr-to-RGB conversion (define STBI_SIMD)
Latest revisions:
1.39 (2014-06-15) TGA optimization fix, multiple BMP fixes
1.38 (2014-06-06) suppress MSVC run-time warnings, fix accidental rename of 'skip'
1.37 (2014-06-04) remove duplicate typedef
1.36 (2014-06-03) converted to header file, allow reading incorrect iphoned-images without iphone flag
1.35 (2014-05-27) warnings, bugfixes, TGA optimization, etc
1.34 (unknown ) warning fix
1.33 (2011-07-14) minor fixes suggested by Dave Moore
1.32 (2011-07-13) info support for all filetypes (SpartanJ)
See end of file for full revision history.
...
...
@@ -63,8 +63,9 @@
Arseny Kapoulkine Blazej Dariusz Roszkowski
Thibault Reuille
If your name should be here but Paul Du Bois
isn't let Sean know. Guillaume George
isn't, let Sean know. Guillaume George
Jerry Jansson
Hayaki Saito
*/
#ifndef STBI_INCLUDE_STB_IMAGE_H
...
...
@@ -2908,7 +2909,7 @@ static int stbi__bmp_test_raw(stbi__context *s)
stbi__get16le
(
s
);
// discard reserved
stbi__get32le
(
s
);
// discard data offset
sz
=
stbi__get32le
(
s
);
r
=
(
sz
==
12
||
sz
==
40
||
sz
==
56
||
sz
==
108
);
r
=
(
sz
==
12
||
sz
==
40
||
sz
==
56
||
sz
==
108
||
sz
==
124
);
return
r
;
}
...
...
@@ -2973,7 +2974,7 @@ static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int
stbi__get16le
(
s
);
// discard reserved
offset
=
stbi__get32le
(
s
);
hsz
=
stbi__get32le
(
s
);
if
(
hsz
!=
12
&&
hsz
!=
40
&&
hsz
!=
56
&&
hsz
!=
108
)
return
stbi__errpuc
(
"unknown BMP"
,
"BMP type not supported: unknown"
);
if
(
hsz
!=
12
&&
hsz
!=
40
&&
hsz
!=
56
&&
hsz
!=
108
&&
hsz
!=
124
)
return
stbi__errpuc
(
"unknown BMP"
,
"BMP type not supported: unknown"
);
if
(
hsz
==
12
)
{
s
->
img_x
=
stbi__get16le
(
s
);
s
->
img_y
=
stbi__get16le
(
s
);
...
...
@@ -3032,7 +3033,7 @@ static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int
return
stbi__errpuc
(
"bad BMP"
,
"bad BMP"
);
}
}
else
{
assert
(
hsz
==
108
);
assert
(
hsz
==
108
||
hsz
==
124
);
mr
=
stbi__get32le
(
s
);
mg
=
stbi__get32le
(
s
);
mb
=
stbi__get32le
(
s
);
...
...
@@ -3040,6 +3041,12 @@ static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int
stbi__get32le
(
s
);
// discard color space
for
(
i
=
0
;
i
<
12
;
++
i
)
stbi__get32le
(
s
);
// discard color space parameters
if
(
hsz
==
124
)
{
stbi__get32le
(
s
);
// discard rendering intent
stbi__get32le
(
s
);
// discard offset of profile data
stbi__get32le
(
s
);
// discard size of profile data
stbi__get32le
(
s
);
// discard reserved
}
}
if
(
bpp
<
16
)
psize
=
(
offset
-
14
-
hsz
)
>>
2
;
...
...
@@ -4369,7 +4376,7 @@ static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp)
}
stbi__skip
(
s
,
12
);
hsz
=
stbi__get32le
(
s
);
if
(
hsz
!=
12
&&
hsz
!=
40
&&
hsz
!=
56
&&
hsz
!=
108
)
{
if
(
hsz
!=
12
&&
hsz
!=
40
&&
hsz
!=
56
&&
hsz
!=
108
&&
hsz
!=
124
)
{
stbi__rewind
(
s
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录