Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
itdan3344
stb
提交
853fda61
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 搜索 >>
提交
853fda61
编写于
1月 16, 2016
作者:
S
Sean Barrett
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'alt_realloc' of
https://github.com/romigrou/stb
into working
上级
c8e50127
7e741ffc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
16 deletion
+22
-16
docs/other_libs.md
docs/other_libs.md
+10
-5
stb_image.h
stb_image.h
+8
-7
stb_image_write.h
stb_image_write.h
+4
-4
未找到文件。
docs/other_libs.md
浏览文件 @
853fda61
...
...
@@ -15,7 +15,7 @@ free to tell me about their quality.) _Newest additions are in italics._
-
**network**
[
zed_net
](
https://github.com/ZedZull/zed_net
)
: cross-platform socket wrapper (public domain)
-
**strings**
;
**files & filenames**
[
DG_misc.h
](
https://github.com/DanielGibson/Snippets/
)
: Daniel Gibson's stb.h-esque cross-platform helpers: path/file, strings (public domain)
-
**strings**
[
utf8
](
https://github.com/sheredom/utf8.h
)
: utf8 string library (public domain)
-
_
**strings**
[
strpool.h
](
https://github.com/mattiasgustavsson/libs
)
: string interning (public domain/MIT)_
-
**strings**
[
strpool.h
](
https://github.com/mattiasgustavsson/libs
)
: string interning (public domain/MIT)
-
**misc**
[
MakeID.h
](
http://www.humus.name/3D/MakeID.h
)
: allocate/deallocate small integer IDs efficiently (public domain)
-
**misc**
[
gb_string.h
](
https://github.com/gingerBill/gb
)
: dynamic strings for C (public domain)
-
**misc**
[
loguru
](
https://github.com/emilk/loguru
)
: flexible logging for C++ (public domain)
...
...
@@ -28,21 +28,26 @@ Not public domain:
-
**images**
[
nanoSVG
](
https://github.com/memononen/nanosvg
)
: 1-file SVG parser; 1-file SVG rasterizer (zlib license)
-
**3D**
[
tinyobjloader
](
https://github.com/syoyo/tinyobjloader
)
: wavefront OBJ file loader (BSD license)
-
**2D**
[
blendish
](
https://bitbucket.org/duangle/oui-blendish/src
)
: blender-style widget rendering (MIT license)
-
_
**math**
[
mm_vec.h
](
https://github.com/vurtun/mmx
)
: vector math (BSD license)_
-
**math**
[
mm_vec.h
](
https://github.com/vurtun/mmx
)
: vector math (BSD license)
-
**geometry**
[
sdf.h
](
https://github.com/memononen/SDF
)
: compute signed-distance field from antialiased image (MIT license)
-
**geometry**
[
nanoflann
](
https://github.com/jlblancoc/nanoflann
)
: build KD trees for point clouds (BSD license)
-
**geometry**
[
jc_voronoi
](
https://github.com/JCash/voronoi
)
: find voronoi regions on float/double data (MIT license)
-
**geometry**
[
par_msquares
](
https://github.com/prideout/par
)
: convert (binarized) image to triangles (MIT license)
-
**geometry**
[
tk_objfile
](
https://github.com/joeld42/tk_objfile
)
: OBJ file loader (MIT license)
-
_
**geometry**
[
par_shapes
](
http://github.prideout.net/shapes/
)
: generate various 3d geometric shapes (MIT license)_
-
**network**
[
mm_web.h
](
https://github.com/vurtun/mmx
)
: lightweight webserver, fork of webby (BSD license)
-
**network**
[
par_easycurl.h
](
https://github.com/prideout/par
)
: curl wrapper (MIT license)
-
**audio**
[
aw_ima.h
](
https://github.com/afterwise/aw-ima/blob/master/aw-ima.h
)
: IMA-ADPCM audio decoder (MIT license)
-
**multithreading**
[
mm_sched.h
](
https://github.com/vurtun/m
ts
)
: cross-platform multithreaded task scheduler (zlib license)
-
**multithreading**
[
mm_sched.h
](
https://github.com/vurtun/m
mx
)
: cross-platform multithreaded task scheduler (zlib license)
-
**parsing**
[
SLRE
](
https://github.com/cesanta/slre
)
: regular expression matcher (GPL v2)
-
**parsing**
[
PicoJSON
](
https://github.com/kazuho/picojson
)
: JSON parse/serializer for C++ (BSD license)
-
_
**parsing**
[
mm_json.h
](
https://github.com/vurtun/mmx
)
: JSON parser (zlib license)_
-
_
**parsing**
[
mm_lexer.h
](
https://github.com/vurtun/mmx
)
: C-esque language lexer (zlib license)_
-
**parsing**
[
mm_json.h
](
https://github.com/vurtun/mmx
)
: JSON parser (zlib license)
-
**parsing**
[
mm_lexer.h
](
https://github.com/vurtun/mmx
)
: C-esque language lexer (zlib license)
-
**tests**
[
utest
](
https://github.com/evolutional/utest
)
: unit testing (MIT license)
-
**tests**
[
catch
](
https://github.com/philsquared/Catch
)
: unit testing (Boost license)
-
**tests**
[
SPUT
](
http://www.lingua-systems.com/unit-testing/
)
: unit testing (BSD license)
-
**misc**
[
lualite
](
https://github.com/janezz55/lualite/
)
: generate lua bindings in C++ (MIT license)
-
**misc**
[
tinyformat
](
https://github.com/c42f/tinyformat
)
: C++ typesafe printf (Boost license)
There are some that have a source file and require a separate header file (which they may
not even supply). That's twice as many files, and we at nothings/stb cannot condone
...
...
stb_image.h
浏览文件 @
853fda61
...
...
@@ -630,9 +630,9 @@ typedef unsigned char validate_uint32[sizeof(stbi__uint32)==4 ? 1 : -1];
#endif
#ifndef STBI_MALLOC
#define STBI_MALLOC(sz) malloc(sz)
#define STBI_REALLOC(p,
sz) realloc(p,
sz)
#define STBI_FREE(p) free(p)
#define STBI_MALLOC(sz)
malloc(sz)
#define STBI_REALLOC(p,
oldsz,newsz) realloc(p,new
sz)
#define STBI_FREE(p)
free(p)
#endif
// x86/x64 detection
...
...
@@ -3608,14 +3608,14 @@ stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z)
static
int
stbi__zexpand
(
stbi__zbuf
*
z
,
char
*
zout
,
int
n
)
// need to make room for n bytes
{
char
*
q
;
int
cur
,
limit
;
int
cur
,
limit
,
old_limit
;
z
->
zout
=
zout
;
if
(
!
z
->
z_expandable
)
return
stbi__err
(
"output buffer limit"
,
"Corrupt PNG"
);
cur
=
(
int
)
(
z
->
zout
-
z
->
zout_start
);
limit
=
(
int
)
(
z
->
zout_end
-
z
->
zout_start
);
limit
=
old_limit
=
(
int
)
(
z
->
zout_end
-
z
->
zout_start
);
while
(
cur
+
n
>
limit
)
limit
*=
2
;
q
=
(
char
*
)
STBI_REALLOC
(
z
->
zout_start
,
limit
);
q
=
(
char
*
)
STBI_REALLOC
(
z
->
zout_start
,
old_limit
,
limit
);
if
(
q
==
NULL
)
return
stbi__err
(
"outofmem"
,
"Out of memory"
);
z
->
zout_start
=
q
;
z
->
zout
=
q
+
cur
;
...
...
@@ -4400,11 +4400,12 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
if
(
scan
==
STBI__SCAN_header
)
{
s
->
img_n
=
pal_img_n
;
return
1
;
}
if
((
int
)(
ioff
+
c
.
length
)
<
(
int
)
ioff
)
return
0
;
if
(
ioff
+
c
.
length
>
idata_limit
)
{
stbi__uint32
idata_limit_old
=
idata_limit
;
stbi_uc
*
p
;
if
(
idata_limit
==
0
)
idata_limit
=
c
.
length
>
4096
?
c
.
length
:
4096
;
while
(
ioff
+
c
.
length
>
idata_limit
)
idata_limit
*=
2
;
p
=
(
stbi_uc
*
)
STBI_REALLOC
(
z
->
idata
,
idata_limit
);
if
(
p
==
NULL
)
return
stbi__err
(
"outofmem"
,
"Out of memory"
);
p
=
(
stbi_uc
*
)
STBI_REALLOC
(
z
->
idata
,
idata_limit
_old
,
idata_limit
);
if
(
p
==
NULL
)
return
stbi__err
(
"outofmem"
,
"Out of memory"
);
z
->
idata
=
p
;
}
if
(
!
stbi__getn
(
s
,
z
->
idata
+
ioff
,
c
.
length
))
return
stbi__err
(
"outofdata"
,
"Corrupt PNG"
);
...
...
stb_image_write.h
浏览文件 @
853fda61
...
...
@@ -166,9 +166,9 @@ STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w,
#endif
#ifndef STBIW_MALLOC
#define STBIW_MALLOC(sz) malloc(sz)
#define STBIW_REALLOC(p,
sz) realloc(p,
sz)
#define STBIW_FREE(p) free(p)
#define STBIW_MALLOC(sz)
malloc(sz)
#define STBIW_REALLOC(p,
oldsz,newsz) realloc(p,new
sz)
#define STBIW_FREE(p)
free(p)
#endif
#ifndef STBIW_MEMMOVE
#define STBIW_MEMMOVE(a,b,sz) memmove(a,b,sz)
...
...
@@ -647,7 +647,7 @@ int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *da
static
void
*
stbiw__sbgrowf
(
void
**
arr
,
int
increment
,
int
itemsize
)
{
int
m
=
*
arr
?
2
*
stbiw__sbm
(
*
arr
)
+
increment
:
increment
+
1
;
void
*
p
=
STBIW_REALLOC
(
*
arr
?
stbiw__sbraw
(
*
arr
)
:
0
,
itemsize
*
m
+
sizeof
(
int
)
*
2
);
void
*
p
=
STBIW_REALLOC
(
*
arr
?
stbiw__sbraw
(
*
arr
)
:
0
,
*
arr
?
(
stbiw__sbm
(
*
arr
)
*
itemsize
+
sizeof
(
int
)
*
2
)
:
0
,
itemsize
*
m
+
sizeof
(
int
)
*
2
);
STBIW_ASSERT
(
p
);
if
(
p
)
{
if
(
!*
arr
)
((
int
*
)
p
)[
1
]
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录