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

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

?? rpng2-win.c

?? A good png library for mulit-platform
?? 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一区二区三区免费野_久草精品视频
精品国免费一区二区三区| 免费成人深夜小野草| a亚洲天堂av| 国产日韩欧美精品在线| 国产成人h网站| 中文字幕一区二区三区在线观看 | 午夜私人影院久久久久| 欧美女孩性生活视频| 偷拍亚洲欧洲综合| 亚洲精品一区二区三区精华液| 久久97超碰色| 国产精品视频看| 欧洲精品一区二区三区在线观看| 午夜电影网一区| 精品国产乱码久久久久久蜜臀| 国产高清一区日本| 亚洲青青青在线视频| 在线不卡a资源高清| 国产在线观看免费一区| 亚洲欧洲精品一区二区三区 | 欧美日韩一区高清| 久久国产人妖系列| 国产精品白丝在线| 欧美日韩高清一区二区不卡 | 成人涩涩免费视频| 亚洲综合另类小说| 欧美成人国产一区二区| 成人av网址在线观看| 午夜精品福利一区二区蜜股av | 五月婷婷色综合| 久久精品一区八戒影视| 在线精品视频一区二区三四 | 香蕉成人伊视频在线观看| 欧美精品一区二区三区高清aⅴ | 无码av免费一区二区三区试看| 日韩视频在线永久播放| 99re8在线精品视频免费播放| 天天影视网天天综合色在线播放| 久久久综合网站| 91成人免费在线| 久久99国产精品久久99| 亚洲综合色视频| 国产欧美精品日韩区二区麻豆天美| 欧美在线免费观看视频| 国产98色在线|日韩| 日韩福利视频网| 亚洲三级免费观看| 国产日韩v精品一区二区| 555www色欧美视频| 91免费视频网址| 高清日韩电视剧大全免费| 日韩1区2区3区| 一区二区国产盗摄色噜噜| 精品久久久久久久久久久久包黑料 | 日韩精品一区国产麻豆| 91理论电影在线观看| 国产精品12区| 紧缚奴在线一区二区三区| 亚洲成精国产精品女| 中文字幕在线不卡国产视频| 久久影院午夜片一区| 制服丝袜日韩国产| 欧美日韩色一区| 色综合一个色综合亚洲| 成人小视频免费观看| 精品中文字幕一区二区小辣椒| 五月天久久比比资源色| 亚洲一区二区三区爽爽爽爽爽| 综合久久国产九一剧情麻豆| 国产欧美一区二区精品仙草咪| 日韩免费电影一区| 精品久久一区二区| 亚洲精品在线网站| 久久久不卡网国产精品一区| 精品国产乱码久久久久久免费 | 久久久亚洲午夜电影| 日韩精品一区二区三区四区| 91精品国产综合久久精品| 欧美伦理电影网| 欧美一区二区三区免费观看视频| 欧美日韩一二区| 777午夜精品免费视频| 91精品久久久久久蜜臀| 日韩片之四级片| 精品国产sm最大网站免费看| 久久午夜国产精品| 国产欧美日韩卡一| 综合自拍亚洲综合图不卡区| 亚洲欧美偷拍另类a∨色屁股| 亚洲综合在线五月| 午夜视频在线观看一区| 美脚の诱脚舐め脚责91| 国产精品白丝av| a4yy欧美一区二区三区| 欧美最新大片在线看| 欧美高清www午色夜在线视频| 6080日韩午夜伦伦午夜伦| 精品国精品自拍自在线| 日韩一区在线看| 亚洲成人免费影院| 激情综合网天天干| 99久久精品情趣| 欧美猛男男办公室激情| 日韩美女视频一区二区在线观看| 久久亚洲精精品中文字幕早川悠里| 久久九九久精品国产免费直播| 18欧美乱大交hd1984| 亚洲国产aⅴ成人精品无吗| 久久精品国产亚洲5555| 东方欧美亚洲色图在线| 欧美在线视频全部完| 久久综合九色综合97婷婷| 中文字幕一区二区视频| 免费成人性网站| 99热99精品| 精品奇米国产一区二区三区| 日韩一区在线播放| 美女国产一区二区| 色综合中文字幕| 久久品道一品道久久精品| 亚洲制服丝袜av| 激情欧美一区二区| 欧美午夜电影网| 国产日韩在线不卡| 午夜视频一区二区三区| 成人黄色av电影| 欧美一区二区三区视频免费播放| 国产精品毛片久久久久久| 美女网站视频久久| 欧美专区日韩专区| 国产日韩欧美激情| 免费在线观看日韩欧美| 欧美在线|欧美| 欧美国产成人精品| 激情成人午夜视频| 欧美日韩精品欧美日韩精品| 国产精品灌醉下药二区| 狠狠色狠狠色综合系列| 精品视频在线看| 综合欧美一区二区三区| 国产福利91精品一区二区三区| 在线成人午夜影院| 亚洲美女视频在线观看| 国产.欧美.日韩| ww亚洲ww在线观看国产| 日本中文字幕一区二区有限公司| 色屁屁一区二区| 国产精品看片你懂得| 国产一二精品视频| 久久女同互慰一区二区三区| 日产精品久久久久久久性色| 在线观看视频欧美| 日韩毛片精品高清免费| 国产91在线看| 久久久久久久久久久99999| 美美哒免费高清在线观看视频一区二区| 在线观看不卡一区| 亚洲综合色丁香婷婷六月图片| 91在线观看免费视频| 中文字幕不卡在线播放| 国产91丝袜在线播放九色| 精品成人佐山爱一区二区| 麻豆久久一区二区| 欧美成人性福生活免费看| 日产欧产美韩系列久久99| 欧美一区二区三区的| 日韩综合小视频| 欧美高清你懂得| 轻轻草成人在线| 精品国产区一区| 国产一二精品视频| 国产精品麻豆欧美日韩ww| 国产a级毛片一区| 国产精品电影一区二区| 97se亚洲国产综合自在线观| 国产精品入口麻豆原神| 91原创在线视频| 亚洲黄色性网站| 欧美人妖巨大在线| 久久爱www久久做| 中文字幕av资源一区| 成人免费视频视频| 亚洲精品少妇30p| 欧美日韩一级视频| 精彩视频一区二区| 国产精品国产三级国产aⅴ中文| 91在线云播放| 午夜私人影院久久久久| 欧美xxxxxxxx| 成人av在线播放网址| 亚洲高清免费观看高清完整版在线观看| 666欧美在线视频| 国产成人精品免费一区二区| 中文字幕在线一区| 欧美揉bbbbb揉bbbbb| 美女视频黄久久| 国产精品拍天天在线| 欧美三级午夜理伦三级中视频| 免费观看30秒视频久久| 亚洲国产高清在线观看视频|