Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
itdan3344
stb
提交
6403f319
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,体验更适合开发者的 AI 搜索 >>
提交
6403f319
编写于
12月 21, 2014
作者:
S
Sean Barrett
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tweak documentation
stbi__ prefix on two functions that were missing it
上级
53008c09
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
16 deletion
+23
-16
stb_image.h
stb_image.h
+23
-16
未找到文件。
stb_image.h
浏览文件 @
6403f319
...
...
@@ -33,17 +33,18 @@
Full documentation under "DOCUMENTATION" below.
Revision
1.49
release notes:
Revision
2.00
release notes:
- The old STBI_SIMD system which allowed installing a user-defined
IDCT etc. has been removed. If you need this, don't upgrade. My
assumption is that almost nobody was doing this, and those who
were will find the next bullet item more satisfactory anyway.
- Progressive JPEG is now supported.
- PPM and PGM binary formats are now supported.
- x86 platforms now make use of SSE2 SIMD instructions if available.
This release is 2x faster on our test JPEGs, mostly due to SIMD.
This work was done by Fabian "ryg" Giesen.
- ARM platforms now make use of NEON SIMD instructions if available.
- Compilation of SIMD code can be suppressed with
#define STBI_NO_SIMD
It should not be necessary to disable it unless you have issues
...
...
@@ -53,6 +54,11 @@
bugs so I can refine the built-in compile-time checking to be
smarter.
- The old STBI_SIMD system which allowed installing a user-defined
IDCT etc. has been removed. If you need this, don't upgrade. My
assumption is that almost nobody was doing this, and those who
were will find the next bullet item more satisfactory anyway.
- RGB values computed for JPEG images are slightly different from
previous versions of stb_image. (This is due to using less
integer precision in SIMD.) The C code has been adjusted so
...
...
@@ -73,8 +79,6 @@
removed in future versions of the library. It is only intended for
back-compatibility use.
- Added support for PNM images.
- Added STBI_MALLOC, STBI_REALLOC, and STBI_FREE macros for replacing
the memory allocator. Unlike other STBI libraries, these macros don't
support a context parameter, so if you need to pass a context in to
...
...
@@ -83,9 +87,11 @@
Latest revision history:
1.49 (2014-12-25) optimize JPG, incl. x86 SIMD
2.00 (2014-12-25) optimize JPG, incl. x86 & NEON SIMD
progressive JPEG
PGM/PPM support
STBI_MALLOC,STBI_REALLOC,STBI_FREE
GIF bugfix
1.48 (2014-12-14) fix incorrectly-named assert()
1.47 (2014-12-14) 1/2/4-bit PNG support (both grayscale and paletted)
optimize PNG
...
...
@@ -2280,7 +2286,7 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan)
#define stbi__SOF_progressive(x) ((x) == 0xc2)
static
int
decode_jpeg_header
(
stbi__jpeg
*
z
,
int
scan
)
static
int
stbi__
decode_jpeg_header
(
stbi__jpeg
*
z
,
int
scan
)
{
int
m
;
z
->
marker
=
STBI__MARKER_none
;
// initialize cached marker to empty
...
...
@@ -2303,11 +2309,11 @@ static int decode_jpeg_header(stbi__jpeg *z, int scan)
}
// decode image to YCbCr format
static
int
decode_jpeg_image
(
stbi__jpeg
*
j
)
static
int
stbi__
decode_jpeg_image
(
stbi__jpeg
*
j
)
{
int
m
;
j
->
restart_interval
=
0
;
if
(
!
decode_jpeg_header
(
j
,
SCAN_load
))
return
0
;
if
(
!
stbi__
decode_jpeg_header
(
j
,
SCAN_load
))
return
0
;
m
=
stbi__get_marker
(
j
);
while
(
!
stbi__EOI
(
m
))
{
if
(
stbi__SOS
(
m
))
{
...
...
@@ -2714,7 +2720,7 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp
if
(
req_comp
<
0
||
req_comp
>
4
)
return
stbi__errpuc
(
"bad req_comp"
,
"Internal error"
);
// load a jpeg image from whichever source, but leave in YCbCr format
if
(
!
decode_jpeg_image
(
z
))
{
stbi__cleanup_jpeg
(
z
);
return
NULL
;
}
if
(
!
stbi__
decode_jpeg_image
(
z
))
{
stbi__cleanup_jpeg
(
z
);
return
NULL
;
}
// determine actual number of components to generate
n
=
req_comp
?
req_comp
:
z
->
s
->
img_n
;
...
...
@@ -2816,14 +2822,14 @@ static int stbi__jpeg_test(stbi__context *s)
stbi__jpeg
j
;
j
.
s
=
s
;
stbi__setup_jpeg
(
&
j
);
r
=
decode_jpeg_header
(
&
j
,
SCAN_type
);
r
=
stbi__
decode_jpeg_header
(
&
j
,
SCAN_type
);
stbi__rewind
(
s
);
return
r
;
}
static
int
stbi__jpeg_info_raw
(
stbi__jpeg
*
j
,
int
*
x
,
int
*
y
,
int
*
comp
)
{
if
(
!
decode_jpeg_header
(
j
,
SCAN_header
))
{
if
(
!
stbi__
decode_jpeg_header
(
j
,
SCAN_header
))
{
stbi__rewind
(
j
->
s
);
return
0
;
}
...
...
@@ -5668,10 +5674,11 @@ STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int
/*
revision history:
1.49 (2014-12-25) optimize JPG, incl. x86 SIMD (ryg)
2.00 (2014-12-25) optimize JPG, incl. x86 & NEON SIMD (ryg)
progressive JPEG (stb)
PGM/PPM support (Ken Miller)
STBI_MALLOC,STBI_REALLOC,STBI_FREE
stbi_load_into() -- load into pre-defined memory
GIF bugfix -- seemingly never worked
1.48 (2014-12-14) fix incorrectly-named assert()
1.47 (2014-12-14) 1/2/4-bit PNG support, both direct and paletted (Omar Cornut & stb)
optimize PNG (ryg)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录