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

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

?? tif_write.c

?? 支持各種柵格圖像和矢量圖像讀取的庫
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* $Id: tif_write.c,v 1.22 2006/11/20 02:11:41 fwarmerdam 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. * * Scanline-oriented Write Support */#include "tiffiop.h"#include <stdio.h>#define	STRIPINCR	20		/* expansion factor on strip array */#define	WRITECHECKSTRIPS(tif, module)				\	(((tif)->tif_flags&TIFF_BEENWRITING) || TIFFWriteCheck((tif),0,module))#define	WRITECHECKTILES(tif, module)				\	(((tif)->tif_flags&TIFF_BEENWRITING) || TIFFWriteCheck((tif),1,module))#define	BUFFERCHECK(tif)					\	((((tif)->tif_flags & TIFF_BUFFERSETUP) && tif->tif_rawdata) ||	\	    TIFFWriteBufferSetup((tif), NULL, (tsize_t) -1))static	int TIFFGrowStrips(TIFF*, int, const char*);static	int TIFFAppendToStrip(TIFF*, tstrip_t, tidata_t, tsize_t);intTIFFWriteScanline(TIFF* tif, tdata_t buf, uint32 row, tsample_t sample){	static const char module[] = "TIFFWriteScanline";	register TIFFDirectory *td;	int status, imagegrew = 0;	tstrip_t strip;	if (!WRITECHECKSTRIPS(tif, module))		return (-1);	/*	 * Handle delayed allocation of data buffer.  This	 * permits it to be sized more intelligently (using	 * directory information).	 */	if (!BUFFERCHECK(tif))		return (-1);	td = &tif->tif_dir;	/*	 * Extend image length if needed	 * (but only for PlanarConfig=1).	 */	if (row >= td->td_imagelength) {	/* extend image */		if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,		"Can not change \"ImageLength\" when using separate planes");			return (-1);		}		td->td_imagelength = row+1;		imagegrew = 1;	}	/*	 * Calculate strip and check for crossings.	 */	if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {		if (sample >= td->td_samplesperpixel) {			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,			    "%d: Sample out of range, max %d",			    sample, td->td_samplesperpixel);			return (-1);		}		strip = sample*td->td_stripsperimage + row/td->td_rowsperstrip;	} else		strip = row / td->td_rowsperstrip;	/*	 * Check strip array to make sure there's space. We don't support	 * dynamically growing files that have data organized in separate	 * bitplanes because it's too painful.  In that case we require that	 * the imagelength be set properly before the first write (so that the	 * strips array will be fully allocated above).	 */	if (strip >= td->td_nstrips && !TIFFGrowStrips(tif, 1, module))		return (-1);	if (strip != tif->tif_curstrip) {		/*		 * Changing strips -- flush any data present.		 */		if (!TIFFFlushData(tif))			return (-1);		tif->tif_curstrip = strip;		/*		 * Watch out for a growing image.  The value of strips/image		 * will initially be 1 (since it can't be deduced until the		 * imagelength is known).		 */		if (strip >= td->td_stripsperimage && imagegrew)			td->td_stripsperimage =			    TIFFhowmany(td->td_imagelength,td->td_rowsperstrip);		tif->tif_row =		    (strip % td->td_stripsperimage) * td->td_rowsperstrip;		if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {			if (!(*tif->tif_setupencode)(tif))				return (-1);			tif->tif_flags |= TIFF_CODERSETUP;		}        		tif->tif_rawcc = 0;		tif->tif_rawcp = tif->tif_rawdata;		if( td->td_stripbytecount[strip] > 0 )		{			/* if we are writing over existing tiles, zero length */			td->td_stripbytecount[strip] = 0;			/* this forces TIFFAppendToStrip() to do a seek */			tif->tif_curoff = 0;		}		if (!(*tif->tif_preencode)(tif, sample))			return (-1);		tif->tif_flags |= TIFF_POSTENCODE;	}	/*	 * Ensure the write is either sequential or at the	 * beginning of a strip (or that we can randomly	 * access the data -- i.e. no encoding).	 */	if (row != tif->tif_row) {		if (row < tif->tif_row) {			/*			 * Moving backwards within the same strip:			 * backup to the start and then decode			 * forward (below).			 */			tif->tif_row = (strip % td->td_stripsperimage) *			    td->td_rowsperstrip;			tif->tif_rawcp = tif->tif_rawdata;		}		/*		 * Seek forward to the desired row.		 */		if (!(*tif->tif_seek)(tif, row - tif->tif_row))			return (-1);		tif->tif_row = row;	}        /* swab if needed - note that source buffer will be altered */        tif->tif_postdecode( tif, (tidata_t) buf, tif->tif_scanlinesize );	status = (*tif->tif_encoderow)(tif, (tidata_t) buf,	    tif->tif_scanlinesize, sample);        /* we are now poised at the beginning of the next row */	tif->tif_row = row + 1;	return (status);}/* * Encode the supplied data and write it to the * specified strip. * * NB: Image length must be setup before writing. */tsize_tTIFFWriteEncodedStrip(TIFF* tif, tstrip_t strip, tdata_t data, tsize_t cc){	static const char module[] = "TIFFWriteEncodedStrip";	TIFFDirectory *td = &tif->tif_dir;	tsample_t sample;	if (!WRITECHECKSTRIPS(tif, module))		return ((tsize_t) -1);	/*	 * Check strip array to make sure there's space.	 * We don't support dynamically growing files that	 * have data organized in separate bitplanes because	 * it's too painful.  In that case we require that	 * the imagelength be set properly before the first	 * write (so that the strips array will be fully	 * allocated above).	 */	if (strip >= td->td_nstrips) {		if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,		"Can not grow image by strips when using separate planes");			return ((tsize_t) -1);		}		if (!TIFFGrowStrips(tif, 1, module))			return ((tsize_t) -1);		td->td_stripsperimage =		    TIFFhowmany(td->td_imagelength, td->td_rowsperstrip);	}	/*	 * Handle delayed allocation of data buffer.  This	 * permits it to be sized according to the directory	 * info.	 */	if (!BUFFERCHECK(tif))		return ((tsize_t) -1);	tif->tif_curstrip = strip;	tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip;	if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {		if (!(*tif->tif_setupencode)(tif))			return ((tsize_t) -1);		tif->tif_flags |= TIFF_CODERSETUP;	}        	tif->tif_rawcc = 0;	tif->tif_rawcp = tif->tif_rawdata;        if( td->td_stripbytecount[strip] > 0 )        {            /* if we are writing over existing tiles, zero length. */            td->td_stripbytecount[strip] = 0;            /* this forces TIFFAppendToStrip() to do a seek */            tif->tif_curoff = 0;        }        	tif->tif_flags &= ~TIFF_POSTENCODE;	sample = (tsample_t)(strip / td->td_stripsperimage);	if (!(*tif->tif_preencode)(tif, sample))		return ((tsize_t) -1);        /* swab if needed - note that source buffer will be altered */        tif->tif_postdecode( tif, (tidata_t) data, cc );	if (!(*tif->tif_encodestrip)(tif, (tidata_t) data, cc, sample))		return ((tsize_t) 0);	if (!(*tif->tif_postencode)(tif))		return ((tsize_t) -1);	if (!isFillOrder(tif, td->td_fillorder) &&	    (tif->tif_flags & TIFF_NOBITREV) == 0)		TIFFReverseBits(tif->tif_rawdata, tif->tif_rawcc);	if (tif->tif_rawcc > 0 &&	    !TIFFAppendToStrip(tif, strip, tif->tif_rawdata, tif->tif_rawcc))		return ((tsize_t) -1);	tif->tif_rawcc = 0;	tif->tif_rawcp = tif->tif_rawdata;	return (cc);}/* * Write the supplied data to the specified strip. * * NB: Image length must be setup before writing. */tsize_tTIFFWriteRawStrip(TIFF* tif, tstrip_t strip, tdata_t data, tsize_t cc){	static const char module[] = "TIFFWriteRawStrip";	TIFFDirectory *td = &tif->tif_dir;	if (!WRITECHECKSTRIPS(tif, module))		return ((tsize_t) -1);	/*	 * Check strip array to make sure there's space.	 * We don't support dynamically growing files that	 * have data organized in separate bitplanes because	 * it's too painful.  In that case we require that	 * the imagelength be set properly before the first	 * write (so that the strips array will be fully	 * allocated above).	 */	if (strip >= td->td_nstrips) {		if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,		"Can not grow image by strips when using separate planes");			return ((tsize_t) -1);		}		/*		 * Watch out for a growing image.  The value of		 * strips/image will initially be 1 (since it		 * can't be deduced until the imagelength is known).		 */		if (strip >= td->td_stripsperimage)			td->td_stripsperimage =			    TIFFhowmany(td->td_imagelength,td->td_rowsperstrip);		if (!TIFFGrowStrips(tif, 1, module))			return ((tsize_t) -1);	}	tif->tif_curstrip = strip;	tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip;	return (TIFFAppendToStrip(tif, strip, (tidata_t) data, cc) ?	    cc : (tsize_t) -1);}/* * Write and compress a tile of data.  The * tile is selected by the (x,y,z,s) coordinates. */tsize_tTIFFWriteTile(TIFF* tif,    tdata_t buf, uint32 x, uint32 y, uint32 z, tsample_t s){	if (!TIFFCheckTile(tif, x, y, z, s))		return (-1);	/*	 * NB: A tile size of -1 is used instead of tif_tilesize knowing	 *     that TIFFWriteEncodedTile will clamp this to the tile size.	 *     This is done because the tile size may not be defined until	 *     after the output buffer is setup in TIFFWriteBufferSetup.	 */	return (TIFFWriteEncodedTile(tif,	    TIFFComputeTile(tif, x, y, z, s), buf, (tsize_t) -1));}/* * Encode the supplied data and write it to the * specified tile.  There must be space for the * data.  The function clamps individual writes * to a tile to the tile size, but does not (and * can not) check that multiple writes to the same * tile do not write more than tile size data. * * NB: Image length must be setup before writing; this *     interface does not support automatically growing *     the image on each write (as TIFFWriteScanline does). */tsize_tTIFFWriteEncodedTile(TIFF* tif, ttile_t tile, tdata_t data, tsize_t cc){	static const char module[] = "TIFFWriteEncodedTile";	TIFFDirectory *td;	tsample_t sample;	if (!WRITECHECKTILES(tif, module))		return ((tsize_t) -1);	td = &tif->tif_dir;	if (tile >= td->td_nstrips) {		TIFFErrorExt(tif->tif_clientdata, module, "%s: Tile %lu out of range, max %lu",		    tif->tif_name, (unsigned long) tile, (unsigned long) td->td_nstrips);		return ((tsize_t) -1);	}	/*	 * Handle delayed allocation of data buffer.  This	 * permits it to be sized more intelligently (using	 * directory information).	 */	if (!BUFFERCHECK(tif))		return ((tsize_t) -1);	tif->tif_curtile = tile;	tif->tif_rawcc = 0;	tif->tif_rawcp = tif->tif_rawdata;        if( td->td_stripbytecount[tile] > 0 )

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合久久天天| 国产精品色在线| 中文字幕在线免费不卡| 天使萌一区二区三区免费观看| 国产乱人伦偷精品视频不卡| 欧美私模裸体表演在线观看| 中文字幕av不卡| 久久精品国产在热久久| 欧美午夜精品久久久久久孕妇| 国产精品三级电影| 精品一区二区三区的国产在线播放 | 亚洲欧美色图小说| 国产suv精品一区二区三区| 51精品秘密在线观看| 一区二区三区.www| 96av麻豆蜜桃一区二区| 国产色91在线| 国产乱人伦精品一区二区在线观看| 在线播放中文字幕一区| 亚洲电影一区二区三区| 一本高清dvd不卡在线观看| 欧美激情在线一区二区三区| 精品一区二区三区免费| 日韩精品一区二区在线| 日本成人超碰在线观看| 4hu四虎永久在线影院成人| 午夜精品福利在线| 欧美日韩一级二级三级| 亚洲电影欧美电影有声小说| 色香色香欲天天天影视综合网| 国产精品久久免费看| 国产成人欧美日韩在线电影| 国产日韩欧美综合在线| 五月婷婷激情综合| 日韩欧美一区电影| 美女一区二区久久| 欧美刺激午夜性久久久久久久| 青青青伊人色综合久久| 日韩手机在线导航| 老司机精品视频在线| 精品999久久久| 另类欧美日韩国产在线| 久久免费看少妇高潮| 国产一区91精品张津瑜| 精品国产制服丝袜高跟| 捆绑调教美女网站视频一区| 精品嫩草影院久久| 成人99免费视频| 亚洲精品视频免费看| 欧美日韩在线三级| 美女网站一区二区| 国产女人水真多18毛片18精品视频| 顶级嫩模精品视频在线看| 国产精品免费观看视频| 在线观看日产精品| 日韩精品成人一区二区在线| 日韩欧美一区二区免费| 丁香婷婷综合五月| 亚洲综合一区二区精品导航| 欧美日韩aaa| 国产一区二区三区四| 亚洲精品视频免费观看| 欧美福利视频导航| 国产麻豆视频一区二区| 亚洲国产精品一区二区久久恐怖片 | 成人免费毛片嘿嘿连载视频| 亚洲黄色在线视频| 精品国产青草久久久久福利| 成人97人人超碰人人99| 日本人妖一区二区| 中文字幕制服丝袜一区二区三区 | 99久久精品国产导航| 天堂va蜜桃一区二区三区漫画版| 国产香蕉久久精品综合网| 91天堂素人约啪| 看电影不卡的网站| 亚洲一区二区在线免费观看视频| 精品久久久久久久久久久久久久久久久 | 亚洲激情校园春色| 精品精品国产高清a毛片牛牛| jvid福利写真一区二区三区| 天堂av在线一区| 国产精品成人网| 久久免费偷拍视频| 91精品久久久久久久91蜜桃| 99久久国产综合色|国产精品| 美美哒免费高清在线观看视频一区二区 | 亚洲成av人影院在线观看网| 久久精品夜色噜噜亚洲aⅴ| 欧美日本韩国一区二区三区视频| 国产91精品露脸国语对白| 免费成人av在线| 国产精品国产三级国产普通话99 | 国产成人精品综合在线观看 | 精品国产乱子伦一区| 91麻豆swag| 国产.精品.日韩.另类.中文.在线.播放| 一区二区三区在线影院| 国产欧美日韩在线| 日韩三级在线免费观看| 欧美日本一区二区| 欧美视频一二三区| 色吧成人激情小说| 91一区二区在线观看| 高清成人免费视频| 国产成人精品一区二区三区四区| 免费看欧美女人艹b| 日韩av不卡在线观看| 日本一不卡视频| 日韩主播视频在线| 三级欧美韩日大片在线看| 亚洲国产欧美日韩另类综合| 亚洲一区免费观看| 午夜亚洲国产au精品一区二区| 亚洲精品免费在线| 樱花影视一区二区| 一区2区3区在线看| 亚洲在线观看免费视频| 午夜精品在线视频一区| 日韩精品国产精品| 麻豆国产欧美一区二区三区| 久久精品国产澳门| 国产一区二区不卡| eeuss鲁片一区二区三区在线看| 成人爽a毛片一区二区免费| 成人午夜电影小说| 91麻豆福利精品推荐| 欧美男同性恋视频网站| 欧美一级片在线观看| 精品国产三级电影在线观看| ww亚洲ww在线观看国产| 国产精品久久久久久户外露出| 亚洲欧洲成人精品av97| 洋洋成人永久网站入口| 日韩高清中文字幕一区| 国产原创一区二区三区| 成a人片国产精品| 久久国产剧场电影| 欧美大片日本大片免费观看| 色综合久久66| 欧美日韩不卡在线| 久久精品网站免费观看| 中文字幕一区在线观看| 亚洲电影一区二区| 国产米奇在线777精品观看| 不卡一区在线观看| 欧美丰满嫩嫩电影| 亚洲国产成人自拍| 午夜影院久久久| 国产一区二区在线影院| 91同城在线观看| 欧美电影免费观看高清完整版在| 久久夜色精品一区| 一区二区三区**美女毛片| 精品制服美女丁香| 欧美午夜精品一区| 国产亚洲欧洲997久久综合| 一区二区久久久久| 国产精品白丝av| 精品视频在线看| 国产精品灌醉下药二区| 日本欧美肥老太交大片| 91精品久久久久久蜜臀| 中文字幕一区二区三区在线观看| 日韩国产欧美一区二区三区| 国产91丝袜在线18| 欧美不卡视频一区| 亚洲综合免费观看高清完整版| 久草这里只有精品视频| 欧美色图12p| 18欧美乱大交hd1984| 国产在线精品一区二区夜色| 一本到三区不卡视频| 国产精品美女久久久久久久久久久 | 日韩美女在线视频| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 国产suv一区二区三区88区| 欧美一区2区视频在线观看| 亚洲欧美日韩国产综合| 成人在线综合网| 日韩欧美色电影| 亚洲国产aⅴ成人精品无吗| 99精品欧美一区二区蜜桃免费| 久久综合九色综合欧美98| 免费成人美女在线观看.| 91.xcao| 天天影视网天天综合色在线播放| 91麻豆免费看片| 一区在线播放视频| jizzjizzjizz欧美| 国产精品天天摸av网| 国产乱人伦偷精品视频免下载| 日韩一区二区高清| 天天综合色天天综合色h| 日本高清不卡视频| 亚洲黄色录像片| 欧美日韩精品一区二区三区| 亚洲激情自拍偷拍| 在线欧美一区二区| 偷拍日韩校园综合在线|