Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Libpng
提交
155889b3
T
Third Party Libpng
项目概览
OpenHarmony
/
Third Party Libpng
大约 1 年 前同步成功
通知
4
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Libpng
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
155889b3
编写于
8月 11, 2010
作者:
G
Glenn Randers-Pehrson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[master] Revised contrib/gregbook to work under cygwin/mingw.
上级
4dd011f6
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
100 addition
and
8 deletion
+100
-8
ANNOUNCE
ANNOUNCE
+1
-0
CHANGES
CHANGES
+1
-0
contrib/gregbook/README
contrib/gregbook/README
+1
-1
contrib/gregbook/readpng2.c
contrib/gregbook/readpng2.c
+1
-1
contrib/gregbook/rpng-win.c
contrib/gregbook/rpng-win.c
+46
-2
contrib/gregbook/rpng2-win.c
contrib/gregbook/rpng2-win.c
+50
-4
未找到文件。
ANNOUNCE
浏览文件 @
155889b3
...
...
@@ -56,6 +56,7 @@ version 1.4.4beta05 [August 6, 2010]
version 1.4.4beta06 [August 11, 2010]
Don't try to use version-script with cygwin/mingw.
Revised contrib/gregbook to work under cygwin/mingw.
Send comments/corrections/commendations to glennrp at users.sourceforge.net
or to png-mng-implement at lists.sf.net (subscription required; visit
...
...
CHANGES
浏览文件 @
155889b3
...
...
@@ -2640,6 +2640,7 @@ version 1.4.4beta05 [August 6, 2010]
version 1.4.4beta06 [August 11, 2010]
Don't try to use version-script with cygwin/mingw.
Revised contrib/gregbook to work under cygwin/mingw.
Send comments/corrections/commendations to glennrp at users.sourceforge.net
or to png-mng-implement at lists.sf.net (subscription required; visit
...
...
contrib/gregbook/README
浏览文件 @
155889b3
...
...
@@ -165,7 +165,7 @@ RUNNING THE PROGRAMS: (VERY) BRIEF INTRO
rpng is a simple PNG viewer that can display transparent PNGs with a
specified background color; for example,
rpng -bgcolor #ff0000 toucan.png
rpng -bgcolor
\
#ff0000 toucan.png
would display the image with a red background. rpng2 is a progressive
viewer that simulates a web browser in some respects; it can display
...
...
contrib/gregbook/readpng2.c
浏览文件 @
155889b3
...
...
@@ -138,7 +138,7 @@ int readpng2_init(mainprog_info *mainprog_ptr)
* version recognizes more chunks, add them to this list. If a
* future version of readpng2.c recognizes more chunks, delete them
* from this list. */
static
const
png_byte
chunks_to_ignore
[]
=
{
static
/* const */
png_byte
chunks_to_ignore
[]
=
{
99
,
72
,
82
,
77
,
'\0'
,
/* cHRM */
104
,
73
,
83
,
84
,
'\0'
,
/* hIST */
105
,
67
,
67
,
80
,
'\0'
,
/* iCCP */
...
...
contrib/gregbook/rpng-win.c
浏览文件 @
155889b3
...
...
@@ -85,7 +85,33 @@
#include <string.h>
#include <time.h>
#include <windows.h>
#ifdef __CYGWIN__
/* getch replacement. Turns out, we don't really need this,
* but leave it here if we ever enable any of the uses of
* _getch in the main code
*/
#include <unistd.h>
#include <termio.h>
#include <sys/ioctl.h>
int
repl_getch
(
void
)
{
char
ch
;
int
fd
=
fileno
(
stdin
);
struct
termio
old_tty
,
new_tty
;
ioctl
(
fd
,
TCGETA
,
&
old_tty
);
new_tty
=
old_tty
;
new_tty
.
c_lflag
&=
~
(
ICANON
|
ECHO
|
ISIG
);
ioctl
(
fd
,
TCSETA
,
&
new_tty
);
fread
(
&
ch
,
1
,
sizeof
(
ch
),
stdin
);
ioctl
(
fd
,
TCSETA
,
&
old_tty
);
return
ch
;
}
#define _getch repl_getch
#else
#include <conio.h>
/* only for _getch() */
#endif
/* #define DEBUG : this enables the Trace() macros */
...
...
@@ -153,7 +179,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
filename
=
(
char
*
)
NULL
;
#ifndef __CYGWIN__
/* First reenable console output, which normally goes to the bit bucket
* for windowed apps. Closing the console window will terminate the
* app. Thanks to David.Geldreich@realviz.com for supplying the magical
...
...
@@ -162,6 +188,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
AllocConsole
();
freopen
(
"CONOUT$"
,
"a"
,
stderr
);
freopen
(
"CONOUT$"
,
"a"
,
stdout
);
#endif
/* Next set the default value for our display-system exponent, i.e.,
...
...
@@ -279,7 +306,9 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
/* print usage screen if any errors up to this point */
if
(
error
)
{
#ifndef __CYGWIN__
int
ch
;
#endif
fprintf
(
stderr
,
"
\n
%s %s: %s
\n\n
"
,
PROGNAME
,
VERSION
,
appname
);
readpng_version_info
();
...
...
@@ -293,11 +322,15 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
"
\t\t
(e.g., ``#ff7700'' for orange: same as HTML colors);
\n
"
"
\t\t
used with transparent images
\n
"
"
\n
Press Q, Esc or mouse button 1 after image is displayed to quit.
\n
"
#ifndef __CYGWIN__
"Press Q or Esc to quit this usage screen.
\n
"
#endif
"
\n
"
,
PROGNAME
,
default_display_exponent
);
#ifndef __CYGWIN__
do
ch
=
_getch
();
while
(
ch
!=
'q'
&&
ch
!=
'Q'
&&
ch
!=
0x1B
);
#endif
exit
(
1
);
}
...
...
@@ -333,18 +366,24 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
if
(
error
)
{
#ifndef __CYGWIN__
int
ch
;
#endif
fprintf
(
stderr
,
PROGNAME
": aborting.
\n
"
);
#ifndef __CYGWIN__
do
ch
=
_getch
();
while
(
ch
!=
'q'
&&
ch
!=
'Q'
&&
ch
!=
0x1B
);
#endif
exit
(
2
);
}
else
{
fprintf
(
stderr
,
"
\n
%s %s: %s
\n
"
,
PROGNAME
,
VERSION
,
appname
);
#ifndef __CYGWIN__
fprintf
(
stderr
,
"
\n
[console window: closing this window will terminate %s]
\n\n
"
,
PROGNAME
);
#endif
}
...
...
@@ -417,7 +456,12 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
/* wait for the user to tell us when to quit */
printf
(
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.
\n
"
);
#ifndef __CYGWIN__
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.
\n
"
#else
"Done. Press mouse button 1 (within image window) to quit.
\n
"
#endif
);
fflush
(
stdout
);
while
(
GetMessage
(
&
msg
,
NULL
,
0
,
0
))
{
...
...
contrib/gregbook/rpng2-win.c
浏览文件 @
155889b3
...
...
@@ -96,7 +96,33 @@
#include <time.h>
#include <math.h>
/* only for PvdM background code */
#include <windows.h>
#ifdef __CYGWIN__
/* getch replacement. Turns out, we don't really need this,
* but leave it here if we ever enable any of the uses of
* _getch in the main code
*/
#include <unistd.h>
#include <termio.h>
#include <sys/ioctl.h>
int
repl_getch
(
void
)
{
char
ch
;
int
fd
=
fileno
(
stdin
);
struct
termio
old_tty
,
new_tty
;
ioctl
(
fd
,
TCGETA
,
&
old_tty
);
new_tty
=
old_tty
;
new_tty
.
c_lflag
&=
~
(
ICANON
|
ECHO
|
ISIG
);
ioctl
(
fd
,
TCSETA
,
&
new_tty
);
fread
(
&
ch
,
1
,
sizeof
(
ch
),
stdin
);
ioctl
(
fd
,
TCSETA
,
&
old_tty
);
return
ch
;
}
#define _getch repl_getch
#else
#include <conio.h>
/* only for _getch() */
#endif
/* all for PvdM background code: */
#ifndef PI
...
...
@@ -270,7 +296,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
filename
=
(
char
*
)
NULL
;
memset
(
&
rpng2_info
,
0
,
sizeof
(
mainprog_info
));
#ifndef __CYGWIN__
/* Next reenable console output, which normally goes to the bit bucket
* for windowed apps. Closing the console window will terminate the
* app. Thanks to David.Geldreich@realviz.com for supplying the magical
...
...
@@ -279,7 +305,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
AllocConsole
();
freopen
(
"CONOUT$"
,
"a"
,
stderr
);
freopen
(
"CONOUT$"
,
"a"
,
stdout
);
#endif
/* Set the default value for our display-system exponent, i.e., the
* product of the CRT exponent and the exponent corresponding to
...
...
@@ -413,7 +439,9 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
/* print usage screen if any errors up to this point */
if
(
error
)
{
#ifndef __CYGWIN__
int
ch
;
#endif
fprintf
(
stderr
,
"
\n
%s %s: %s
\n\n
"
,
PROGNAME
,
VERSION
,
appname
);
readpng2_version_info
();
...
...
@@ -432,16 +460,23 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
" -timing
\t
enables delay for every block read, to simulate modem
\n
"
"
\t\t
download of image (~36 Kbps)
\n
"
"
\n
Press Q, Esc or mouse button 1 after image is displayed to quit.
\n
"
#ifndef __CYGWIN__
"Press Q or Esc to quit this usage screen. "
,
#else
,
#endif
PROGNAME
,
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__)) && \
!(defined(__CYGWIN__) || defined(__MINGW32__))
(
int
)
strlen
(
PROGNAME
),
" "
,
#endif
(
int
)
strlen
(
PROGNAME
),
" "
,
default_display_exponent
,
num_bgpat
);
fflush
(
stderr
);
#ifndef __CYGWIN__
do
ch
=
_getch
();
while
(
ch
!=
'q'
&&
ch
!=
'Q'
&&
ch
!=
0x1B
);
#endif
exit
(
1
);
}
...
...
@@ -478,18 +513,24 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
if
(
error
)
{
#ifndef __CYGWIN__
int
ch
;
#endif
fprintf
(
stderr
,
PROGNAME
": aborting.
\n
"
);
#ifndef __CYGWIN__
do
ch
=
_getch
();
while
(
ch
!=
'q'
&&
ch
!=
'Q'
&&
ch
!=
0x1B
);
#endif
exit
(
2
);
}
else
{
fprintf
(
stderr
,
"
\n
%s %s: %s
\n
"
,
PROGNAME
,
VERSION
,
appname
);
#ifndef __CYGWIN__
fprintf
(
stderr
,
"
\n
[console window: closing this window will terminate %s]
\n\n
"
,
PROGNAME
);
#endif
fflush
(
stderr
);
}
...
...
@@ -1132,7 +1173,12 @@ static void rpng2_win_finish_display()
rpng2_info
.
state
=
kDone
;
printf
(
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.
\n
"
);
#ifndef __CYGWIN__
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.
\n
"
#else
"Done. Press mouse button 1 (within image window) to quit.
\n
"
#endif
);
fflush
(
stdout
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录