亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rpng-win.c

?? linux 2.6kernel下面png庫
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*---------------------------------------------------------------------------   rpng - simple PNG display program                             rpng-win.c   This program decodes and displays PNG images, with gamma correction and   optionally with a user-specified background color (in case the image has   transparency).  It is very nearly the most basic PNG viewer possible.   This version is for 32-bit Windows; it may compile under 16-bit Windows   with a little tweaking (or maybe not).   to do:    - handle quoted command-line args (especially filenames with spaces)    - have minimum window width:  oh well    - use %.1023s to simplify truncation of title-bar string?  ---------------------------------------------------------------------------   Changelog:    - 1.00:  initial public release    - 1.01:  modified to allow abbreviated options; fixed long/ulong mis-              match; switched to png_jmpbuf() macro    - 1.02:  added extra set of parentheses to png_jmpbuf() macro; fixed              command-line parsing bug    - 1.10:  enabled "message window"/console (thanks to David Geldreich)  ---------------------------------------------------------------------------      Copyright (c) 1998-2001 Greg Roelofs.  All rights reserved.      This software is provided "as is," without warranty of any kind,      express or implied.  In no event shall the author or contributors      be held liable for any damages arising in any way from the use of      this software.      Permission is granted to anyone to use this software for any purpose,      including commercial applications, and to alter it and redistribute      it freely, subject to the following restrictions:      1. Redistributions of source code must retain the above copyright         notice, disclaimer, and this list of conditions.      2. Redistributions in binary form must reproduce the above copyright         notice, disclaimer, and this list of conditions in the documenta-         tion and/or other materials provided with the distribution.      3. All advertising materials mentioning features or use of this         software must display the following acknowledgment:            This product includes software developed by Greg Roelofs            and contributors for the book, "PNG: The Definitive Guide,"            published by O'Reilly and Associates.  ---------------------------------------------------------------------------*/#define PROGNAME  "rpng-win"#define LONGNAME  "Simple PNG Viewer for Windows"#define VERSION   "1.20 of 28 May 2001"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <windows.h>#include <conio.h>      /* only for _getch() *//* #define DEBUG  :  this enables the Trace() macros */#include "readpng.h"    /* typedefs, common macros, readpng prototypes *//* could just include png.h, but this macro is the only thing we need * (name and typedefs changed to local versions); note that side effects * only happen with alpha (which could easily be avoided with * "ush acopy = (alpha);") */#define alpha_composite(composite, fg, alpha, bg) {               \    ush temp = ((ush)(fg)*(ush)(alpha) +                          \                (ush)(bg)*(ush)(255 - (ush)(alpha)) + (ush)128);  \    (composite) = (uch)((temp + (temp >> 8)) >> 8);               \}/* local prototypes */static int        rpng_win_create_window(HINSTANCE hInst, int showmode);static int        rpng_win_display_image(void);static void       rpng_win_cleanup(void);LRESULT CALLBACK  rpng_win_wndproc(HWND, UINT, WPARAM, LPARAM);static char titlebar[1024], *window_name = titlebar;static char *progname = PROGNAME;static char *appname = LONGNAME;static char *icon_name = PROGNAME;     /* GRR:  not (yet) used */static char *filename;static FILE *infile;static char *bgstr;static uch bg_red=0, bg_green=0, bg_blue=0;static double display_exponent;static ulg image_width, image_height, image_rowbytes;static int image_channels;static uch *image_data;/* Windows-specific variables */static ulg wimage_rowbytes;static uch *dib;static uch *wimage_data;static BITMAPINFOHEADER *bmih;static HWND global_hwnd;int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode){    char *args[1024];                 /* arbitrary limit, but should suffice */    char *p, *q, **argv = args;    int argc = 0;    int rc, alen, flen;    int error = 0;    int have_bg = FALSE;    double LUT_exponent;              /* just the lookup table */    double CRT_exponent = 2.2;        /* just the monitor */    double default_display_exponent;  /* whole display system */    MSG msg;    filename = (char *)NULL;    /* 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     * incantation. */    AllocConsole();    freopen("CONOUT$", "a", stderr);    freopen("CONOUT$", "a", stdout);    /* Next set the default value for our display-system exponent, i.e.,     * the product of the CRT exponent and the exponent corresponding to     * the frame-buffer's lookup table (LUT), if any.  This is not an     * exhaustive list of LUT values (e.g., OpenStep has a lot of weird     * ones), but it should cover 99% of the current possibilities.  And     * yes, these ifdefs are completely wasted in a Windows program... */#if defined(NeXT)    LUT_exponent = 1.0 / 2.2;    /*    if (some_next_function_that_returns_gamma(&next_gamma))        LUT_exponent = 1.0 / next_gamma;     */#elif defined(sgi)    LUT_exponent = 1.0 / 1.7;    /* there doesn't seem to be any documented function to get the     * "gamma" value, so we do it the hard way */    infile = fopen("/etc/config/system.glGammaVal", "r");    if (infile) {        double sgi_gamma;        fgets(tmpline, 80, infile);        fclose(infile);        sgi_gamma = atof(tmpline);        if (sgi_gamma > 0.0)            LUT_exponent = 1.0 / sgi_gamma;    }#elif defined(Macintosh)    LUT_exponent = 1.8 / 2.61;    /*    if (some_mac_function_that_returns_gamma(&mac_gamma))        LUT_exponent = mac_gamma / 2.61;     */#else    LUT_exponent = 1.0;   /* assume no LUT:  most PCs */#endif    /* the defaults above give 1.0, 1.3, 1.5 and 2.2, respectively: */    default_display_exponent = LUT_exponent * CRT_exponent;    /* If the user has set the SCREEN_GAMMA environment variable as suggested     * (somewhat imprecisely) in the libpng documentation, use that; otherwise     * use the default value we just calculated.  Either way, the user may     * override this via a command-line option. */    if ((p = getenv("SCREEN_GAMMA")) != NULL)        display_exponent = atof(p);    else        display_exponent = default_display_exponent;    /* Windows really hates command lines, so we have to set up our own argv.     * Note that we do NOT bother with quoted arguments here, so don't use     * filenames with spaces in 'em! */    argv[argc++] = PROGNAME;    p = cmd;    for (;;) {        if (*p == ' ')            while (*++p == ' ')                ;        /* now p points at the first non-space after some spaces */        if (*p == '\0')            break;    /* nothing after the spaces:  done */        argv[argc++] = q = p;        while (*q && *q != ' ')            ++q;        /* now q points at a space or the end of the string */        if (*q == '\0')            break;    /* last argv already terminated; quit */        *q = '\0';    /* change space to terminator */        p = q + 1;    }    argv[argc] = NULL;   /* terminate the argv array itself */    /* Now parse the command line for options and the PNG filename. */    while (*++argv && !error) {        if (!strncmp(*argv, "-gamma", 2)) {            if (!*++argv)                ++error;            else {                display_exponent = atof(*argv);                if (display_exponent <= 0.0)                    ++error;            }        } else if (!strncmp(*argv, "-bgcolor", 2)) {            if (!*++argv)                ++error;            else {                bgstr = *argv;                if (strlen(bgstr) != 7 || bgstr[0] != '#')                    ++error;                else                    have_bg = TRUE;            }        } else {            if (**argv != '-') {                filename = *argv;                if (argv[1])   /* shouldn't be any more args after filename */                    ++error;            } else                ++error;   /* not expecting any other options */        }    }    if (!filename) {        ++error;    } else if (!(infile = fopen(filename, "rb"))) {        fprintf(stderr, PROGNAME ":  can't open PNG file [%s]\n", filename);        ++error;    } else {        if ((rc = readpng_init(infile, &image_width, &image_height)) != 0) {            switch (rc) {                case 1:                    fprintf(stderr, PROGNAME                      ":  [%s] is not a PNG file: incorrect signature\n",                      filename);                    break;                case 2:                    fprintf(stderr, PROGNAME                      ":  [%s] has bad IHDR (libpng longjmp)\n",                      filename);                    break;                case 4:                    fprintf(stderr, PROGNAME ":  insufficient memory\n");                    break;                default:                    fprintf(stderr, PROGNAME                      ":  unknown readpng_init() error\n");                    break;            }            ++error;        }        if (error)            fclose(infile);    }    /* usage screen */    if (error) {        int ch;        fprintf(stderr, "\n%s %s:  %s\n\n", PROGNAME, VERSION, appname);        readpng_version_info();        fprintf(stderr, "\n"          "Usage:  %s [-gamma exp] [-bgcolor bg] file.png\n"          "    exp \ttransfer-function exponent (``gamma'') of the display\n"          "\t\t  system in floating-point format (e.g., ``%.1f''); equal\n"          "\t\t  to the product of the lookup-table exponent (varies)\n"          "\t\t  and the CRT exponent (usually 2.2); must be positive\n"          "    bg  \tdesired background color in 7-character hex RGB format\n"          "\t\t  (e.g., ``#ff7700'' for orange:  same as HTML colors);\n"          "\t\t  used with transparent images\n"          "\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"          "Press Q or Esc to quit this usage screen.\n"          "\n", PROGNAME, default_display_exponent);        do            ch = _getch();        while (ch != 'q' && ch != 'Q' && ch != 0x1B);        exit(1);    } else {        fprintf(stderr, "\n%s %s:  %s\n", PROGNAME, VERSION, appname);        fprintf(stderr,          "\n   [console window:  closing this window will terminate %s]\n\n",          PROGNAME);    }    /* set the title-bar string, but make sure buffer doesn't overflow */    alen = strlen(appname);    flen = strlen(filename);    if (alen + flen + 3 > 1023)        sprintf(titlebar, "%s:  ...%s", appname, filename+(alen+flen+6-1023));    else        sprintf(titlebar, "%s:  %s", appname, filename);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
aaa欧美日韩| 中文字幕在线不卡一区二区三区| 欧美色大人视频| 欧美综合天天夜夜久久| 99re66热这里只有精品3直播 | 激情都市一区二区| 美国一区二区三区在线播放| 日韩国产在线一| 日韩av在线免费观看不卡| 日韩主播视频在线| 日韩电影在线观看网站| 午夜精品视频在线观看| 日韩精品一级二级| 国产一区在线视频| 成人国产精品免费网站| 91在线丨porny丨国产| 日本高清成人免费播放| 欧美怡红院视频| 日韩欧美在线123| 国产欧美精品一区二区三区四区| 国产精品久久久久婷婷| 亚洲欧美电影院| 五月天丁香久久| 国内精品视频666| 成人免费精品视频| 欧美性受xxxx黑人xyx| 日韩视频免费直播| 国产精品视频第一区| 亚洲免费观看高清完整版在线观看| 亚洲综合无码一区二区| 免费在线观看成人| 粉嫩av一区二区三区在线播放| 色综合久久中文字幕综合网| 欧美日韩不卡在线| 精品久久久久久综合日本欧美| 国产精品久久久久久久久久免费看 | 日韩二区在线观看| 国产一区日韩二区欧美三区| 波多野结衣中文字幕一区 | 亚洲人成在线播放网站岛国| 亚洲一区二区三区四区中文字幕| 美女视频免费一区| 成人免费视频视频| 欧美美女喷水视频| 国产欧美日产一区| 亚洲sss视频在线视频| 国产麻豆成人精品| 欧美影院精品一区| 国产视频一区不卡| 五月婷婷久久丁香| 成人免费看的视频| 欧美一区二区不卡视频| 中文字幕乱码亚洲精品一区 | 在线亚洲一区观看| 久久精品人人做人人爽人人| 亚洲综合一区二区精品导航| 国产毛片精品视频| 欧美视频中文字幕| 欧美激情一区三区| 久久国产精品99精品国产| 91同城在线观看| 亚洲精品一区在线观看| 亚洲一区二区四区蜜桃| 国产不卡视频在线播放| 欧美一区日韩一区| 亚洲久草在线视频| 国产精品77777| 日韩欧美一区在线| 亚洲妇女屁股眼交7| 成人国产在线观看| 久久精品亚洲精品国产欧美| 亚洲成人激情av| 色综合激情久久| 欧美韩日一区二区三区| 韩国精品在线观看| 欧美高清视频不卡网| 亚洲人快播电影网| 成人黄色在线看| 国产欧美一区二区三区在线看蜜臀| 日韩av电影免费观看高清完整版| 91美女视频网站| 国产精品美女久久久久aⅴ国产馆| 蜜臀久久99精品久久久久久9| 欧美日韩免费在线视频| 亚洲日本韩国一区| 99久久久国产精品免费蜜臀| 国产日韩一级二级三级| 狠狠色狠狠色综合| 日韩一区二区在线看片| 日本特黄久久久高潮| 欧美精三区欧美精三区| 午夜精品久久久久久不卡8050| 91论坛在线播放| 中文字幕亚洲视频| 成人国产亚洲欧美成人综合网| 国产偷国产偷亚洲高清人白洁| 久久国产精品一区二区| 日韩免费电影网站| 毛片av一区二区三区| 欧美一级二级三级蜜桃| 免费成人在线视频观看| 日韩美女一区二区三区| 久久精品国产一区二区三| 欧美一区二区视频观看视频| 日日夜夜精品视频免费| 欧美一区2区视频在线观看| 首页亚洲欧美制服丝腿| 欧美日韩1234| 免费观看91视频大全| 日韩美女天天操| 国产乱人伦偷精品视频不卡| 国产午夜一区二区三区| 成人性生交大片免费看中文| 中文字幕一区免费在线观看| 91网站在线播放| 亚洲成人手机在线| 日韩午夜精品电影| 久久99精品久久只有精品| 久久婷婷成人综合色| 成人一二三区视频| 国产精品传媒在线| 在线观看日产精品| 丝袜美腿亚洲综合| 久久青草国产手机看片福利盒子| 国产激情视频一区二区在线观看| 亚洲国产精品t66y| 欧美在线三级电影| 奇米四色…亚洲| 欧美激情一区二区三区全黄| 色综合久久综合| 免费精品99久久国产综合精品| 久久久www成人免费毛片麻豆 | 精品国产sm最大网站免费看| 国产精品亚洲а∨天堂免在线| 亚洲日本va在线观看| 欧美乱妇15p| 国产成人午夜精品5599| 一区二区在线观看视频| 日韩一区二区电影在线| 成人在线一区二区三区| 夜夜揉揉日日人人青青一国产精品 | 欧美挠脚心视频网站| 国产一区美女在线| 亚洲欧美福利一区二区| 日韩一区二区三区在线视频| 国产成人超碰人人澡人人澡| 亚洲欧洲综合另类| 精品国产成人在线影院| 色综合天天综合狠狠| 蜜桃91丨九色丨蝌蚪91桃色| 国产精品电影一区二区三区| 宅男在线国产精品| 成人av在线资源| 蜜臀av一级做a爰片久久| 亚洲视频一二三| 亚洲成人777| 国产视频一区在线观看| 欧美二区乱c少妇| 成人做爰69片免费看网站| 日韩va欧美va亚洲va久久| 国产精品家庭影院| 欧美一区二区女人| 99免费精品视频| 久草在线在线精品观看| 亚洲精品伦理在线| 久久久蜜桃精品| 91精品蜜臀在线一区尤物| 色综合天天综合色综合av| 国产在线精品一区二区夜色| 亚洲电影你懂得| 国产精品福利一区| 欧美精品一区二| 这里只有精品电影| 欧洲精品在线观看| 99久久精品免费看| 国产精品自拍一区| 奇米影视一区二区三区小说| 亚洲综合免费观看高清完整版在线 | 亚洲精品视频自拍| 国产欧美日本一区二区三区| 精品欧美一区二区在线观看 | 亚洲一区二区三区四区五区中文 | 韩国一区二区视频| 日韩av电影免费观看高清完整版| 亚洲一区二区三区四区中文字幕| 亚洲欧洲精品一区二区三区 | 国产a区久久久| 黄色资源网久久资源365| 免费成人性网站| 日韩精品午夜视频| 亚洲国产中文字幕在线视频综合| 亚洲欧洲精品天堂一级| 欧美激情一区二区三区全黄| 2021中文字幕一区亚洲| 日韩欧美你懂的| 91精选在线观看| 欧美乱熟臀69xxxxxx| 欧美精品在线视频| 91麻豆精品国产91| 日韩视频不卡中文|