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

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

?? writepng.c

?? openmeetings組件之GS openmeetings組件之GS openmeetings組件之GS
?? C
字號:
/*---------------------------------------------------------------------------   wpng - simple PNG-writing program                             writepng.c  ---------------------------------------------------------------------------      Copyright (c) 1998-2007 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.      The contents of this file are DUAL-LICENSED.  You may modify and/or      redistribute this software according to the terms of one of the      following two licenses (at your option):      LICENSE 1 ("BSD-like with advertising clause"):      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.      LICENSE 2 (GNU GPL v2 or later):      This program is free software; you can redistribute it and/or modify      it under the terms of the GNU General Public License as published by      the Free Software Foundation; either version 2 of the License, or      (at your option) any later version.      This program is distributed in the hope that it will be useful,      but WITHOUT ANY WARRANTY; without even the implied warranty of      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      GNU General Public License for more details.      You should have received a copy of the GNU General Public License      along with this program; if not, write to the Free Software Foundation,      Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  ---------------------------------------------------------------------------*/#include <stdlib.h>     /* for exit() prototype */#include "png.h"        /* libpng header; includes zlib.h and setjmp.h */#include "writepng.h"   /* typedefs, common macros, public prototypes *//* local prototype */static void writepng_error_handler(png_structp png_ptr, png_const_charp msg);void writepng_version_info(void){  fprintf(stderr, "   Compiled with libpng %s; using libpng %s.\n",    PNG_LIBPNG_VER_STRING, png_libpng_ver);  fprintf(stderr, "   Compiled with zlib %s; using zlib %s.\n",    ZLIB_VERSION, zlib_version);}/* returns 0 for success, 2 for libpng problem, 4 for out of memory, 11 for *  unexpected pnmtype; note that outfile might be stdout */int writepng_init(mainprog_info *mainprog_ptr){    png_structp  png_ptr;       /* note:  temporary variables! */    png_infop  info_ptr;    int color_type, interlace_type;    /* could also replace libpng warning-handler (final NULL), but no need: */    png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, mainprog_ptr,      writepng_error_handler, NULL);    if (!png_ptr)        return 4;   /* out of memory */    info_ptr = png_create_info_struct(png_ptr);    if (!info_ptr) {        png_destroy_write_struct(&png_ptr, NULL);        return 4;   /* out of memory */    }    /* setjmp() must be called in every function that calls a PNG-writing     * libpng function, unless an alternate error handler was installed--     * but compatible error handlers must either use longjmp() themselves     * (as in this program) or exit immediately, so here we go: */    if (setjmp(mainprog_ptr->jmpbuf)) {        png_destroy_write_struct(&png_ptr, &info_ptr);        return 2;    }    /* make sure outfile is (re)opened in BINARY mode */    png_init_io(png_ptr, mainprog_ptr->outfile);    /* set the compression levels--in general, always want to leave filtering     * turned on (except for palette images) and allow all of the filters,     * which is the default; want 32K zlib window, unless entire image buffer     * is 16K or smaller (unknown here)--also the default; usually want max     * compression (NOT the default); and remaining compression flags should     * be left alone */    png_set_compression_level(png_ptr, Z_BEST_COMPRESSION);/*    >> this is default for no filtering; Z_FILTERED is default otherwise:    png_set_compression_strategy(png_ptr, Z_DEFAULT_STRATEGY);    >> these are all defaults:    png_set_compression_mem_level(png_ptr, 8);    png_set_compression_window_bits(png_ptr, 15);    png_set_compression_method(png_ptr, 8); */    /* set the image parameters appropriately */    if (mainprog_ptr->pnmtype == 5)        color_type = PNG_COLOR_TYPE_GRAY;    else if (mainprog_ptr->pnmtype == 6)        color_type = PNG_COLOR_TYPE_RGB;    else if (mainprog_ptr->pnmtype == 8)        color_type = PNG_COLOR_TYPE_RGB_ALPHA;    else {        png_destroy_write_struct(&png_ptr, &info_ptr);        return 11;    }    interlace_type = mainprog_ptr->interlaced? PNG_INTERLACE_ADAM7 :                                               PNG_INTERLACE_NONE;    png_set_IHDR(png_ptr, info_ptr, mainprog_ptr->width, mainprog_ptr->height,      mainprog_ptr->sample_depth, color_type, interlace_type,      PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);    if (mainprog_ptr->gamma > 0.0)        png_set_gAMA(png_ptr, info_ptr, mainprog_ptr->gamma);    if (mainprog_ptr->have_bg) {   /* we know it's RGBA, not gray+alpha */        png_color_16  background;        background.red = mainprog_ptr->bg_red;        background.green = mainprog_ptr->bg_green;        background.blue = mainprog_ptr->bg_blue;        png_set_bKGD(png_ptr, info_ptr, &background);    }    if (mainprog_ptr->have_time) {        png_time  modtime;        png_convert_from_time_t(&modtime, mainprog_ptr->modtime);        png_set_tIME(png_ptr, info_ptr, &modtime);    }    if (mainprog_ptr->have_text) {        png_text  text[6];        int  num_text = 0;        if (mainprog_ptr->have_text & TEXT_TITLE) {            text[num_text].compression = PNG_TEXT_COMPRESSION_NONE;            text[num_text].key = "Title";            text[num_text].text = mainprog_ptr->title;            ++num_text;        }        if (mainprog_ptr->have_text & TEXT_AUTHOR) {            text[num_text].compression = PNG_TEXT_COMPRESSION_NONE;            text[num_text].key = "Author";            text[num_text].text = mainprog_ptr->author;            ++num_text;        }        if (mainprog_ptr->have_text & TEXT_DESC) {            text[num_text].compression = PNG_TEXT_COMPRESSION_NONE;            text[num_text].key = "Description";            text[num_text].text = mainprog_ptr->desc;            ++num_text;        }        if (mainprog_ptr->have_text & TEXT_COPY) {            text[num_text].compression = PNG_TEXT_COMPRESSION_NONE;            text[num_text].key = "Copyright";            text[num_text].text = mainprog_ptr->copyright;            ++num_text;        }        if (mainprog_ptr->have_text & TEXT_EMAIL) {            text[num_text].compression = PNG_TEXT_COMPRESSION_NONE;            text[num_text].key = "E-mail";            text[num_text].text = mainprog_ptr->email;            ++num_text;        }        if (mainprog_ptr->have_text & TEXT_URL) {            text[num_text].compression = PNG_TEXT_COMPRESSION_NONE;            text[num_text].key = "URL";            text[num_text].text = mainprog_ptr->url;            ++num_text;        }        png_set_text(png_ptr, info_ptr, text, num_text);    }    /* write all chunks up to (but not including) first IDAT */    png_write_info(png_ptr, info_ptr);    /* if we wanted to write any more text info *after* the image data, we     * would set up text struct(s) here and call png_set_text() again, with     * just the new data; png_set_tIME() could also go here, but it would     * have no effect since we already called it above (only one tIME chunk     * allowed) */    /* set up the transformations:  for now, just pack low-bit-depth pixels     * into bytes (one, two or four pixels per byte) */    png_set_packing(png_ptr);/*  png_set_shift(png_ptr, &sig_bit);  to scale low-bit-depth values */    /* make sure we save our pointers for use in writepng_encode_image() */    mainprog_ptr->png_ptr = png_ptr;    mainprog_ptr->info_ptr = info_ptr;    /* OK, that's all we need to do for now; return happy */    return 0;}/* returns 0 for success, 2 for libpng (longjmp) problem */int writepng_encode_image(mainprog_info *mainprog_ptr){    png_structp png_ptr = (png_structp)mainprog_ptr->png_ptr;    png_infop info_ptr = (png_infop)mainprog_ptr->info_ptr;    /* as always, setjmp() must be called in every function that calls a     * PNG-writing libpng function */    if (setjmp(mainprog_ptr->jmpbuf)) {        png_destroy_write_struct(&png_ptr, &info_ptr);        mainprog_ptr->png_ptr = NULL;        mainprog_ptr->info_ptr = NULL;        return 2;    }    /* and now we just write the whole image; libpng takes care of interlacing     * for us */    png_write_image(png_ptr, mainprog_ptr->row_pointers);    /* since that's it, we also close out the end of the PNG file now--if we     * had any text or time info to write after the IDATs, second argument     * would be info_ptr, but we optimize slightly by sending NULL pointer: */    png_write_end(png_ptr, NULL);    return 0;}/* returns 0 if succeeds, 2 if libpng problem */int writepng_encode_row(mainprog_info *mainprog_ptr)  /* NON-interlaced only! */{    png_structp png_ptr = (png_structp)mainprog_ptr->png_ptr;    png_infop info_ptr = (png_infop)mainprog_ptr->info_ptr;    /* as always, setjmp() must be called in every function that calls a     * PNG-writing libpng function */    if (setjmp(mainprog_ptr->jmpbuf)) {        png_destroy_write_struct(&png_ptr, &info_ptr);        mainprog_ptr->png_ptr = NULL;        mainprog_ptr->info_ptr = NULL;        return 2;    }    /* image_data points at our one row of image data */    png_write_row(png_ptr, mainprog_ptr->image_data);    return 0;}/* returns 0 if succeeds, 2 if libpng problem */int writepng_encode_finish(mainprog_info *mainprog_ptr)   /* NON-interlaced! */{    png_structp png_ptr = (png_structp)mainprog_ptr->png_ptr;    png_infop info_ptr = (png_infop)mainprog_ptr->info_ptr;    /* as always, setjmp() must be called in every function that calls a     * PNG-writing libpng function */    if (setjmp(mainprog_ptr->jmpbuf)) {        png_destroy_write_struct(&png_ptr, &info_ptr);        mainprog_ptr->png_ptr = NULL;        mainprog_ptr->info_ptr = NULL;        return 2;    }    /* close out PNG file; if we had any text or time info to write after     * the IDATs, second argument would be info_ptr: */    png_write_end(png_ptr, NULL);    return 0;}void writepng_cleanup(mainprog_info *mainprog_ptr){    png_structp png_ptr = (png_structp)mainprog_ptr->png_ptr;    png_infop info_ptr = (png_infop)mainprog_ptr->info_ptr;    if (png_ptr && info_ptr)        png_destroy_write_struct(&png_ptr, &info_ptr);}static void writepng_error_handler(png_structp png_ptr, png_const_charp msg){    mainprog_info  *mainprog_ptr;    /* This function, aside from the extra step of retrieving the "error     * pointer" (below) and the fact that it exists within the application     * rather than within libpng, is essentially identical to libpng's     * default error handler.  The second point is critical:  since both     * setjmp() and longjmp() are called from the same code, they are     * guaranteed to have compatible notions of how big a jmp_buf is,     * regardless of whether _BSD_SOURCE or anything else has (or has not)     * been defined. */    fprintf(stderr, "writepng libpng error: %s\n", msg);    fflush(stderr);    mainprog_ptr = png_get_error_ptr(png_ptr);    if (mainprog_ptr == NULL) {         /* we are completely hosed now */        fprintf(stderr,          "writepng severe error:  jmpbuf not recoverable; terminating.\n");        fflush(stderr);        exit(99);    }    longjmp(mainprog_ptr->jmpbuf, 1);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一级片在线观看| 久久久99精品久久| www.亚洲人| 东方aⅴ免费观看久久av| 久久精品国产一区二区三 | 欧美国产一区在线| 欧美国产精品一区二区| 久久久亚洲综合| 国产精品网站在线观看| 久久精品欧美日韩| 1区2区3区国产精品| 亚洲免费观看高清完整版在线| 国产精品国产三级国产三级人妇| 日本一区二区三级电影在线观看| 国产精品美女久久久久久久久久久 | 91麻豆精品视频| 一本一道久久a久久精品综合蜜臀| 99精品久久久久久| 欧洲视频一区二区| 欧美精品乱码久久久久久| 欧美电影在线免费观看| 精品福利在线导航| 国产精品传媒视频| 亚洲国产精品久久久久婷婷884 | 亚洲男人都懂的| 肉肉av福利一精品导航| 韩国中文字幕2020精品| 成人激情动漫在线观看| 一本到不卡精品视频在线观看| 制服.丝袜.亚洲.中文.综合| 久久色视频免费观看| 亚洲美女视频在线| 日本视频中文字幕一区二区三区| 国内外精品视频| 在线免费亚洲电影| 久久综合九色综合久久久精品综合| 中文字幕一区二区在线观看| 亚洲一区在线观看视频| 国产精品99久久久| 欧美日韩国产小视频在线观看| 国产亚洲美州欧州综合国| 亚洲成人免费看| 成人精品鲁一区一区二区| 欧美人妇做爰xxxⅹ性高电影| 久久久91精品国产一区二区三区| 亚洲一区二三区| 成人性视频网站| 欧美成人激情免费网| 一区二区三区在线视频免费观看 | 国产精品理伦片| 天使萌一区二区三区免费观看| 国产成人免费av在线| 欧美高清视频不卡网| 亚洲激情网站免费观看| 国产大陆a不卡| 精品av久久707| 视频一区二区欧美| 色婷婷亚洲精品| 亚洲欧洲www| 成人免费视频一区| 国产欧美视频在线观看| 加勒比av一区二区| 精品国产第一区二区三区观看体验 | 欧美综合视频在线观看| 国产精品美女久久久久久久久久久| 国产在线播放一区| 日韩精品一区二区三区三区免费 | 中文字幕综合网| 国产成人夜色高潮福利影视| 欧美成人vr18sexvr| 久久精品噜噜噜成人88aⅴ| 7777女厕盗摄久久久| 亚洲曰韩产成在线| 欧美日本一区二区在线观看| 亚洲成av人片在线观看| 欧美日韩不卡一区| 日本va欧美va瓶| 欧美大片日本大片免费观看| 免费成人在线观看| 欧美大片在线观看一区二区| 毛片av一区二区三区| 精品精品国产高清a毛片牛牛| 免费观看30秒视频久久| 久久久久国产一区二区三区四区 | 国产成人精品免费在线| 国产人久久人人人人爽| 国产91精品在线观看| 国产精品国产三级国产有无不卡| 欧美精品三级日韩久久| 日本aⅴ精品一区二区三区| 日韩欧美一区二区视频| 国产激情视频一区二区三区欧美 | 色噜噜久久综合| 亚洲成人av电影| 6080亚洲精品一区二区| 九一九一国产精品| 国产精品视频看| 欧美三级日韩在线| 久久福利资源站| 国产精品高潮呻吟| 欧美日韩精品一区二区三区蜜桃 | 91久久精品一区二区二区| 亚洲电影在线播放| 51精品秘密在线观看| 国产一区 二区| 亚洲欧美日韩国产一区二区三区 | 日韩福利电影在线| 久久综合狠狠综合久久综合88 | 国产乱妇无码大片在线观看| 1区2区3区欧美| 精品国免费一区二区三区| 91在线视频在线| 美女视频第一区二区三区免费观看网站| 国产三级一区二区| 欧美日韩一区二区三区四区| 国产精品白丝jk白祙喷水网站| 亚洲综合色网站| 国产三级欧美三级日产三级99| 欧美性xxxxxx少妇| 成人免费观看视频| 免费一区二区视频| 一区二区日韩电影| 国产精品久久午夜| 久久久五月婷婷| 777午夜精品视频在线播放| 本田岬高潮一区二区三区| 免费高清视频精品| 亚洲综合在线免费观看| 亚洲国产成人一区二区三区| 欧美一区二区不卡视频| 欧美影视一区在线| 波多野结衣91| 国产精品一二三四五| 裸体在线国模精品偷拍| 亚洲综合一区二区三区| 国产精品色呦呦| 久久噜噜亚洲综合| 精品捆绑美女sm三区| 日韩一区二区三区av| 色婷婷国产精品| 91小视频在线免费看| 99久久99久久精品免费看蜜桃| 国产主播一区二区三区| 精品在线一区二区| 久久激情综合网| 久久精品99国产精品| 理论电影国产精品| 精品中文字幕一区二区小辣椒| 美国毛片一区二区| 久久精品国产精品亚洲综合| 久久精工是国产品牌吗| 国产一区二区精品久久| 国模少妇一区二区三区| 激情亚洲综合在线| 国产真实精品久久二三区| 免费国产亚洲视频| 九色|91porny| 国产98色在线|日韩| 岛国一区二区三区| 成人激情小说乱人伦| 91香蕉视频污在线| 欧美亚洲高清一区| 91精品视频网| 久久综合狠狠综合久久激情| 久久久精品国产99久久精品芒果| 国产精品免费久久| 亚洲综合色噜噜狠狠| 日韩激情视频网站| 精品午夜久久福利影院| 丰满放荡岳乱妇91ww| 91婷婷韩国欧美一区二区| 欧美色国产精品| 日韩欧美国产午夜精品| 一区二区三区四区中文字幕| 亚洲国产综合在线| 日av在线不卡| 岛国一区二区在线观看| 欧美色图一区二区三区| 日韩欧美中文字幕一区| 国产日韩亚洲欧美综合| 亚洲国产另类av| 国产在线精品一区二区| 一本到不卡免费一区二区| 日韩视频在线永久播放| 国产精品超碰97尤物18| 亚洲国产精品久久不卡毛片| 精品午夜久久福利影院| 色菇凉天天综合网| 2021中文字幕一区亚洲| 亚洲最大成人综合| 国产又黄又大久久| 欧美午夜精品一区二区三区| 欧美mv和日韩mv的网站| 亚洲精品日韩综合观看成人91| 激情文学综合插| 在线观看网站黄不卡| 欧美激情在线免费观看| 免费观看成人鲁鲁鲁鲁鲁视频| 99精品国产视频| 久久蜜桃av一区精品变态类天堂|