亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲一二三级电影| 国产精品美女视频| 欧洲av一区二区嗯嗯嗯啊| 成人小视频在线| 成人黄色软件下载| 91一区二区在线观看| 色呦呦日韩精品| 色综合激情五月| 欧美丰满嫩嫩电影| 欧美一区二区私人影院日本| 在线播放日韩导航| 欧美一区二区美女| 精品日韩一区二区| 日本一区二区在线不卡| 中文字幕第一页久久| 亚洲麻豆国产自偷在线| 夜夜揉揉日日人人青青一国产精品| 一区二区视频免费在线观看| 午夜国产精品影院在线观看| 亚洲一区二区三区四区在线| 中文字幕一区二区三区视频| 亚洲欧美日韩精品久久久久| 亚洲成av人片在www色猫咪| 日韩中文字幕91| 国产一区二区美女诱惑| 99久久婷婷国产精品综合| 色哟哟一区二区| 日韩免费观看高清完整版 | 日韩高清不卡一区| 九色|91porny| 色偷偷成人一区二区三区91| 欧美一区二区三区人| 中文字幕精品在线不卡| 亚洲福利电影网| 国产精品1区2区| 欧美视频在线一区| 久久久久久毛片| 香蕉影视欧美成人| 大陆成人av片| 91精品国产综合久久精品| 欧美激情中文字幕一区二区| 日日嗨av一区二区三区四区| www.色综合.com| 91麻豆精品国产无毒不卡在线观看| 久久久久久麻豆| 三级不卡在线观看| 91美女片黄在线| 国产欧美一区二区精品性色超碰| 午夜精品久久久久久不卡8050| 国产a级毛片一区| 精品日产卡一卡二卡麻豆| 亚洲成av人在线观看| 国产成人亚洲综合色影视| 91精品国产综合久久蜜臀| 一区二区三区四区av| 成人激情黄色小说| 久久视频一区二区| 日本一区中文字幕| 精品视频在线免费看| 中文字幕在线不卡一区| 久久99精品久久久久久国产越南| 欧美日韩高清一区二区三区| 一区二区三区美女视频| 国产91精品久久久久久久网曝门 | 日韩精品资源二区在线| 亚洲久草在线视频| 成人国产精品免费观看| 国产欧美一区二区精品仙草咪| 久久99精品久久久久久动态图| 欧美福利一区二区| 日韩福利电影在线观看| 欧美喷潮久久久xxxxx| 亚洲午夜久久久久久久久电影院| 97精品电影院| 亚洲人一二三区| 欧美在线影院一区二区| 一区二区激情小说| 在线观看av不卡| 亚洲h动漫在线| 91麻豆精品国产自产在线| 日本va欧美va瓶| 国内精品国产成人国产三级粉色| 久久av老司机精品网站导航| 日韩欧美一区中文| 麻豆精品一二三| 欧美xxxxxxxx| 高清视频一区二区| 亚洲少妇最新在线视频| 欧美视频一二三区| 日本va欧美va瓶| 亚洲精品在线电影| 国产成a人无v码亚洲福利| 国产精品欧美一区二区三区| 色婷婷av一区| 肉色丝袜一区二区| 久久九九影视网| 91色porny蝌蚪| 日本欧美加勒比视频| 久久奇米777| 91蜜桃婷婷狠狠久久综合9色| 亚洲国产欧美日韩另类综合| 欧美mv日韩mv| 91日韩一区二区三区| 偷拍日韩校园综合在线| 久久精品人人做| 色综合久久久久综合| 日本麻豆一区二区三区视频| 久久久久国产精品人| 日本电影欧美片| 精品一区二区三区不卡 | 欧美在线一二三四区| 日韩精品欧美成人高清一区二区| 久久午夜羞羞影院免费观看| 色哟哟国产精品| 蜜桃一区二区三区四区| 中文字幕在线不卡视频| 欧美一区永久视频免费观看| 国产精品一区免费视频| 性做久久久久久免费观看欧美| 久久久精品黄色| 欧美日本高清视频在线观看| 成人av网站在线观看免费| 天堂一区二区在线免费观看| 中文字幕亚洲电影| 精品sm在线观看| 欧美精品一区二区久久婷婷| 成人av资源站| 狠狠色丁香久久婷婷综合_中| 亚洲精选视频免费看| 久久精品免视看| 欧美大度的电影原声| 欧美在线视频你懂得| av电影天堂一区二区在线| 久久er精品视频| 美国欧美日韩国产在线播放| 亚洲成人午夜影院| 一区二区三区四区在线| 中文字幕亚洲视频| 日本一区二区成人在线| 精品久久久久久久久久久久久久久 | 国产美女在线精品| 日韩精品视频网站| 亚洲一区二区三区四区在线| 亚洲精品美腿丝袜| 国产精品国产三级国产| 久久蜜桃av一区二区天堂| 欧美zozozo| 日韩一区二区精品葵司在线| 欧美日韩三级在线| 欧美午夜宅男影院| 在线亚洲人成电影网站色www| jvid福利写真一区二区三区| av一二三不卡影片| 成人动漫在线一区| 成人午夜大片免费观看| 国产精品99久久久久久久女警| 久久99国产精品久久99果冻传媒| 久久成人久久爱| 国产一区二区在线观看免费| 国产美女精品一区二区三区| 国产一区二区三区四区五区入口 | 欧美中文字幕一区二区三区 | 欧美在线视频你懂得| 欧美日本在线视频| 日韩欧美国产一二三区| 欧美电影精品一区二区| 久久男人中文字幕资源站| 中文字幕av一区二区三区免费看 | 亚洲国产精品黑人久久久| 国产精品丝袜黑色高跟| 亚洲欧美自拍偷拍色图| 亚洲精品国产品国语在线app| 91在线精品秘密一区二区| 天天操天天色综合| 日产欧产美韩系列久久99| 久久精工是国产品牌吗| 不卡视频一二三四| 欧美日韩免费观看一区二区三区| 91精品国产欧美一区二区| 久久精品视频一区| 亚洲精品你懂的| 日本三级韩国三级欧美三级| 国产剧情一区二区| 色婷婷久久久久swag精品| 制服丝袜在线91| 国产三级精品三级| 亚洲电影一区二区三区| 狠狠色狠狠色合久久伊人| 91美女视频网站| 欧美大片国产精品| 一区二区成人在线视频| 久久国产婷婷国产香蕉| 不卡av电影在线播放| 在线播放中文一区| 国产精品久久久久影院亚瑟| 视频在线观看91| 99精品1区2区| 久久综合视频网| 亚洲国产一区在线观看| 国产精品一区二区久激情瑜伽|