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

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

?? tif_open.c

?? 支持各種柵格圖像和矢量圖像讀取的庫
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* $Id: tif_open.c,v 1.33 2006/06/08 14:27:17 dron Exp $ *//* * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * * Permission to use, copy, modify, distribute, and sell this software and  * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. *  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.   *  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE  * OF THIS SOFTWARE. *//* * TIFF Library. */#include "tiffiop.h"static const long typemask[13] = {	(long)0L,		/* TIFF_NOTYPE */	(long)0x000000ffL,	/* TIFF_BYTE */	(long)0xffffffffL,	/* TIFF_ASCII */	(long)0x0000ffffL,	/* TIFF_SHORT */	(long)0xffffffffL,	/* TIFF_LONG */	(long)0xffffffffL,	/* TIFF_RATIONAL */	(long)0x000000ffL,	/* TIFF_SBYTE */	(long)0x000000ffL,	/* TIFF_UNDEFINED */	(long)0x0000ffffL,	/* TIFF_SSHORT */	(long)0xffffffffL,	/* TIFF_SLONG */	(long)0xffffffffL,	/* TIFF_SRATIONAL */	(long)0xffffffffL,	/* TIFF_FLOAT */	(long)0xffffffffL,	/* TIFF_DOUBLE */};static const int bigTypeshift[13] = {	0,		/* TIFF_NOTYPE */	24,		/* TIFF_BYTE */	0,		/* TIFF_ASCII */	16,		/* TIFF_SHORT */	0,		/* TIFF_LONG */	0,		/* TIFF_RATIONAL */	24,		/* TIFF_SBYTE */	24,		/* TIFF_UNDEFINED */	16,		/* TIFF_SSHORT */	0,		/* TIFF_SLONG */	0,		/* TIFF_SRATIONAL */	0,		/* TIFF_FLOAT */	0,		/* TIFF_DOUBLE */};static const int litTypeshift[13] = {	0,		/* TIFF_NOTYPE */	0,		/* TIFF_BYTE */	0,		/* TIFF_ASCII */	0,		/* TIFF_SHORT */	0,		/* TIFF_LONG */	0,		/* TIFF_RATIONAL */	0,		/* TIFF_SBYTE */	0,		/* TIFF_UNDEFINED */	0,		/* TIFF_SSHORT */	0,		/* TIFF_SLONG */	0,		/* TIFF_SRATIONAL */	0,		/* TIFF_FLOAT */	0,		/* TIFF_DOUBLE */};/* * Dummy functions to fill the omitted client procedures. */static int_tiffDummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize){	(void) fd; (void) pbase; (void) psize;	return (0);}static void_tiffDummyUnmapProc(thandle_t fd, tdata_t base, toff_t size){	(void) fd; (void) base; (void) size;}/* * Initialize the shift & mask tables, and the * byte swapping state according to the file * contents and the machine architecture. */static voidTIFFInitOrder(TIFF* tif, int magic){	tif->tif_typemask = typemask;	if (magic == TIFF_BIGENDIAN) {		tif->tif_typeshift = bigTypeshift;#ifndef WORDS_BIGENDIAN		tif->tif_flags |= TIFF_SWAB;#endif	} else {		tif->tif_typeshift = litTypeshift;#ifdef WORDS_BIGENDIAN		tif->tif_flags |= TIFF_SWAB;#endif	}}int_TIFFgetMode(const char* mode, const char* module){	int m = -1;	switch (mode[0]) {	case 'r':		m = O_RDONLY;		if (mode[1] == '+')			m = O_RDWR;		break;	case 'w':	case 'a':		m = O_RDWR|O_CREAT;		if (mode[0] == 'w')			m |= O_TRUNC;		break;	default:		TIFFErrorExt(0, module, "\"%s\": Bad mode", mode);		break;	}	return (m);}TIFF*TIFFClientOpen(	const char* name, const char* mode,	thandle_t clientdata,	TIFFReadWriteProc readproc,	TIFFReadWriteProc writeproc,	TIFFSeekProc seekproc,	TIFFCloseProc closeproc,	TIFFSizeProc sizeproc,	TIFFMapFileProc mapproc,	TIFFUnmapFileProc unmapproc){	static const char module[] = "TIFFClientOpen";	TIFF *tif;	int m;	const char* cp;	m = _TIFFgetMode(mode, module);	if (m == -1)		goto bad2;	tif = (TIFF *)_TIFFmalloc(sizeof (TIFF) + strlen(name) + 1);	if (tif == NULL) {		TIFFErrorExt(clientdata, module, "%s: Out of memory (TIFF structure)", name);		goto bad2;	}	_TIFFmemset(tif, 0, sizeof (*tif));	tif->tif_name = (char *)tif + sizeof (TIFF);	strcpy(tif->tif_name, name);	tif->tif_mode = m &~ (O_CREAT|O_TRUNC);	tif->tif_curdir = (tdir_t) -1;		/* non-existent directory */	tif->tif_curoff = 0;	tif->tif_curstrip = (tstrip_t) -1;	/* invalid strip */	tif->tif_row = (uint32) -1;		/* read/write pre-increment */	tif->tif_clientdata = clientdata;	if (!readproc || !writeproc || !seekproc || !closeproc || !sizeproc) {		TIFFErrorExt(clientdata, module,			  "One of the client procedures is NULL pointer.");		goto bad2;	}	tif->tif_readproc = readproc;	tif->tif_writeproc = writeproc;	tif->tif_seekproc = seekproc;	tif->tif_closeproc = closeproc;	tif->tif_sizeproc = sizeproc;        if (mapproc)		tif->tif_mapproc = mapproc;	else		tif->tif_mapproc = _tiffDummyMapProc;	if (unmapproc)		tif->tif_unmapproc = unmapproc;	else		tif->tif_unmapproc = _tiffDummyUnmapProc;	_TIFFSetDefaultCompressionState(tif);	/* setup default state */	/*	 * Default is to return data MSB2LSB and enable the	 * use of memory-mapped files and strip chopping when	 * a file is opened read-only.	 */	tif->tif_flags = FILLORDER_MSB2LSB;	if (m == O_RDONLY )		tif->tif_flags |= TIFF_MAPPED;#ifdef STRIPCHOP_DEFAULT	if (m == O_RDONLY || m == O_RDWR)		tif->tif_flags |= STRIPCHOP_DEFAULT;#endif	/*	 * Process library-specific flags in the open mode string.	 * The following flags may be used to control intrinsic library	 * behaviour that may or may not be desirable (usually for	 * compatibility with some application that claims to support	 * TIFF but only supports some braindead idea of what the	 * vendor thinks TIFF is):	 *	 * 'l'		use little-endian byte order for creating a file	 * 'b'		use big-endian byte order for creating a file	 * 'L'		read/write information using LSB2MSB bit order	 * 'B'		read/write information using MSB2LSB bit order	 * 'H'		read/write information using host bit order	 * 'M'		enable use of memory-mapped files when supported	 * 'm'		disable use of memory-mapped files	 * 'C'		enable strip chopping support when reading	 * 'c'		disable strip chopping support	 * 'h'		read TIFF header only, do not load the first IFD	 *	 * The use of the 'l' and 'b' flags is strongly discouraged.	 * These flags are provided solely because numerous vendors,	 * typically on the PC, do not correctly support TIFF; they	 * only support the Intel little-endian byte order.  This	 * support is not configured by default because it supports	 * the violation of the TIFF spec that says that readers *MUST*	 * support both byte orders.  It is strongly recommended that	 * you not use this feature except to deal with busted apps	 * that write invalid TIFF.  And even in those cases you should	 * bang on the vendors to fix their software.	 *	 * The 'L', 'B', and 'H' flags are intended for applications	 * that can optimize operations on data by using a particular	 * bit order.  By default the library returns data in MSB2LSB	 * bit order for compatibiltiy with older versions of this	 * library.  Returning data in the bit order of the native cpu	 * makes the most sense but also requires applications to check	 * the value of the FillOrder tag; something they probably do	 * not do right now.	 *	 * The 'M' and 'm' flags are provided because some virtual memory	 * systems exhibit poor behaviour when large images are mapped.	 * These options permit clients to control the use of memory-mapped	 * files on a per-file basis.	 *	 * The 'C' and 'c' flags are provided because the library support	 * for chopping up large strips into multiple smaller strips is not	 * application-transparent and as such can cause problems.  The 'c'	 * option permits applications that only want to look at the tags,	 * for example, to get the unadulterated TIFF tag information.	 */	for (cp = mode; *cp; cp++)		switch (*cp) {		case 'b':#ifndef WORDS_BIGENDIAN		    if (m&O_CREAT)				tif->tif_flags |= TIFF_SWAB;#endif			break;		case 'l':#ifdef WORDS_BIGENDIAN			if ((m&O_CREAT))				tif->tif_flags |= TIFF_SWAB;#endif			break;		case 'B':			tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |			    FILLORDER_MSB2LSB;			break;		case 'L':			tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |			    FILLORDER_LSB2MSB;			break;		case 'H':			tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |			    HOST_FILLORDER;			break;		case 'M':			if (m == O_RDONLY)				tif->tif_flags |= TIFF_MAPPED;			break;		case 'm':			if (m == O_RDONLY)				tif->tif_flags &= ~TIFF_MAPPED;			break;		case 'C':			if (m == O_RDONLY)				tif->tif_flags |= TIFF_STRIPCHOP;			break;		case 'c':			if (m == O_RDONLY)				tif->tif_flags &= ~TIFF_STRIPCHOP;			break;		case 'h':			tif->tif_flags |= TIFF_HEADERONLY;			break;		}	/*	 * Read in TIFF header.	 */	if (tif->tif_mode & O_TRUNC ||	    !ReadOK(tif, &tif->tif_header, sizeof (TIFFHeader))) {		if (tif->tif_mode == O_RDONLY) {			TIFFErrorExt(tif->tif_clientdata, name,				     "Cannot read TIFF header");			goto bad;		}		/*		 * Setup header and write.		 */#ifdef WORDS_BIGENDIAN		tif->tif_header.tiff_magic = tif->tif_flags & TIFF_SWAB		    ? TIFF_LITTLEENDIAN : TIFF_BIGENDIAN;#else		tif->tif_header.tiff_magic = tif->tif_flags & TIFF_SWAB		    ? TIFF_BIGENDIAN : TIFF_LITTLEENDIAN;#endif		tif->tif_header.tiff_version = TIFF_VERSION;		if (tif->tif_flags & TIFF_SWAB)			TIFFSwabShort(&tif->tif_header.tiff_version);		tif->tif_header.tiff_diroff = 0;	/* filled in later */                /*                 * The doc for "fopen" for some STD_C_LIBs says that if you                  * open a file for modify ("+"), then you must fseek (or                  * fflush?) between any freads and fwrites.  This is not                 * necessary on most systems, but has been shown to be needed                 * on Solaris.                  */                TIFFSeekFile( tif, 0, SEEK_SET );               		if (!WriteOK(tif, &tif->tif_header, sizeof (TIFFHeader))) {			TIFFErrorExt(tif->tif_clientdata, name,				     "Error writing TIFF header");			goto bad;		}		/*		 * Setup the byte order handling.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲人成伊人成综合网小说| 国产伦精品一区二区三区视频青涩 | 欧美日韩在线精品一区二区三区激情| 欧美军同video69gay| 国产欧美日韩综合| 婷婷国产在线综合| 91丨porny丨最新| 精品国产一区二区三区忘忧草 | 成人av电影在线网| 欧美喷潮久久久xxxxx| 国产日韩综合av| 七七婷婷婷婷精品国产| 91国产成人在线| 国产精品婷婷午夜在线观看| 久久精品理论片| 欧美性大战久久久久久久蜜臀 | 日韩专区一卡二卡| 成人av动漫网站| 国产亚洲福利社区一区| 蜜桃一区二区三区在线| 欧美日韩在线综合| 亚洲最色的网站| 91在线观看地址| 18涩涩午夜精品.www| 成人免费视频一区二区| 久久亚洲综合色| 国内不卡的二区三区中文字幕| 欧美浪妇xxxx高跟鞋交| 亚洲线精品一区二区三区八戒| 日本高清不卡一区| 亚洲自拍偷拍欧美| 欧洲亚洲精品在线| 亚洲女同女同女同女同女同69| fc2成人免费人成在线观看播放 | a级精品国产片在线观看| 国产午夜精品一区二区三区视频| 国产美女一区二区三区| 久久久影视传媒| 国产成人av影院| 国产精品免费免费| 99久久99久久精品免费观看| 国产精品欧美一级免费| 不卡一区二区三区四区| **性色生活片久久毛片| 91国偷自产一区二区使用方法| 亚洲同性gay激情无套| 99re热视频这里只精品| 一区二区三区鲁丝不卡| 欧美私模裸体表演在线观看| 香蕉成人伊视频在线观看| 欧美一区二区三区免费| 日本不卡一区二区三区| 欧美精品一区二区三区蜜桃| 成人午夜电影网站| 一区二区激情小说| 337p亚洲精品色噜噜噜| 国内一区二区在线| 亚洲乱码中文字幕综合| 91精品国产丝袜白色高跟鞋| 风间由美一区二区三区在线观看 | 99re这里只有精品6| 亚洲一区在线看| 亚洲精品一区二区三区精华液 | 一区二区三区四区精品在线视频| 欧美制服丝袜第一页| 久久精品久久综合| 欧美国产亚洲另类动漫| 欧美日韩国产另类一区| 精品一区中文字幕| 综合久久国产九一剧情麻豆| 日韩一区二区三区视频在线观看 | 蜜臀av一区二区| 国产精品萝li| 日韩三级精品电影久久久| 高清在线不卡av| 青青青爽久久午夜综合久久午夜 | 久久久久久9999| 欧美日韩在线直播| 国产毛片精品国产一区二区三区| 日韩理论在线观看| 亚洲精品一区二区三区四区高清| 色婷婷av一区二区三区大白胸| 久久激情五月婷婷| 亚洲一区日韩精品中文字幕| 久久久国产精品午夜一区ai换脸| 欧美日韩一级二级| 91麻豆蜜桃一区二区三区| 精彩视频一区二区| 午夜视频一区二区三区| 亚洲日韩欧美一区二区在线| 精品电影一区二区| 欧美精品777| 欧美亚洲国产一区在线观看网站 | 国产精品家庭影院| 久久伊人蜜桃av一区二区| 欧美午夜寂寞影院| 91同城在线观看| 成人免费看的视频| 国模无码大尺度一区二区三区 | 亚洲午夜久久久久中文字幕久| 久久久久久97三级| 久久久久久久久99精品| 精品国产一区二区三区忘忧草| 欧美日韩国产123区| 欧美综合一区二区| 99国产精品久久久久| 成人免费视频一区| 不卡的av中国片| 成人黄色在线看| jlzzjlzz欧美大全| www.亚洲色图| 99久久99久久精品免费观看| 91小视频免费观看| 91在线视频播放地址| 国产91精品精华液一区二区三区 | 韩国毛片一区二区三区| 精品亚洲国内自在自线福利| 久久精品国产久精国产爱| 麻豆精品一区二区三区| 蜜臀av国产精品久久久久| 久久精品国产第一区二区三区| 麻豆一区二区三| 久久精品国产亚洲5555| 国产一区二区三区观看| 成人午夜激情片| av电影一区二区| 在线观看精品一区| 欧美日免费三级在线| 日韩午夜精品电影| 精品成人私密视频| 国产日韩av一区| 亚洲男人的天堂一区二区| 亚洲午夜久久久久中文字幕久| 午夜不卡av在线| 国产一区视频在线看| 成人99免费视频| 欧美三级在线视频| 2021中文字幕一区亚洲| 国产精品久久久久aaaa樱花| 亚洲男同性视频| 麻豆精品一区二区三区| 风间由美中文字幕在线看视频国产欧美| www.99精品| 6080亚洲精品一区二区| 国产亚洲一区字幕| 亚洲激情图片小说视频| 免费看黄色91| 99re这里只有精品视频首页| 在线观看91av| 国产精品视频看| 婷婷久久综合九色综合绿巨人| 国产成人小视频| 欧美福利视频一区| 国产日韩欧美精品电影三级在线 | 国产一区在线精品| 欧美亚洲禁片免费| 久久精品夜色噜噜亚洲a∨| 一区二区视频免费在线观看| 久久99九九99精品| 色成年激情久久综合| ww亚洲ww在线观看国产| 亚洲综合色丁香婷婷六月图片| 国产老肥熟一区二区三区| 在线精品视频小说1| 欧美国产乱子伦| 日韩精品欧美精品| 99国内精品久久| 国产午夜三级一区二区三| 日韩av电影一区| 色偷偷成人一区二区三区91| 久久九九影视网| 日韩精品视频网| 色成人在线视频| 一色屋精品亚洲香蕉网站| 日本在线不卡视频| 色婷婷综合五月| 国产精品久久久久三级| 精品一区二区三区欧美| 欧美三级中文字| 一区二区三区鲁丝不卡| 暴力调教一区二区三区| 国产人久久人人人人爽| 久久99九九99精品| 日韩一区二区在线看| 亚洲第一久久影院| 在线免费观看不卡av| 亚洲精品亚洲人成人网| caoporm超碰国产精品| 欧美国产日本韩| 国产99久久精品| 欧美高清一级片在线观看| 韩国欧美国产一区| 亚洲精品一区二区三区蜜桃下载| 免费高清不卡av| 日韩欧美国产精品一区| 美美哒免费高清在线观看视频一区二区 | 五月婷婷另类国产| 欧美色网站导航| 亚洲国产cao| 欧美日精品一区视频|