Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
itdan3344
stb
提交
a5f1cb56
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,发现更多精彩内容 >>
提交
a5f1cb56
编写于
9月 05, 2014
作者:
T
Tero Hänninen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix comments
上级
067a1d1b
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
6 addition
and
6 deletion
+6
-6
stb_image.h
stb_image.h
+6
-6
未找到文件。
stb_image.h
浏览文件 @
a5f1cb56
...
...
@@ -766,7 +766,7 @@ static void stbi__refill_buffer(stbi__context *s)
int
n
=
(
s
->
io
.
read
)(
s
->
io_user_data
,(
char
*
)
s
->
buffer_start
,
s
->
buflen
);
if
(
n
==
0
)
{
// at end of file, treat same as if from memory, but need to handle case
// where s->img_buffer isn't pointing to safe memory,
stbi__err
.g. 0-byte file
// where s->img_buffer isn't pointing to safe memory,
e
.g. 0-byte file
s
->
read_from_callbacks
=
0
;
s
->
img_buffer
=
s
->
buffer_start
;
s
->
img_buffer_end
=
s
->
buffer_start
+
1
;
...
...
@@ -864,7 +864,7 @@ static stbi__uint32 stbi__get32le(stbi__context *s)
//////////////////////////////////////////////////////////////////////////////
//
// generic converter from built-in img_n to req_comp
// individual types do this automatically as much as possible (
stbi__err
.g. jpeg
// individual types do this automatically as much as possible (
e
.g. jpeg
// does all cases internally since it needs to colorspace convert anyway,
// and it never has alpha, so very few cases ). png can automatically
// interleave an alpha=255 channel, but falls back to this for other cases
...
...
@@ -1611,12 +1611,12 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan)
z
->
img_mcu_y
=
(
s
->
img_y
+
z
->
img_mcu_h
-
1
)
/
z
->
img_mcu_h
;
for
(
i
=
0
;
i
<
s
->
img_n
;
++
i
)
{
// number of effective pixels (
stbi__err
.g. for non-interleaved MCU)
// number of effective pixels (
e
.g. for non-interleaved MCU)
z
->
img_comp
[
i
].
x
=
(
s
->
img_x
*
z
->
img_comp
[
i
].
h
+
h_max
-
1
)
/
h_max
;
z
->
img_comp
[
i
].
y
=
(
s
->
img_y
*
z
->
img_comp
[
i
].
v
+
v_max
-
1
)
/
v_max
;
// to simplify generation, we'll allocate enough memory to decode
// the bogus oversized data from using interleaved MCUs and their
// big blocks (
stbi__err
.g. a 16x16 iMCU on an image of width 33); we won't
// big blocks (
e
.g. a 16x16 iMCU on an image of width 33); we won't
// discard the extra data until colorspace conversion
z
->
img_comp
[
i
].
w2
=
z
->
img_mcu_x
*
z
->
img_comp
[
i
].
h
*
8
;
z
->
img_comp
[
i
].
h2
=
z
->
img_mcu_y
*
z
->
img_comp
[
i
].
v
*
8
;
...
...
@@ -1636,7 +1636,7 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan)
return
1
;
}
// use comparisons since in some cases we handle more than one case (
stbi__err
.g. stbi__SOF)
// use comparisons since in some cases we handle more than one case (
e
.g. stbi__SOF)
#define stbi__DNL(x) ((x) == 0xdc)
#define stbi__SOI(x) ((x) == 0xd8)
#define stbi__EOI(x) ((x) == 0xd9)
...
...
@@ -2025,7 +2025,7 @@ stbi_inline static int stbi__bit_reverse(int v, int bits)
{
STBI_ASSERT
(
bits
<=
16
);
// to bit reverse n bits, reverse 16 and shift
//
stbi__err
.g. 11 bits, bit reverse and shift away 5
//
e
.g. 11 bits, bit reverse and shift away 5
return
stbi__bitreverse16
(
v
)
>>
(
16
-
bits
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录