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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tif_dirwrite.c

?? 支持各種柵格圖像和矢量圖像讀取的庫
?? C
?? 第 1 頁 / 共 3 頁
字號(hào):
			return (0);	} else		_TIFFmemcpy(&dir->tdir_offset, cp, dir->tdir_count);	return (1);}/* * Setup a directory entry of an array of SHORT * or SSHORT and write the associated indirect values. */static intTIFFWriteShortArray(TIFF* tif, TIFFDirEntry* dir, uint16* v){	if (dir->tdir_count <= 2) {		if (tif->tif_header.tiff_magic == TIFF_BIGENDIAN) {			dir->tdir_offset = (uint32) ((long) v[0] << 16);			if (dir->tdir_count == 2)				dir->tdir_offset |= v[1] & 0xffff;		} else {			dir->tdir_offset = v[0] & 0xffff;			if (dir->tdir_count == 2)				dir->tdir_offset |= (long) v[1] << 16;		}		return (1);	} else		return (TIFFWriteData(tif, dir, (char*) v));}/* * Setup a directory entry of an array of LONG * or SLONG and write the associated indirect values. */static intTIFFWriteLongArray(TIFF* tif, TIFFDirEntry* dir, uint32* v){	if (dir->tdir_count == 1) {		dir->tdir_offset = v[0];		return (1);	} else		return (TIFFWriteData(tif, dir, (char*) v));}/* * Setup a directory entry of an array of RATIONAL * or SRATIONAL and write the associated indirect values. */static intTIFFWriteRationalArray(TIFF* tif, TIFFDirEntry* dir, float* v){	uint32 i;	uint32* t;	int status;	t = (uint32*) _TIFFmalloc(2 * dir->tdir_count * sizeof (uint32));	if (t == NULL) {		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,		    "No space to write RATIONAL array");		return (0);	}	for (i = 0; i < dir->tdir_count; i++) {		float fv = v[i];		int sign = 1;		uint32 den;		if (fv < 0) {			if (dir->tdir_type == TIFF_RATIONAL) {				TIFFWarningExt(tif->tif_clientdata,					       tif->tif_name,	"\"%s\": Information lost writing value (%g) as (unsigned) RATIONAL",				_TIFFFieldWithTag(tif,dir->tdir_tag)->field_name,						fv);				fv = 0;			} else				fv = -fv, sign = -1;		}		den = 1L;		if (fv > 0) {			while (fv < 1L<<(31-3) && den < 1L<<(31-3))				fv *= 1<<3, den *= 1L<<3;		}		t[2*i+0] = (uint32) (sign * (fv + 0.5));		t[2*i+1] = den;	}	status = TIFFWriteData(tif, dir, (char *)t);	_TIFFfree((char*) t);	return (status);}static intTIFFWriteFloatArray(TIFF* tif, TIFFDirEntry* dir, float* v){	TIFFCvtNativeToIEEEFloat(tif, dir->tdir_count, v);	if (dir->tdir_count == 1) {		dir->tdir_offset = *(uint32*) &v[0];		return (1);	} else		return (TIFFWriteData(tif, dir, (char*) v));}static intTIFFWriteDoubleArray(TIFF* tif, TIFFDirEntry* dir, double* v){	TIFFCvtNativeToIEEEDouble(tif, dir->tdir_count, v);	return (TIFFWriteData(tif, dir, (char*) v));}/* * Write an array of ``type'' values for a specified tag (i.e. this is a tag * which is allowed to have different types, e.g. SMaxSampleType). * Internally the data values are represented as double since a double can * hold any of the TIFF tag types (yes, this should really be an abstract * type tany_t for portability).  The data is converted into the specified * type in a temporary buffer and then handed off to the appropriate array * writer. */static intTIFFWriteAnyArray(TIFF* tif,    TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, double* v){	char buf[10 * sizeof(double)];	char* w = buf;	int i, status = 0;	if (n * TIFFDataWidth(type) > sizeof buf) {		w = (char*) _TIFFmalloc(n * TIFFDataWidth(type));		if (w == NULL) {			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,				     "No space to write array");			return (0);		}	}	dir->tdir_tag = (uint16) tag;	dir->tdir_type = (uint16) type;	dir->tdir_count = n;	switch (type) {	case TIFF_BYTE:		{ 			uint8* bp = (uint8*) w;			for (i = 0; i < (int) n; i++)				bp[i] = (uint8) v[i];			if (!TIFFWriteByteArray(tif, dir, (char*) bp))				goto out;		}		break;	case TIFF_SBYTE:		{ 			int8* bp = (int8*) w;			for (i = 0; i < (int) n; i++)				bp[i] = (int8) v[i];			if (!TIFFWriteByteArray(tif, dir, (char*) bp))				goto out;		}		break;	case TIFF_SHORT:		{			uint16* bp = (uint16*) w;			for (i = 0; i < (int) n; i++)				bp[i] = (uint16) v[i];			if (!TIFFWriteShortArray(tif, dir, (uint16*)bp))				goto out;		}		break;	case TIFF_SSHORT:		{ 			int16* bp = (int16*) w;			for (i = 0; i < (int) n; i++)				bp[i] = (int16) v[i];			if (!TIFFWriteShortArray(tif, dir, (uint16*)bp))				goto out;		}		break;	case TIFF_LONG:		{			uint32* bp = (uint32*) w;			for (i = 0; i < (int) n; i++)				bp[i] = (uint32) v[i];			if (!TIFFWriteLongArray(tif, dir, bp))				goto out;		}		break;	case TIFF_SLONG:		{			int32* bp = (int32*) w;			for (i = 0; i < (int) n; i++)				bp[i] = (int32) v[i];			if (!TIFFWriteLongArray(tif, dir, (uint32*) bp))				goto out;		}		break;	case TIFF_FLOAT:		{ 			float* bp = (float*) w;			for (i = 0; i < (int) n; i++)				bp[i] = (float) v[i];			if (!TIFFWriteFloatArray(tif, dir, bp))				goto out;		}		break;	case TIFF_DOUBLE:		return (TIFFWriteDoubleArray(tif, dir, v));	default:		/* TIFF_NOTYPE */		/* TIFF_ASCII */		/* TIFF_UNDEFINED */		/* TIFF_RATIONAL */		/* TIFF_SRATIONAL */		goto out;	}	status = 1; out:	if (w != buf)		_TIFFfree(w);	return (status);}static intTIFFWriteTransferFunction(TIFF* tif, TIFFDirEntry* dir){	TIFFDirectory* td = &tif->tif_dir;	tsize_t n = (1L<<td->td_bitspersample) * sizeof (uint16);	uint16** tf = td->td_transferfunction;	int ncols;	/*	 * Check if the table can be written as a single column,	 * or if it must be written as 3 columns.  Note that we	 * write a 3-column tag if there are 2 samples/pixel and	 * a single column of data won't suffice--hmm.	 */	switch (td->td_samplesperpixel - td->td_extrasamples) {	default:	if (_TIFFmemcmp(tf[0], tf[2], n)) { ncols = 3; break; }	case 2:		if (_TIFFmemcmp(tf[0], tf[1], n)) { ncols = 3; break; }	case 1: case 0:	ncols = 1;	}	return (TIFFWriteShortTable(tif,	    TIFFTAG_TRANSFERFUNCTION, dir, ncols, tf));}static intTIFFWriteInkNames(TIFF* tif, TIFFDirEntry* dir){	TIFFDirectory* td = &tif->tif_dir;	dir->tdir_tag = TIFFTAG_INKNAMES;	dir->tdir_type = (short) TIFF_ASCII;	dir->tdir_count = td->td_inknameslen;	return (TIFFWriteByteArray(tif, dir, td->td_inknames));}/* * Write a contiguous directory item. */static intTIFFWriteData(TIFF* tif, TIFFDirEntry* dir, char* cp){	tsize_t cc;	if (tif->tif_flags & TIFF_SWAB) {		switch (dir->tdir_type) {		case TIFF_SHORT:		case TIFF_SSHORT:			TIFFSwabArrayOfShort((uint16*) cp, dir->tdir_count);			break;		case TIFF_LONG:		case TIFF_SLONG:		case TIFF_FLOAT:			TIFFSwabArrayOfLong((uint32*) cp, dir->tdir_count);			break;		case TIFF_RATIONAL:		case TIFF_SRATIONAL:			TIFFSwabArrayOfLong((uint32*) cp, 2*dir->tdir_count);			break;		case TIFF_DOUBLE:			TIFFSwabArrayOfDouble((double*) cp, dir->tdir_count);			break;		}	}	dir->tdir_offset = tif->tif_dataoff;	cc = dir->tdir_count * TIFFDataWidth((TIFFDataType) dir->tdir_type);	if (SeekOK(tif, dir->tdir_offset) &&	    WriteOK(tif, cp, cc)) {		tif->tif_dataoff += (cc + 1) & ~1;		return (1);	}	TIFFErrorExt(tif->tif_clientdata, tif->tif_name,		     "Error writing data for field \"%s\"",	_TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);	return (0);}/* * Similar to TIFFWriteDirectory(), but if the directory has already * been written once, it is relocated to the end of the file, in case it * has changed in size.  Note that this will result in the loss of the  * previously used directory space.  */ int TIFFRewriteDirectory( TIFF *tif ){    static const char module[] = "TIFFRewriteDirectory";    /* We don't need to do anything special if it hasn't been written. */    if( tif->tif_diroff == 0 )        return TIFFWriteDirectory( tif );    /*    ** Find and zero the pointer to this directory, so that TIFFLinkDirectory    ** will cause it to be added after this directories current pre-link.    */        /* Is it the first directory in the file? */    if (tif->tif_header.tiff_diroff == tif->tif_diroff)     {        tif->tif_header.tiff_diroff = 0;        tif->tif_diroff = 0;        TIFFSeekFile(tif, (toff_t)(TIFF_MAGIC_SIZE+TIFF_VERSION_SIZE),		     SEEK_SET);        if (!WriteOK(tif, &(tif->tif_header.tiff_diroff),                      sizeof (tif->tif_diroff)))         {			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,				     "Error updating TIFF header");            return (0);        }    }    else    {        toff_t  nextdir, off;	nextdir = tif->tif_header.tiff_diroff;	do {		uint16 dircount;		if (!SeekOK(tif, nextdir) ||		    !ReadOK(tif, &dircount, sizeof (dircount))) {			TIFFErrorExt(tif->tif_clientdata, module,				     "Error fetching directory count");			return (0);		}		if (tif->tif_flags & TIFF_SWAB)			TIFFSwabShort(&dircount);		(void) TIFFSeekFile(tif,		    dircount * sizeof (TIFFDirEntry), SEEK_CUR);		if (!ReadOK(tif, &nextdir, sizeof (nextdir))) {			TIFFErrorExt(tif->tif_clientdata, module,				     "Error fetching directory link");			return (0);		}		if (tif->tif_flags & TIFF_SWAB)			TIFFSwabLong(&nextdir);	} while (nextdir != tif->tif_diroff && nextdir != 0);        off = TIFFSeekFile(tif, 0, SEEK_CUR); /* get current offset */        (void) TIFFSeekFile(tif, off - (toff_t)sizeof(nextdir), SEEK_SET);        tif->tif_diroff = 0;	if (!WriteOK(tif, &(tif->tif_diroff), sizeof (nextdir))) {		TIFFErrorExt(tif->tif_clientdata, module,			     "Error writing directory link");		return (0);	}    }    /*    ** Now use TIFFWriteDirectory() normally.    */    return TIFFWriteDirectory( tif );}/* * Link the current directory into the directory chain for the file. */static intTIFFLinkDirectory(TIFF* tif){	static const char module[] = "TIFFLinkDirectory";	toff_t nextdir;	toff_t diroff, off;	tif->tif_diroff = (TIFFSeekFile(tif, (toff_t) 0, SEEK_END)+1) &~ 1;	diroff = tif->tif_diroff;	if (tif->tif_flags & TIFF_SWAB)		TIFFSwabLong(&diroff);	/*	 * Handle SubIFDs	 */        if (tif->tif_flags & TIFF_INSUBIFD) {		(void) TIFFSeekFile(tif, tif->tif_subifdoff, SEEK_SET);		if (!WriteOK(tif, &diroff, sizeof (diroff))) {			TIFFErrorExt(tif->tif_clientdata, module,				     "%s: Error writing SubIFD directory link",				     tif->tif_name);			return (0);		}		/*		 * Advance to the next SubIFD or, if this is		 * the last one configured, revert back to the		 * normal directory linkage.		 */		if (--tif->tif_nsubifd)			tif->tif_subifdoff += sizeof (diroff);		else			tif->tif_flags &= ~TIFF_INSUBIFD;		return (1);	}	if (tif->tif_header.tiff_diroff == 0) {		/*		 * First directory, overwrite offset in header.		 */		tif->tif_header.tiff_diroff = tif->tif_diroff;		(void) TIFFSeekFile(tif,				    (toff_t)(TIFF_MAGIC_SIZE+TIFF_VERSION_SIZE),                                    SEEK_SET);		if (!WriteOK(tif, &diroff, sizeof (diroff))) {			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,				     "Error writing TIFF header");			return (0);		}		return (1);	}	/*	 * Not the first directory, search to the last and append.	 */	nextdir = tif->tif_header.tiff_diroff;	do {		uint16 dircount;		if (!SeekOK(tif, nextdir) ||		    !ReadOK(tif, &dircount, sizeof (dircount))) {			TIFFErrorExt(tif->tif_clientdata, module,				     "Error fetching directory count");			return (0);		}		if (tif->tif_flags & TIFF_SWAB)			TIFFSwabShort(&dircount);		(void) TIFFSeekFile(tif,		    dircount * sizeof (TIFFDirEntry), SEEK_CUR);		if (!ReadOK(tif, &nextdir, sizeof (nextdir))) {			TIFFErrorExt(tif->tif_clientdata, module,				     "Error fetching directory link");			return (0);		}		if (tif->tif_flags & TIFF_SWAB)			TIFFSwabLong(&nextdir);	} while (nextdir != 0);        off = TIFFSeekFile(tif, 0, SEEK_CUR); /* get current offset */        (void) TIFFSeekFile(tif, off - (toff_t)sizeof(nextdir), SEEK_SET);	if (!WriteOK(tif, &diroff, sizeof (diroff))) {		TIFFErrorExt(tif->tif_clientdata, module,			     "Error writing directory link");		return (0);	}	return (1);}/* vim: set ts=8 sts=8 sw=8 noet: */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区在线电影| 免费观看久久久4p| 亚洲成人午夜电影| 久久er99精品| 99re8在线精品视频免费播放| 91免费国产视频网站| 3d成人h动漫网站入口| 国产日韩一级二级三级| 午夜视频在线观看一区二区三区| 国内精品视频一区二区三区八戒 | 久久精品一区蜜桃臀影院| 亚洲男人的天堂网| 国产精品一二二区| 欧美精品在线视频| 国产精品国产三级国产普通话99 | 成人av在线一区二区| 91精品国产综合久久久久久漫画| 国产精品日韩精品欧美在线| 奇米亚洲午夜久久精品| 色呦呦日韩精品| 日本一区二区三区高清不卡| 免费观看在线综合| 欧美日韩一级大片网址| 亚洲欧美另类久久久精品2019| 国产一区二区久久| 欧美日韩三级在线| 欧美国产乱子伦| 日韩激情一二三区| caoporn国产精品| 日韩欧美在线观看一区二区三区| 国产精品福利av| 精品在线观看免费| 欧美伊人久久久久久久久影院| 欧美国产丝袜视频| 黄一区二区三区| 日韩一区二区三区精品视频| 国产清纯白嫩初高生在线观看91 | 欧美视频在线观看一区| 中文字幕一区二| 国产一区视频网站| 国产欧美日韩久久| 亚洲国产精品久久久久秋霞影院| 激情伊人五月天久久综合| 欧洲一区二区三区在线| 国产精品视频看| 国产成人高清在线| 久久久亚洲欧洲日产国码αv| 丝袜亚洲精品中文字幕一区| 国产91富婆露脸刺激对白| 91精品国产一区二区| 一区二区在线免费| 97se亚洲国产综合自在线| 国产精品卡一卡二| 国产精品一区二区不卡| 3atv一区二区三区| 蜜桃视频免费观看一区| 欧美午夜精品久久久| 亚洲一区精品在线| 一本色道久久综合狠狠躁的推荐 | 一本久久a久久免费精品不卡| 国产欧美日韩卡一| 99久久99久久综合| 中文字幕精品一区二区三区精品| 国产一区不卡精品| 国产精品水嫩水嫩| a级高清视频欧美日韩| 亚洲美女在线一区| 欧美日韩一卡二卡| 爽好久久久欧美精品| 欧美在线免费观看亚洲| 亚洲成人免费在线| 日韩免费高清视频| 国产精品一级黄| 自拍偷自拍亚洲精品播放| 欧美影院午夜播放| 日本三级亚洲精品| 欧洲av在线精品| 日本sm残虐另类| 精品国产伦一区二区三区观看方式 | 99视频有精品| 日韩国产欧美在线播放| 日韩欧美的一区二区| 国产a精品视频| 亚洲国产一区二区视频| 亚洲色图欧洲色图| 欧美乱熟臀69xxxxxx| 国产精品影视在线观看| 亚洲国产一区视频| 国产亚洲va综合人人澡精品| 国产盗摄一区二区| 午夜久久久久久久久| 久久色视频免费观看| 色综合一区二区三区| 精品在线一区二区三区| 一区二区三区在线观看国产| 欧美大度的电影原声| 色天使色偷偷av一区二区| 国产一区中文字幕| 亚洲午夜精品一区二区三区他趣| 欧美国产精品久久| 欧美日韩国产在线播放网站| 国产一区二区三区四区五区入口| 中文字幕中文字幕中文字幕亚洲无线| 日韩一级片在线观看| 99riav一区二区三区| 免费欧美在线视频| 亚洲国产aⅴ成人精品无吗| 中文字幕av一区 二区| 久久久久久久综合| 欧美一区二区三区成人| 91国偷自产一区二区使用方法| 国产精品伊人色| 久久精品国产一区二区| 亚洲人成网站精品片在线观看| 久久婷婷一区二区三区| 国产精品主播直播| 国产欧美日韩精品一区| 日韩欧美国产高清| 91麻豆精品国产91久久久久久久久| 99精品视频在线免费观看| 久久精品久久久精品美女| 日本欧美在线观看| 亚洲宅男天堂在线观看无病毒| 国产蜜臀av在线一区二区三区| 久久综合网色—综合色88| 欧美午夜精品久久久久久超碰 | 国产一区二区h| 六月婷婷色综合| 精品在线观看视频| 韩国成人福利片在线播放| 国内久久婷婷综合| 国产99久久久国产精品潘金| 成人一级视频在线观看| 成人av影视在线观看| 99久久精品国产毛片| 色婷婷精品大在线视频 | www.亚洲人| 一本到高清视频免费精品| 欧美三级在线视频| 欧美精品在线一区二区| 日韩女优制服丝袜电影| 国产日韩av一区| 亚洲精选视频在线| 视频一区国产视频| 国产精品一区不卡| 色婷婷香蕉在线一区二区| 91精品国产乱| www日韩大片| 一区二区三区在线免费视频| 日本欧美大码aⅴ在线播放| 麻豆精品视频在线观看| 国产在线观看免费一区| eeuss鲁一区二区三区| 精品视频在线免费| 欧美激情一二三区| 亚洲一区国产视频| 国产91在线|亚洲| 欧美日韩一级二级三级| 日韩午夜小视频| 亚洲色大成网站www久久九九| 亚洲地区一二三色| 成人福利电影精品一区二区在线观看 | 欧美精品一区二| 亚洲chinese男男1069| 大胆欧美人体老妇| 久久精品亚洲乱码伦伦中文| 日韩精品免费视频人成| 91美女片黄在线观看91美女| 久久婷婷国产综合国色天香| 日韩国产精品大片| 欧美日韩精品一区视频| 亚洲免费资源在线播放| 99re66热这里只有精品3直播 | 国产亚洲精品7777| 精品在线播放午夜| 日韩精品一区二区三区在线观看| 一卡二卡三卡日韩欧美| 成人国产精品免费观看视频| 日韩欧美在线影院| 久久精品久久综合| 久久影视一区二区| 激情都市一区二区| 久久品道一品道久久精品| 国内精品免费**视频| 26uuu色噜噜精品一区二区| 精品一区二区精品| 久久久久国产精品人| 国产成人免费视频精品含羞草妖精 | 一区二区激情视频| 欧美日韩成人一区二区| 三级精品在线观看| 欧美大片在线观看一区| 久久电影网电视剧免费观看| 久久久久高清精品| 粉嫩高潮美女一区二区三区| 国产农村妇女精品| 一本一道综合狠狠老| 天堂一区二区在线免费观看| 日韩一级片在线播放| 国产.精品.日韩.另类.中文.在线.播放|