Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
itdan3344
stb
提交
b96edc01
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,发现更多精彩内容 >>
提交
b96edc01
编写于
6月 03, 2014
作者:
S
Sean Barrett
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'headerify'
Conflicts: tests/stretch_test.dsp
上级
b0d2481b
334cec8d
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
4765 addition
and
107 deletion
+4765
-107
deprecated/stb_image.c
deprecated/stb_image.c
+0
-0
stb_image.h
stb_image.h
+4632
-0
stb_image_write.h
stb_image_write.h
+87
-85
tests/image_test.c
tests/image_test.c
+35
-5
tests/image_test.dsp
tests/image_test.dsp
+0
-4
tests/stb.dsp
tests/stb.dsp
+0
-4
tests/stb_cpp.dsp
tests/stb_cpp.dsp
+0
-4
tests/stretch_test.dsp
tests/stretch_test.dsp
+5
-5
tests/test_c_compilation.c
tests/test_c_compilation.c
+2
-0
tests/test_cpp_compilation.cpp
tests/test_cpp_compilation.cpp
+4
-0
未找到文件。
stb_image.c
→
deprecated/
stb_image.c
浏览文件 @
b96edc01
文件已移动
stb_image.h
0 → 100644
浏览文件 @
b96edc01
此差异已折叠。
点击以展开。
stb_image_write.h
浏览文件 @
b96edc01
/* stb_image_write - v0.9
3
- public domain - http://nothings.org/stb/stb_image_write.h
/* stb_image_write - v0.9
4
- public domain - http://nothings.org/stb/stb_image_write.h
writes out PNG/BMP/TGA images to C stdio - Sean Barrett 2010
no warranty implied; use at your own risk
...
...
@@ -183,43 +183,43 @@ int stbi_write_tga(char const *filename, int x, int y, int comp, const void *dat
"111 221 2222 11"
,
0
,
0
,
2
,
0
,
0
,
0
,
0
,
0
,
x
,
y
,
24
+
8
*
has_alpha
,
8
*
has_alpha
);
}
// stretchy buffer; stbi
__sbpush() == vector<>::push_back() -- stbi
__sbcount() == vector<>::size()
#define stbi__sbraw(a) ((int *) (a) - 2)
#define stbi
__sbm(a) stbi
__sbraw(a)[0]
#define stbi
__sbn(a) stbi
__sbraw(a)[1]
// stretchy buffer; stbi
w__sbpush() == vector<>::push_back() -- stbiw
__sbcount() == vector<>::size()
#define stbi
w
__sbraw(a) ((int *) (a) - 2)
#define stbi
w__sbm(a) stbiw
__sbraw(a)[0]
#define stbi
w__sbn(a) stbiw
__sbraw(a)[1]
#define stbi
__sbneedgrow(a,n) ((a)==0 || stbi__sbn(a)+n >= stbi
__sbm(a))
#define stbi
__sbmaybegrow(a,n) (stbi__sbneedgrow(a,(n)) ? stbi
__sbgrow(a,n) : 0)
#define stbi
__sbgrow(a,n) stbi
__sbgrowf((void **) &(a), (n), sizeof(*(a)))
#define stbi
w__sbneedgrow(a,n) ((a)==0 || stbiw__sbn(a)+n >= stbiw
__sbm(a))
#define stbi
w__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw
__sbgrow(a,n) : 0)
#define stbi
w__sbgrow(a,n) stbiw
__sbgrowf((void **) &(a), (n), sizeof(*(a)))
#define stbi
__sbpush(a, v) (stbi__sbmaybegrow(a,1), (a)[stbi
__sbn(a)++] = (v))
#define stbi
__sbcount(a) ((a) ? stbi
__sbn(a) : 0)
#define stbi
__sbfree(a) ((a) ? free(stbi
__sbraw(a)),0 : 0)
#define stbi
w__sbpush(a, v) (stbiw__sbmaybegrow(a,1), (a)[stbiw
__sbn(a)++] = (v))
#define stbi
w__sbcount(a) ((a) ? stbiw
__sbn(a) : 0)
#define stbi
w__sbfree(a) ((a) ? free(stbiw
__sbraw(a)),0 : 0)
static
void
*
stbi__sbgrowf
(
void
**
arr
,
int
increment
,
int
itemsize
)
static
void
*
stbi
w
__sbgrowf
(
void
**
arr
,
int
increment
,
int
itemsize
)
{
int
m
=
*
arr
?
2
*
stbi__sbm
(
*
arr
)
+
increment
:
increment
+
1
;
void
*
p
=
realloc
(
*
arr
?
stbi__sbraw
(
*
arr
)
:
0
,
itemsize
*
m
+
sizeof
(
int
)
*
2
);
int
m
=
*
arr
?
2
*
stbi
w
__sbm
(
*
arr
)
+
increment
:
increment
+
1
;
void
*
p
=
realloc
(
*
arr
?
stbi
w
__sbraw
(
*
arr
)
:
0
,
itemsize
*
m
+
sizeof
(
int
)
*
2
);
assert
(
p
);
if
(
p
)
{
if
(
!*
arr
)
((
int
*
)
p
)[
1
]
=
0
;
*
arr
=
(
void
*
)
((
int
*
)
p
+
2
);
stbi__sbm
(
*
arr
)
=
m
;
stbi
w
__sbm
(
*
arr
)
=
m
;
}
return
*
arr
;
}
static
unsigned
char
*
stbi__zlib_flushf
(
unsigned
char
*
data
,
unsigned
int
*
bitbuffer
,
int
*
bitcount
)
static
unsigned
char
*
stbi
w
__zlib_flushf
(
unsigned
char
*
data
,
unsigned
int
*
bitbuffer
,
int
*
bitcount
)
{
while
(
*
bitcount
>=
8
)
{
stbi__sbpush
(
data
,
(
unsigned
char
)
*
bitbuffer
);
stbi
w
__sbpush
(
data
,
(
unsigned
char
)
*
bitbuffer
);
*
bitbuffer
>>=
8
;
*
bitcount
-=
8
;
}
return
data
;
}
static
int
stbi__zlib_bitrev
(
int
code
,
int
codebits
)
static
int
stbi
w
__zlib_bitrev
(
int
code
,
int
codebits
)
{
int
res
=
0
;
while
(
codebits
--
)
{
...
...
@@ -229,7 +229,7 @@ static int stbi__zlib_bitrev(int code, int codebits)
return
res
;
}
static
unsigned
int
stbi__zlib_countm
(
unsigned
char
*
a
,
unsigned
char
*
b
,
int
limit
)
static
unsigned
int
stbi
w
__zlib_countm
(
unsigned
char
*
a
,
unsigned
char
*
b
,
int
limit
)
{
int
i
;
for
(
i
=
0
;
i
<
limit
&&
i
<
258
;
++
i
)
...
...
@@ -237,7 +237,7 @@ static unsigned int stbi__zlib_countm(unsigned char *a, unsigned char *b, int li
return
i
;
}
static
unsigned
int
stbi__zhash
(
unsigned
char
*
data
)
static
unsigned
int
stbi
w
__zhash
(
unsigned
char
*
data
)
{
stbiw_uint32
hash
=
data
[
0
]
+
(
data
[
1
]
<<
8
)
+
(
data
[
2
]
<<
16
);
hash
^=
hash
<<
3
;
...
...
@@ -249,19 +249,19 @@ static unsigned int stbi__zhash(unsigned char *data)
return
hash
;
}
#define stbi
__zlib_flush() (out = stbi
__zlib_flushf(out, &bitbuf, &bitcount))
#define stbi__zlib_add(code,codebits) \
(bitbuf |= (code) << bitcount, bitcount += (codebits), stbi__zlib_flush())
#define stbi
__zlib_huffa(b,c) stbi__zlib_add(stbi
__zlib_bitrev(b,c),c)
#define stbi
w__zlib_flush() (out = stbiw
__zlib_flushf(out, &bitbuf, &bitcount))
#define stbi
w
__zlib_add(code,codebits) \
(bitbuf |= (code) << bitcount, bitcount += (codebits), stbi
w
__zlib_flush())
#define stbi
w__zlib_huffa(b,c) stbiw__zlib_add(stbiw
__zlib_bitrev(b,c),c)
// default huffman tables
#define stbi
__zlib_huff1(n) stbi
__zlib_huffa(0x30 + (n), 8)
#define stbi
__zlib_huff2(n) stbi
__zlib_huffa(0x190 + (n)-144, 9)
#define stbi
__zlib_huff3(n) stbi
__zlib_huffa(0 + (n)-256,7)
#define stbi
__zlib_huff4(n) stbi
__zlib_huffa(0xc0 + (n)-280,8)
#define stbi
__zlib_huff(n) ((n) <= 143 ? stbi__zlib_huff1(n) : (n) <= 255 ? stbi__zlib_huff2(n) : (n) <= 279 ? stbi__zlib_huff3(n) : stbi
__zlib_huff4(n))
#define stbi
__zlib_huffb(n) ((n) <= 143 ? stbi__zlib_huff1(n) : stbi
__zlib_huff2(n))
#define stbi
w__zlib_huff1(n) stbiw
__zlib_huffa(0x30 + (n), 8)
#define stbi
w__zlib_huff2(n) stbiw
__zlib_huffa(0x190 + (n)-144, 9)
#define stbi
w__zlib_huff3(n) stbiw
__zlib_huffa(0 + (n)-256,7)
#define stbi
w__zlib_huff4(n) stbiw
__zlib_huffa(0xc0 + (n)-280,8)
#define stbi
w__zlib_huff(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw
__zlib_huff4(n))
#define stbi
w__zlib_huffb(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : stbiw
__zlib_huff2(n))
#define stbi__ZHASH 16384
#define stbi
w
__ZHASH 16384
unsigned
char
*
stbi_zlib_compress
(
unsigned
char
*
data
,
int
data_len
,
int
*
out_len
,
int
quality
)
{
...
...
@@ -272,45 +272,45 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l
unsigned
int
bitbuf
=
0
;
int
i
,
j
,
bitcount
=
0
;
unsigned
char
*
out
=
NULL
;
unsigned
char
**
hash_table
[
stbi__ZHASH
];
// 64KB on the stack!
unsigned
char
**
hash_table
[
stbi
w
__ZHASH
];
// 64KB on the stack!
if
(
quality
<
5
)
quality
=
5
;
stbi__sbpush
(
out
,
0x78
);
// DEFLATE 32K window
stbi__sbpush
(
out
,
0x5e
);
// FLEVEL = 1
stbi__zlib_add
(
1
,
1
);
// BFINAL = 1
stbi__zlib_add
(
1
,
2
);
// BTYPE = 1 -- fixed huffman
stbi
w
__sbpush
(
out
,
0x78
);
// DEFLATE 32K window
stbi
w
__sbpush
(
out
,
0x5e
);
// FLEVEL = 1
stbi
w
__zlib_add
(
1
,
1
);
// BFINAL = 1
stbi
w
__zlib_add
(
1
,
2
);
// BTYPE = 1 -- fixed huffman
for
(
i
=
0
;
i
<
stbi__ZHASH
;
++
i
)
for
(
i
=
0
;
i
<
stbi
w
__ZHASH
;
++
i
)
hash_table
[
i
]
=
NULL
;
i
=
0
;
while
(
i
<
data_len
-
3
)
{
// hash next 3 bytes of data to be compressed
int
h
=
stbi
__zhash
(
data
+
i
)
&
(
stbi
__ZHASH
-
1
),
best
=
3
;
int
h
=
stbi
w__zhash
(
data
+
i
)
&
(
stbiw
__ZHASH
-
1
),
best
=
3
;
unsigned
char
*
bestloc
=
0
;
unsigned
char
**
hlist
=
hash_table
[
h
];
int
n
=
stbi__sbcount
(
hlist
);
int
n
=
stbi
w
__sbcount
(
hlist
);
for
(
j
=
0
;
j
<
n
;
++
j
)
{
if
(
hlist
[
j
]
-
data
>
i
-
32768
)
{
// if entry lies within window
int
d
=
stbi__zlib_countm
(
hlist
[
j
],
data
+
i
,
data_len
-
i
);
int
d
=
stbi
w
__zlib_countm
(
hlist
[
j
],
data
+
i
,
data_len
-
i
);
if
(
d
>=
best
)
best
=
d
,
bestloc
=
hlist
[
j
];
}
}
// when hash table entry is too long, delete half the entries
if
(
hash_table
[
h
]
&&
stbi__sbn
(
hash_table
[
h
])
==
2
*
quality
)
{
if
(
hash_table
[
h
]
&&
stbi
w
__sbn
(
hash_table
[
h
])
==
2
*
quality
)
{
memcpy
(
hash_table
[
h
],
hash_table
[
h
]
+
quality
,
sizeof
(
hash_table
[
h
][
0
])
*
quality
);
stbi__sbn
(
hash_table
[
h
])
=
quality
;
stbi
w
__sbn
(
hash_table
[
h
])
=
quality
;
}
stbi__sbpush
(
hash_table
[
h
],
data
+
i
);
stbi
w
__sbpush
(
hash_table
[
h
],
data
+
i
);
if
(
bestloc
)
{
// "lazy matching" - check match at *next* byte, and if it's better, do cur byte as literal
h
=
stbi
__zhash
(
data
+
i
+
1
)
&
(
stbi
__ZHASH
-
1
);
h
=
stbi
w__zhash
(
data
+
i
+
1
)
&
(
stbiw
__ZHASH
-
1
);
hlist
=
hash_table
[
h
];
n
=
stbi__sbcount
(
hlist
);
n
=
stbi
w
__sbcount
(
hlist
);
for
(
j
=
0
;
j
<
n
;
++
j
)
{
if
(
hlist
[
j
]
-
data
>
i
-
32767
)
{
int
e
=
stbi__zlib_countm
(
hlist
[
j
],
data
+
i
+
1
,
data_len
-
i
-
1
);
int
e
=
stbi
w
__zlib_countm
(
hlist
[
j
],
data
+
i
+
1
,
data_len
-
i
-
1
);
if
(
e
>
best
)
{
// if next match is better, bail on current match
bestloc
=
NULL
;
break
;
...
...
@@ -323,27 +323,27 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l
int
d
=
(
int
)
(
data
+
i
-
bestloc
);
// distance back
assert
(
d
<=
32767
&&
best
<=
258
);
for
(
j
=
0
;
best
>
lengthc
[
j
+
1
]
-
1
;
++
j
);
stbi__zlib_huff
(
j
+
257
);
if
(
lengtheb
[
j
])
stbi__zlib_add
(
best
-
lengthc
[
j
],
lengtheb
[
j
]);
stbi
w
__zlib_huff
(
j
+
257
);
if
(
lengtheb
[
j
])
stbi
w
__zlib_add
(
best
-
lengthc
[
j
],
lengtheb
[
j
]);
for
(
j
=
0
;
d
>
distc
[
j
+
1
]
-
1
;
++
j
);
stbi
__zlib_add
(
stbi
__zlib_bitrev
(
j
,
5
),
5
);
if
(
disteb
[
j
])
stbi__zlib_add
(
d
-
distc
[
j
],
disteb
[
j
]);
stbi
w__zlib_add
(
stbiw
__zlib_bitrev
(
j
,
5
),
5
);
if
(
disteb
[
j
])
stbi
w
__zlib_add
(
d
-
distc
[
j
],
disteb
[
j
]);
i
+=
best
;
}
else
{
stbi__zlib_huffb
(
data
[
i
]);
stbi
w
__zlib_huffb
(
data
[
i
]);
++
i
;
}
}
// write out final bytes
for
(;
i
<
data_len
;
++
i
)
stbi__zlib_huffb
(
data
[
i
]);
stbi__zlib_huff
(
256
);
// end of block
stbi
w
__zlib_huffb
(
data
[
i
]);
stbi
w
__zlib_huff
(
256
);
// end of block
// pad with 0 bits to byte boundary
while
(
bitcount
)
stbi__zlib_add
(
0
,
1
);
stbi
w
__zlib_add
(
0
,
1
);
for
(
i
=
0
;
i
<
stbi__ZHASH
;
++
i
)
(
void
)
stbi__sbfree
(
hash_table
[
i
]);
for
(
i
=
0
;
i
<
stbi
w
__ZHASH
;
++
i
)
(
void
)
stbi
w
__sbfree
(
hash_table
[
i
]);
{
// compute adler32 on input
...
...
@@ -355,18 +355,18 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l
j
+=
blocklen
;
blocklen
=
5552
;
}
stbi__sbpush
(
out
,
(
unsigned
char
)
(
s2
>>
8
));
stbi__sbpush
(
out
,
(
unsigned
char
)
s2
);
stbi__sbpush
(
out
,
(
unsigned
char
)
(
s1
>>
8
));
stbi__sbpush
(
out
,
(
unsigned
char
)
s1
);
stbi
w
__sbpush
(
out
,
(
unsigned
char
)
(
s2
>>
8
));
stbi
w
__sbpush
(
out
,
(
unsigned
char
)
s2
);
stbi
w
__sbpush
(
out
,
(
unsigned
char
)
(
s1
>>
8
));
stbi
w
__sbpush
(
out
,
(
unsigned
char
)
s1
);
}
*
out_len
=
stbi__sbn
(
out
);
*
out_len
=
stbi
w
__sbn
(
out
);
// make returned pointer freeable
memmove
(
stbi__sbraw
(
out
),
out
,
*
out_len
);
return
(
unsigned
char
*
)
stbi__sbraw
(
out
);
memmove
(
stbi
w
__sbraw
(
out
),
out
,
*
out_len
);
return
(
unsigned
char
*
)
stbi
w
__sbraw
(
out
);
}
unsigned
int
stbi__crc32
(
unsigned
char
*
buffer
,
int
len
)
unsigned
int
stbi
w
__crc32
(
unsigned
char
*
buffer
,
int
len
)
{
static
unsigned
int
crc_table
[
256
];
unsigned
int
crc
=
~
0u
;
...
...
@@ -380,17 +380,17 @@ unsigned int stbi__crc32(unsigned char *buffer, int len)
return
~
crc
;
}
#define stbi__wpng4(o,a,b,c,d) ((o)[0]=(unsigned char)(a),(o)[1]=(unsigned char)(b),(o)[2]=(unsigned char)(c),(o)[3]=(unsigned char)(d),(o)+=4)
#define stbi
__wp32(data,v) stbi
__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v));
#define stbi
__wptag(data,s) stbi
__wpng4(data, s[0],s[1],s[2],s[3])
#define stbi
w
__wpng4(o,a,b,c,d) ((o)[0]=(unsigned char)(a),(o)[1]=(unsigned char)(b),(o)[2]=(unsigned char)(c),(o)[3]=(unsigned char)(d),(o)+=4)
#define stbi
w__wp32(data,v) stbiw
__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v));
#define stbi
w__wptag(data,s) stbiw
__wpng4(data, s[0],s[1],s[2],s[3])
static
void
stbi__wpcrc
(
unsigned
char
**
data
,
int
len
)
static
void
stbi
w
__wpcrc
(
unsigned
char
**
data
,
int
len
)
{
unsigned
int
crc
=
stbi__crc32
(
*
data
-
len
-
4
,
len
+
4
);
stbi__wp32
(
*
data
,
crc
);
unsigned
int
crc
=
stbi
w
__crc32
(
*
data
-
len
-
4
,
len
+
4
);
stbi
w
__wp32
(
*
data
,
crc
);
}
static
unsigned
char
stbi__paeth
(
int
a
,
int
b
,
int
c
)
static
unsigned
char
stbi
w
__paeth
(
int
a
,
int
b
,
int
c
)
{
int
p
=
a
+
b
-
c
,
pa
=
abs
(
p
-
a
),
pb
=
abs
(
p
-
b
),
pc
=
abs
(
p
-
c
);
if
(
pa
<=
pb
&&
pa
<=
pc
)
return
(
unsigned
char
)
a
;
...
...
@@ -426,7 +426,7 @@ unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, in
case
1
:
line_buffer
[
i
]
=
z
[
i
];
break
;
case
2
:
line_buffer
[
i
]
=
z
[
i
]
-
z
[
i
-
stride_bytes
];
break
;
case
3
:
line_buffer
[
i
]
=
z
[
i
]
-
(
z
[
i
-
stride_bytes
]
>>
1
);
break
;
case
4
:
line_buffer
[
i
]
=
(
signed
char
)
(
z
[
i
]
-
stbi__paeth
(
0
,
z
[
i
-
stride_bytes
],
0
));
break
;
case
4
:
line_buffer
[
i
]
=
(
signed
char
)
(
z
[
i
]
-
stbi
w
__paeth
(
0
,
z
[
i
-
stride_bytes
],
0
));
break
;
case
5
:
line_buffer
[
i
]
=
z
[
i
];
break
;
case
6
:
line_buffer
[
i
]
=
z
[
i
];
break
;
}
...
...
@@ -436,9 +436,9 @@ unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, in
case
1
:
line_buffer
[
i
]
=
z
[
i
]
-
z
[
i
-
n
];
break
;
case
2
:
line_buffer
[
i
]
=
z
[
i
]
-
z
[
i
-
stride_bytes
];
break
;
case
3
:
line_buffer
[
i
]
=
z
[
i
]
-
((
z
[
i
-
n
]
+
z
[
i
-
stride_bytes
])
>>
1
);
break
;
case
4
:
line_buffer
[
i
]
=
z
[
i
]
-
stbi__paeth
(
z
[
i
-
n
],
z
[
i
-
stride_bytes
],
z
[
i
-
stride_bytes
-
n
]);
break
;
case
4
:
line_buffer
[
i
]
=
z
[
i
]
-
stbi
w
__paeth
(
z
[
i
-
n
],
z
[
i
-
stride_bytes
],
z
[
i
-
stride_bytes
-
n
]);
break
;
case
5
:
line_buffer
[
i
]
=
z
[
i
]
-
(
z
[
i
-
n
]
>>
1
);
break
;
case
6
:
line_buffer
[
i
]
=
z
[
i
]
-
stbi__paeth
(
z
[
i
-
n
],
0
,
0
);
break
;
case
6
:
line_buffer
[
i
]
=
z
[
i
]
-
stbi
w
__paeth
(
z
[
i
-
n
],
0
,
0
);
break
;
}
}
if
(
p
)
break
;
...
...
@@ -463,25 +463,25 @@ unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, in
o
=
out
;
memcpy
(
o
,
sig
,
8
);
o
+=
8
;
stbi__wp32
(
o
,
13
);
// header length
stbi__wptag
(
o
,
"IHDR"
);
stbi__wp32
(
o
,
x
);
stbi__wp32
(
o
,
y
);
stbi
w
__wp32
(
o
,
13
);
// header length
stbi
w
__wptag
(
o
,
"IHDR"
);
stbi
w
__wp32
(
o
,
x
);
stbi
w
__wp32
(
o
,
y
);
*
o
++
=
8
;
*
o
++
=
(
unsigned
char
)
ctype
[
n
];
*
o
++
=
0
;
*
o
++
=
0
;
*
o
++
=
0
;
stbi__wpcrc
(
&
o
,
13
);
stbi
w
__wpcrc
(
&
o
,
13
);
stbi__wp32
(
o
,
zlen
);
stbi__wptag
(
o
,
"IDAT"
);
stbi
w
__wp32
(
o
,
zlen
);
stbi
w
__wptag
(
o
,
"IDAT"
);
memcpy
(
o
,
zlib
,
zlen
);
o
+=
zlen
;
free
(
zlib
);
stbi__wpcrc
(
&
o
,
zlen
);
stbi
w
__wpcrc
(
&
o
,
zlen
);
stbi__wp32
(
o
,
0
);
stbi__wptag
(
o
,
"IEND"
);
stbi__wpcrc
(
&
o
,
0
);
stbi
w
__wp32
(
o
,
0
);
stbi
w
__wptag
(
o
,
"IEND"
);
stbi
w
__wpcrc
(
&
o
,
0
);
assert
(
o
==
out
+
*
out_len
);
...
...
@@ -505,6 +505,8 @@ int stbi_write_png(char const *filename, int x, int y, int comp, const void *dat
/* Revision history
0.94 (2014-05-31)
rename private functions to avoid conflicts with stb_image.h
0.93 (2014-05-27)
warning fixes
0.92 (2010-08-01)
...
...
tests/image_test.c
浏览文件 @
b96edc01
此差异已折叠。
点击以展开。
tests/image_test.dsp
浏览文件 @
b96edc01
...
...
@@ -86,10 +86,6 @@ SOURCE=.\image_test.c
# End Source File
# Begin Source File
SOURCE=..\stb_image.c
# End Source File
# Begin Source File
SOURCE=..\..\stb_image_write.h
# End Source File
# End Target
...
...
tests/stb.dsp
浏览文件 @
b96edc01
...
...
@@ -90,10 +90,6 @@ SOURCE=.\stb.c
# End Source File
# Begin Source File
SOURCE=..\stb_image.c
# End Source File
# Begin Source File
SOURCE=..\stb_vorbis.c
# End Source File
# Begin Source File
...
...
tests/stb_cpp.dsp
浏览文件 @
b96edc01
...
...
@@ -87,10 +87,6 @@ SOURCE=.\stb_cpp.cpp
# End Source File
# Begin Source File
SOURCE=..\stb_image.c
# End Source File
# Begin Source File
SOURCE=..\stb_vorbis.c
# End Source File
# Begin Source File
...
...
tests/stretch_test.dsp
浏览文件 @
b96edc01
此差异已折叠。
点击以展开。
tests/test_c_compilation.c
浏览文件 @
b96edc01
...
...
@@ -3,7 +3,9 @@
#define STB_DXT_IMPLEMENATION
#define STB_C_LEXER_IMPLEMENTATIOn
#define STB_DIVIDE_IMPLEMENTATION
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
#include "stb_image_write.h"
#include "stb_perlin.h"
#include "stb_dxt.h"
...
...
tests/test_cpp_compilation.cpp
浏览文件 @
b96edc01
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录