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

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

?? rpng2-win.c

?? 下載來的一個看圖軟件的源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
    }    if (!filename) {        ++error;    } else if (!(infile = fopen(filename, "rb"))) {        fprintf(stderr, PROGNAME ":  can't open PNG file [%s]\n", filename);        ++error;    } else {        incount = fread(inbuf, 1, INBUFSIZE, infile);        if (incount < 8 || !readpng2_check_sig(inbuf, 8)) {            fprintf(stderr, PROGNAME              ":  [%s] is not a PNG file: incorrect signature\n",              filename);            ++error;        } else if ((rc = readpng2_init(&rpng2_info)) != 0) {            switch (rc) {                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 readpng2_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);        readpng2_version_info();        fprintf(stderr, "\n"          "Usage:  %s [-gamma exp] [-bgcolor bg | -bgpat pat] [-timing]\n"#if (defined(__i386__) || defined(_M_IX86))          "        %*s [[-nommxfilters] [-nommxcombine] [-nommxinterlace] | -nommx]\n"#endif          "        %*s file.png\n\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; overrides -bgpat option\n"          "    pat \tdesired background pattern number (1-%d); used with\n"          "\t\t  transparent images; overrides -bgcolor option\n"          "    -timing\tenables delay for every block read, to simulate modem\n"          "\t\t  download of image (~36 Kbps)\n"#if (defined(__i386__) || defined(_M_IX86))          "    -nommx*\tdisable optimized MMX routines for decoding row filters,\n"          "\t\t  combining rows, and expanding interlacing, respectively\n"#endif          "\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"          "Press Q or Esc to quit this usage screen. ",          PROGNAME,#if (defined(__i386__) || defined(_M_IX86))          strlen(PROGNAME), " ",#endif          strlen(PROGNAME), " ", default_display_exponent, num_bgpat);        fflush(stderr);        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);        fflush(stderr);    }    /* 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);    /* set some final rpng2_info variables before entering main data loop */    if (have_bg) {        unsigned r, g, b;   /* this approach quiets compiler warnings */        sscanf(bgstr+1, "%2x%2x%2x", &r, &g, &b);        rpng2_info.bg_red   = (uch)r;        rpng2_info.bg_green = (uch)g;        rpng2_info.bg_blue  = (uch)b;    } else        rpng2_info.need_bgcolor = TRUE;    rpng2_info.done = FALSE;    rpng2_info.mainprog_init = rpng2_win_init;    rpng2_info.mainprog_display_row = rpng2_win_display_row;    rpng2_info.mainprog_finish_display = rpng2_win_finish_display;    /* OK, this is the fun part:  call readpng2_decode_data() at the start of     * the loop to deal with our first buffer of data (read in above to verify     * that the file is a PNG image), then loop through the file and continue     * calling the same routine to handle each chunk of data.  It in turn     * passes the data to libpng, which will invoke one or more of our call-     * backs as decoded data become available.  We optionally call Sleep() for     * one second per iteration to simulate downloading the image via an analog     * modem. */    for (;;) {        Trace((stderr, "about to call readpng2_decode_data()\n"))        if (readpng2_decode_data(&rpng2_info, inbuf, incount))            ++error;        Trace((stderr, "done with readpng2_decode_data()\n"))        if (error || feof(infile) || rpng2_info.done)            break;        if (timing)            Sleep(1000L);        incount = fread(inbuf, 1, INBUFSIZE, infile);    }    /* clean up PNG stuff and report any decoding errors */    fclose(infile);    Trace((stderr, "about to call readpng2_cleanup()\n"))    readpng2_cleanup(&rpng2_info);    if (error) {        fprintf(stderr, PROGNAME ":  libpng error while decoding PNG image\n");        exit(3);    }    /* wait for the user to tell us when to quit */    while (GetMessage(&msg, NULL, 0, 0)) {        TranslateMessage(&msg);        DispatchMessage(&msg);    }    /* we're done:  clean up all image and Windows resources and go away */    Trace((stderr, "about to call rpng2_win_cleanup()\n"))    rpng2_win_cleanup();    return msg.wParam;}/* this function is called by readpng2_info_callback() in readpng2.c, which * in turn is called by libpng after all of the pre-IDAT chunks have been * read and processed--i.e., we now have enough info to finish initializing */static void rpng2_win_init(){    ulg i;    ulg rowbytes = rpng2_info.rowbytes;    Trace((stderr, "beginning rpng2_win_init()\n"))    Trace((stderr, "  rowbytes = %ld\n", rpng2_info.rowbytes))    Trace((stderr, "  width  = %ld\n", rpng2_info.width))    Trace((stderr, "  height = %ld\n", rpng2_info.height))    rpng2_info.image_data = (uch *)malloc(rowbytes * rpng2_info.height);    if (!rpng2_info.image_data) {        readpng2_cleanup(&rpng2_info);        return;    }    rpng2_info.row_pointers = (uch **)malloc(rpng2_info.height * sizeof(uch *));    if (!rpng2_info.row_pointers) {        free(rpng2_info.image_data);        rpng2_info.image_data = NULL;        readpng2_cleanup(&rpng2_info);        return;    }    for (i = 0;  i < rpng2_info.height;  ++i)        rpng2_info.row_pointers[i] = rpng2_info.image_data + i*rowbytes;/*---------------------------------------------------------------------------    Do the basic Windows initialization stuff, make the window, and fill it    with the user-specified, file-specified or default background color.  ---------------------------------------------------------------------------*/    if (rpng2_win_create_window()) {        readpng2_cleanup(&rpng2_info);        return;    }}static int rpng2_win_create_window(){    uch bg_red   = rpng2_info.bg_red;    uch bg_green = rpng2_info.bg_green;    uch bg_blue  = rpng2_info.bg_blue;    uch *dest;    int extra_width, extra_height;    ulg i, j;    WNDCLASSEX wndclass;    RECT rect;/*---------------------------------------------------------------------------    Allocate memory for the display-specific version of the image (round up    to multiple of 4 for Windows DIB).  ---------------------------------------------------------------------------*/    wimage_rowbytes = ((3*rpng2_info.width + 3L) >> 2) << 2;    if (!(dib = (uch *)malloc(sizeof(BITMAPINFOHEADER) +                              wimage_rowbytes*rpng2_info.height)))    {        return 4;   /* fail */    }/*---------------------------------------------------------------------------    Initialize the DIB.  Negative height means to use top-down BMP ordering    (must be uncompressed, but that's what we want).  Bit count of 1, 4 or 8    implies a colormap of RGBX quads, but 24-bit BMPs just use B,G,R values    directly => wimage_data begins immediately after BMP header.  ---------------------------------------------------------------------------*/    memset(dib, 0, sizeof(BITMAPINFOHEADER));    bmih = (BITMAPINFOHEADER *)dib;    bmih->biSize = sizeof(BITMAPINFOHEADER);    bmih->biWidth = rpng2_info.width;    bmih->biHeight = -((long)rpng2_info.height);    bmih->biPlanes = 1;    bmih->biBitCount = 24;    bmih->biCompression = 0;    wimage_data = dib + sizeof(BITMAPINFOHEADER);/*---------------------------------------------------------------------------    Fill window with the specified background color (default is black), but    defer loading faked "background image" until window is displayed (may be    slow to compute).  Data are in BGR order.  ---------------------------------------------------------------------------*/    if (bg_image) {   /* just fill with black for now */        memset(wimage_data, 0, wimage_rowbytes*rpng2_info.height);    } else {        for (j = 0;  j < rpng2_info.height;  ++j) {            dest = wimage_data + j*wimage_rowbytes;            for (i = rpng2_info.width;  i > 0;  --i) {                *dest++ = bg_blue;                *dest++ = bg_green;                *dest++ = bg_red;            }        }    }/*---------------------------------------------------------------------------    Set the window parameters.  ---------------------------------------------------------------------------*/    memset(&wndclass, 0, sizeof(wndclass));    wndclass.cbSize = sizeof(wndclass);    wndclass.style = CS_HREDRAW | CS_VREDRAW;    wndclass.lpfnWndProc = rpng2_win_wndproc;    wndclass.hInstance = global_hInst;    wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);    wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);    wndclass.hbrBackground = (HBRUSH)GetStockObject(DKGRAY_BRUSH);    wndclass.lpszMenuName = NULL;    wndclass.lpszClassName = progname;    wndclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);    RegisterClassEx(&wndclass);/*---------------------------------------------------------------------------    Finally, create the window.  ---------------------------------------------------------------------------*/    extra_width  = 2*(GetSystemMetrics(SM_CXBORDER) +                      GetSystemMetrics(SM_CXDLGFRAME));    extra_height = 2*(GetSystemMetrics(SM_CYBORDER) +                      GetSystemMetrics(SM_CYDLGFRAME)) +                      GetSystemMetrics(SM_CYCAPTION);    global_hwnd = CreateWindow(progname, titlebar, WS_OVERLAPPEDWINDOW,      CW_USEDEFAULT, CW_USEDEFAULT, rpng2_info.width+extra_width,      rpng2_info.height+extra_height, NULL, NULL, global_hInst, NULL);    ShowWindow(global_hwnd, global_showmode);    UpdateWindow(global_hwnd);/*---------------------------------------------------------------------------    Now compute the background image and display it.  If it fails (memory    allocation), revert to a plain background color.  ---------------------------------------------------------------------------*/    if (bg_image) {        static const char *msg = "Computing background image...";        int x, y, len = strlen(msg);        HDC hdc = GetDC(global_hwnd);        TEXTMETRIC tm;        GetTextMetrics(hdc, &tm);        x = (rpng2_info.width - len*tm.tmAveCharWidth)/2;        y = (rpng2_info.height - tm.tmHeight)/2;        SetBkMode(hdc, TRANSPARENT);        SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT));        /* this can still begin out of bounds even if x is positive (???): */        TextOut(hdc, ((x < 0)? 0 : x), ((y < 0)? 0 : y), msg, len);        ReleaseDC(global_hwnd, hdc);        rpng2_win_load_bg_image();   /* resets bg_image if fails */    }    if (!bg_image) {        for (j = 0;  j < rpng2_info.height;  ++j) {            dest = wimage_data + j*wimage_rowbytes;            for (i = rpng2_info.width;  i > 0;  --i) {                *dest++ = bg_blue;                *dest++ = bg_green;                *dest++ = bg_red;            }        }    }    rect.left = 0L;    rect.top = 0L;    rect.right = (LONG)rpng2_info.width;       /* possibly off by one? */    rect.bottom = (LONG)rpng2_info.height;     /* possibly off by one? */    InvalidateRect(global_hwnd, &rect, FALSE);    UpdateWindow(global_hwnd);                 /* similar to XFlush() */    return 0;} /* end function rpng2_win_create_window() */static int rpng2_win_load_bg_image(){    uch *src, *dest;    uch r1, r2, g1, g2, b1, b2;    uch r1_inv, r2_inv, g1_inv, g2_inv, b1_inv, b2_inv;    int k, hmax, max;    int xidx, yidx, yidx_max = (bgscale-1);    int even_odd_vert, even_odd_horiz, even_odd;    int invert_gradient2 = (bg[pat].type & 0x08);    int invert_column;    ulg i, row;/*---------------------------------------------------------------------------    Allocate buffer for fake background image to be used with transparent    images; if this fails, revert to plain background color.  ---------------------------------------------------------------------------*/    bg_rowbytes = 3 * rpng2_info.width;    bg_data = (uch *)malloc(bg_rowbytes * rpng2_info.height);    if (!bg_data) {        fprintf(stderr, PROGNAME          ":  unable to allocate memory for background image\n");        bg_image = 0;        return 1;    }/*---------------------------------------------------------------------------    Vertical gradients (ramps) in NxN squares, alternating direction and    colors (N == bgscale).  ---------------------------------------------------------------------------*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久91精品久久久久久秒播| 中文字幕中文在线不卡住| 日本乱码高清不卡字幕| 国产高清不卡一区二区| 久久成人18免费观看| 久久99国产精品免费| 精品制服美女丁香| 国产一区二区视频在线| 国产成人av一区二区| www.欧美.com| 91视频在线观看免费| 在线观看日韩高清av| 欧美剧情片在线观看| 精品盗摄一区二区三区| 久久网这里都是精品| 国产精品麻豆久久久| 亚洲欧美日韩人成在线播放| 亚洲黄色小视频| 亚洲不卡在线观看| 另类成人小视频在线| 国产99精品视频| 一本色道久久加勒比精品| 欧美日韩国产电影| 日韩久久久精品| 国产精品久久福利| 亚洲国产cao| 国产精品18久久久久久久久| 国产成人在线色| 欧美亚洲高清一区二区三区不卡| 欧美一区二区三区白人| 国产农村妇女毛片精品久久麻豆 | 日韩视频一区二区| 久久久久久久久久久久久夜| 国产精品不卡一区二区三区| 图片区日韩欧美亚洲| 国产激情偷乱视频一区二区三区| caoporn国产一区二区| 91精品国产综合久久精品麻豆| 日韩精品在线一区| 国产精品国产成人国产三级| 性久久久久久久久久久久 | 欧美国产综合色视频| 国产美女在线精品| 在线免费视频一区二区| 国内精品伊人久久久久av一坑| 国产白丝精品91爽爽久久| 欧美中文字幕一区二区三区亚洲| 欧美aaaaaa午夜精品| 成人黄色国产精品网站大全在线免费观看 | 亚洲免费观看高清完整版在线观看| 成人精品gif动图一区| 亚洲欧美日韩国产另类专区| 色婷婷一区二区| 日韩电影在线一区二区| 久久先锋资源网| 99久久国产综合精品麻豆| 亚洲国产视频直播| 精品粉嫩aⅴ一区二区三区四区| 激情六月婷婷久久| 亚洲人成伊人成综合网小说| 欧美无砖专区一中文字| 精品一区二区三区蜜桃| 亚洲欧美视频一区| 欧美一区二区三区啪啪| 高清国产一区二区| 亚洲成人精品在线观看| 2020国产成人综合网| 一本一道波多野结衣一区二区| 日韩国产一二三区| 国产精品麻豆视频| 日韩午夜av一区| 91丝袜美女网| 精品一区二区三区视频在线观看 | 五月天丁香久久| 国产欧美日韩亚州综合| 欧美日韩国产一区二区三区地区| 精品无人区卡一卡二卡三乱码免费卡| 中文一区二区完整视频在线观看| 欧美日韩一区不卡| 成人国产在线观看| 狠狠色伊人亚洲综合成人| 亚洲女爱视频在线| 久久久久9999亚洲精品| 欧美精品在线一区二区| thepron国产精品| 精品一区二区在线免费观看| 一二三区精品视频| 国产精品乱码一区二区三区软件| 91麻豆精品国产91久久久更新时间 | 视频精品一区二区| 自拍偷拍国产精品| 国产亚洲污的网站| 日韩欧美激情四射| 欧美日韩一区三区| 在线一区二区三区做爰视频网站| 国产精品一区二区三区乱码| 日韩影院免费视频| 亚洲一区二区av在线| 中文字幕欧美一区| 国产精品免费视频一区| 久久影院午夜论| 欧美大片在线观看一区二区| 欧美日韩中文国产| 欧美色图天堂网| 色老头久久综合| 91毛片在线观看| 91浏览器入口在线观看| 不卡的av电影在线观看| 成人一区二区三区视频| 国产精品一区在线观看乱码| 久久国产精品99久久久久久老狼| 日韩电影在线观看网站| 天天射综合影视| 视频在线在亚洲| 丝袜国产日韩另类美女| 日韩国产在线观看| 六月丁香综合在线视频| 韩国一区二区视频| 国产乱码精品1区2区3区| 激情另类小说区图片区视频区| 美女在线观看视频一区二区| 免费一级欧美片在线观看| 免费在线观看不卡| 国产伦精品一区二区三区免费| 国产精一区二区三区| www.色精品| 在线日韩av片| 91精品国产美女浴室洗澡无遮挡| 91精品国产一区二区三区蜜臀| 欧美一区二区三区免费| 国产亚洲精品bt天堂精选| 国产精品成人一区二区艾草 | 午夜av一区二区| 免费成人美女在线观看.| 韩国午夜理伦三级不卡影院| 国产成人免费在线视频| 色综合天天综合网天天狠天天| 欧洲av一区二区嗯嗯嗯啊| 91精品一区二区三区在线观看| 欧美成人女星排名| 国产精品久久久久永久免费观看| 玉米视频成人免费看| 日韩高清不卡在线| 大桥未久av一区二区三区中文| 色欧美88888久久久久久影院| 欧美日韩二区三区| 久久精品一区四区| 一级特黄大欧美久久久| 久久精品国产精品亚洲红杏| 成人免费av网站| 欧美日韩中文另类| 国产色婷婷亚洲99精品小说| 亚洲男人的天堂av| 久草中文综合在线| 欧美影院一区二区| 国产欧美一区二区精品忘忧草 | 狠狠色狠狠色综合日日91app| 成人一区二区三区视频| 欧美日韩高清在线播放| 国产精品视频看| 青青草伊人久久| 色综合av在线| 国产人伦精品一区二区| 亚洲成人免费电影| 99久久精品免费看| 精品福利一二区| 国产精品护士白丝一区av| 免费在线看成人av| 欧美日韩视频在线一区二区| 国产日韩av一区二区| 麻豆成人免费电影| 欧美三级一区二区| 一区视频在线播放| 国产高清精品在线| 精品国产伦一区二区三区免费 | 制服丝袜av成人在线看| 18成人在线视频| 国产成人综合自拍| 日韩欧美一二三| 五月婷婷色综合| 91久久精品一区二区三| 国产精品女同一区二区三区| 国产在线不卡一区| 日韩欧美一级在线播放| 亚洲国产精品视频| 在线观看视频一区二区| 亚洲欧美激情插| 99精品欧美一区二区三区综合在线| 久久亚洲免费视频| 毛片基地黄久久久久久天堂| 91麻豆精品国产自产在线观看一区| 亚洲综合在线观看视频| 色诱视频网站一区| 亚洲欧美偷拍卡通变态| 95精品视频在线| 亚洲色欲色欲www在线观看| 成人免费高清视频在线观看| 国产午夜精品福利| 国产成人在线视频网站| 欧美高清在线精品一区|