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

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

?? rpng-win.c

?? 一套linux2.4 kernel下面的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一区二区三区免费野_久草精品视频
欧美mv和日韩mv国产网站| 蜜乳av一区二区| 91啪在线观看| 免费的国产精品| 天天色天天操综合| 一区在线观看视频| 国产老肥熟一区二区三区| 精品国产乱码久久久久久老虎| 老汉av免费一区二区三区| 亚洲一区二区黄色| 欧美一区二区在线视频| 日韩vs国产vs欧美| 国产精品久久毛片a| 久久久综合激的五月天| 欧美精品精品一区| 色94色欧美sute亚洲线路一久| 国产成人精品午夜视频免费| 美女精品一区二区| 首页欧美精品中文字幕| 亚洲第一av色| 日本亚洲视频在线| 日本亚洲免费观看| 日韩影院在线观看| 午夜激情一区二区三区| 五月综合激情网| 天天影视色香欲综合网老头| 日日噜噜夜夜狠狠视频欧美人| 午夜精品aaa| 久久99日本精品| 精品一区二区三区香蕉蜜桃| 久久精品国产99| 成人小视频在线| 色视频欧美一区二区三区| 色先锋资源久久综合| 欧美乱熟臀69xxxxxx| 精品国产伦一区二区三区免费| 久久老女人爱爱| 国产精品福利在线播放| 亚洲一级二级三级| 狂野欧美性猛交blacked| 99热这里都是精品| 91女神在线视频| 91 com成人网| 国产精品国产三级国产aⅴ中文 | 日本丶国产丶欧美色综合| 91久久精品日日躁夜夜躁欧美| 69av一区二区三区| 欧美激情综合网| 亚洲亚洲人成综合网络| 国产在线精品一区二区不卡了| 91一区二区在线| 久久综合九色欧美综合狠狠| 一区二区三区四区不卡在线| 另类调教123区| 日本韩国欧美在线| 久久久国产精品午夜一区ai换脸| 午夜欧美在线一二页| 91欧美一区二区| 国产精品免费aⅴ片在线观看| 日本不卡一区二区| 在线观看免费成人| 国产精品第13页| 国产高清在线观看免费不卡| 日韩欧美中文字幕制服| 亚洲一区二区三区四区在线观看| 波多野结衣精品在线| 国产亚洲自拍一区| 国产jizzjizz一区二区| 精品成人佐山爱一区二区| 视频精品一区二区| 欧美日韩一卡二卡| 亚洲6080在线| 丁香亚洲综合激情啪啪综合| 欧美xingq一区二区| 蜜桃久久av一区| 久久亚洲影视婷婷| 国产成人精品午夜视频免费| 久久精品一级爱片| 成人免费视频视频| 国产精品女人毛片| 91免费视频观看| 3d动漫精品啪啪| 精品国产在天天线2019| 久久99国产精品久久99 | 3d成人h动漫网站入口| 日韩vs国产vs欧美| 中文字幕免费不卡| 欧美日精品一区视频| 日韩国产在线观看一区| 精品国产99国产精品| 99精品视频一区| 美女性感视频久久| 国产欧美视频在线观看| 欧美性猛交一区二区三区精品| 日本欧美在线观看| 国产亚洲欧美色| 欧美在线视频全部完| 国产综合色产在线精品 | 亚洲人吸女人奶水| 精品日产卡一卡二卡麻豆| 99精品国产91久久久久久| 日韩福利视频网| 亚洲男人的天堂在线aⅴ视频 | 久久久99精品久久| 欧美久久一二三四区| 成人av网站在线观看免费| 奇米四色…亚洲| 亚洲国产成人av好男人在线观看| 日韩欧美一区二区在线视频| bt7086福利一区国产| 国产福利91精品| 久久av中文字幕片| 日本人妖一区二区| 亚洲成人av在线电影| 国产精品国产三级国产专播品爱网 | 中文字幕国产一区| 日韩欧美电影在线| 欧美精品乱人伦久久久久久| 日本韩国视频一区二区| 91丝袜高跟美女视频| 国产成人精品免费视频网站| 狠狠狠色丁香婷婷综合久久五月| 国产一区福利在线| 麻豆精品视频在线观看| 免费高清成人在线| 亚洲国产精品久久人人爱蜜臀| 亚洲三级视频在线观看| 亚洲欧美一区二区三区国产精品| 久久精品视频在线看| 中文字幕第一区二区| 成人欧美一区二区三区视频网页| 国产精品久久久久婷婷二区次| 国产精品免费视频观看| 亚洲女人的天堂| 一区二区成人在线观看| 亚洲国产另类av| 美日韩一区二区| 波多野洁衣一区| 欧美揉bbbbb揉bbbbb| 欧美精品一区二区三区蜜臀| 中文字幕国产一区| 亚洲综合在线免费观看| 男男视频亚洲欧美| 国产成人免费视频精品含羞草妖精 | 国产成人精品亚洲日本在线桃色| av电影一区二区| 日韩一级高清毛片| 17c精品麻豆一区二区免费| 另类欧美日韩国产在线| 国产在线精品一区二区不卡了| heyzo一本久久综合| 91精品国产乱| 一区二区三区毛片| 国产99久久久国产精品免费看| 91看片淫黄大片一级在线观看| 欧美一级电影网站| 一区二区三区在线观看国产| 免费在线观看精品| 色综合色综合色综合| 久久综合资源网| 日韩精品电影一区亚洲| 99综合电影在线视频| 久久久久亚洲综合| 免费一级片91| 91精品国产福利| 亚洲国产aⅴ成人精品无吗| 国产不卡视频在线观看| 337p亚洲精品色噜噜狠狠| 综合色中文字幕| 成人免费毛片片v| 国产日韩欧美不卡| 国产不卡一区视频| 久久亚洲精华国产精华液 | 成人av电影在线| 欧美精品一区二区在线播放 | 精品一区二区在线播放| wwww国产精品欧美| 国内精品伊人久久久久av影院| 欧美一级夜夜爽| 精品一区二区三区免费| 精品国产一区二区三区久久影院| 日韩黄色片在线观看| 91精品国产综合久久国产大片| 三级久久三级久久| 精品久久久久久久久久久久久久久久久 | 色综合久久综合网欧美综合网| 一区二区在线观看视频| 欧美三级日韩在线| 久久 天天综合| 国产精品久久久久毛片软件| 色综合天天性综合| 亚洲第一在线综合网站| 日韩欧美高清一区| 成人国产精品免费观看视频| 最新久久zyz资源站| 日韩一级片在线观看| 国产成人午夜99999| 亚洲va国产va欧美va观看| 久久午夜免费电影| 欧美三级视频在线|