亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日韩美女啊v在线免费观看| 午夜视黄欧洲亚洲| 欧美日韩三级在线| 豆国产96在线|亚洲| 日韩在线a电影| 亚洲免费观看高清完整版在线观看| 91精品国产高清一区二区三区蜜臀 | 91国产精品成人| 国产真实乱子伦精品视频| 亚洲一区二区视频在线观看| 国产亚洲自拍一区| 日韩丝袜美女视频| 日韩av在线播放中文字幕| 国产精品久久99| 2023国产一二三区日本精品2022| 欧美日韩极品在线观看一区| 不卡av在线免费观看| 国产精品综合视频| 久久成人免费网| 五月综合激情日本mⅴ| 亚洲欧美日韩国产一区二区三区| 精品国产1区二区| 欧美一区二区视频在线观看2022| 色综合咪咪久久| 99久久精品久久久久久清纯| 岛国一区二区三区| 国产一区亚洲一区| 久久国产日韩欧美精品| 奇米色一区二区| 日韩精品1区2区3区| 亚洲一本大道在线| 综合亚洲深深色噜噜狠狠网站| 国产清纯白嫩初高生在线观看91 | 色中色一区二区| av不卡在线观看| 国产福利一区二区三区| 国产乱子伦一区二区三区国色天香 | 亚洲欧洲日韩在线| 国产精品麻豆一区二区| 国产欧美日韩精品一区| 国产亚洲欧美日韩日本| 2021中文字幕一区亚洲| 久久精品一区二区三区四区| 久久五月婷婷丁香社区| 国产日韩欧美激情| 国产欧美一区二区精品性色| 欧美激情综合在线| 1区2区3区精品视频| 亚洲精选视频在线| 亚洲一卡二卡三卡四卡五卡| 亚洲成a人片在线不卡一二三区| 亚洲成人手机在线| 免费日韩伦理电影| 国产一区二区三区av电影| 国产成人在线网站| 亚洲成人自拍网| 日韩国产欧美在线观看| 精品一区二区在线播放| 国产成人午夜片在线观看高清观看| 国产呦精品一区二区三区网站| 中文字幕亚洲欧美在线不卡| 一区二区高清在线| 七七婷婷婷婷精品国产| 国产福利一区二区三区视频 | 日韩欧美一级片| 久久精品视频免费| 亚洲三级视频在线观看| 午夜精品久久久久久久99水蜜桃| 全国精品久久少妇| 成人avav影音| 欧美日韩aaaaa| 一区二区三区高清在线| 亚洲欧美成人一区二区三区| 国产色综合久久| 国产精品综合网| av电影天堂一区二区在线观看| 色狠狠桃花综合| 欧美一级视频精品观看| 久久久精品tv| 一区二区成人在线| 国产一区二区在线观看视频| 91麻豆6部合集magnet| 精品视频免费在线| 久久久99精品久久| 亚洲一线二线三线久久久| 午夜精品久久久久久久99水蜜桃| 国产一区二区三区在线看麻豆| 不卡的电影网站| 91精品在线麻豆| 国产精品女主播在线观看| 亚洲va欧美va天堂v国产综合| 国产乱码字幕精品高清av| 色噜噜狠狠一区二区三区果冻| 日韩精品中文字幕一区二区三区 | 欧美一卡2卡3卡4卡| 国产午夜精品一区二区 | 国产成人综合在线播放| 色诱视频网站一区| 精品国产三级a在线观看| 一区二区三区四区不卡在线 | 91片黄在线观看| 日韩亚洲欧美高清| 亚洲伦理在线免费看| 国产一区二区福利| 欧美日韩电影在线播放| 国产精品国产三级国产aⅴ无密码| 婷婷夜色潮精品综合在线| 成人在线视频一区| 日韩视频在线一区二区| 一区二区久久久久久| 成人av网站大全| 精品国内片67194| 手机精品视频在线观看| 一本大道久久a久久精二百| 国产日韩欧美电影| 国内不卡的二区三区中文字幕| 欧美精品一级二级三级| 亚洲同性gay激情无套| 国产成人综合在线| 久久综合久久综合九色| 蜜臀a∨国产成人精品| 91精品免费在线| 亚洲一区二区三区四区在线免费观看 | 91在线视频在线| 久久亚洲私人国产精品va媚药| 三级精品在线观看| 欧美视频一二三区| 亚洲六月丁香色婷婷综合久久| 成人激情校园春色| 国产视频一区二区在线| 国产精品资源站在线| 久久精品视频一区二区三区| 国内精品嫩模私拍在线| 日韩免费一区二区三区在线播放| 日本成人在线电影网| 欧美色精品在线视频| 亚洲欧美日韩一区二区三区在线观看| 国产99久久久国产精品| 国产精品美女久久福利网站| 成人一区二区三区| 中文字幕国产精品一区二区| 成人ar影院免费观看视频| 国产精品乱人伦中文| 99riav一区二区三区| 亚洲男人电影天堂| 欧洲另类一二三四区| 亚洲欧美另类久久久精品| 99国产麻豆精品| 综合久久久久久久| 在线免费不卡电影| 日韩中文字幕亚洲一区二区va在线| 欧美高清视频一二三区| 久久精品国产亚洲a| 久久综合色综合88| av激情综合网| 亚洲成年人影院| 日韩精品一区二区在线| 经典三级在线一区| 国产欧美1区2区3区| 99久久99久久免费精品蜜臀| 一区二区三区中文在线观看| 欧美三级日韩三级国产三级| 免费xxxx性欧美18vr| 久久老女人爱爱| 91视视频在线观看入口直接观看www | 欧美日韩亚洲综合一区二区三区| 午夜欧美一区二区三区在线播放| 91精品国产一区二区三区香蕉| 黄页视频在线91| 中文幕一区二区三区久久蜜桃| 91黄色免费观看| 麻豆91小视频| 国产精品二三区| 91麻豆精品国产自产在线| 久久99这里只有精品| 久久精品一级爱片| 一本久久a久久精品亚洲| 日韩成人一级片| 中文字幕一区视频| 欧美一区二区大片| av男人天堂一区| 麻豆精品视频在线| 亚洲精品大片www| 久久亚洲精精品中文字幕早川悠里| 99久久精品免费精品国产| 蜜臀精品一区二区三区在线观看| 中文字幕久久午夜不卡| 欧美老女人在线| www.欧美日韩| 蜜臀av国产精品久久久久| 亚洲激情六月丁香| 久久久www免费人成精品| 欧美色网站导航| 成人app在线观看| 韩国一区二区在线观看| 一区二区三区日韩精品视频| 久久在线观看免费| 欧美日韩www| 一本色道久久综合亚洲aⅴ蜜桃| 久久99精品国产|