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

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

?? tif_strip.c

?? 支持各種柵格圖像和矢量圖像讀取的庫
?? C
字號:
/* $Id: tif_strip.c,v 1.19 2006/03/25 18:04:35 joris Exp $ *//* * Copyright (c) 1991-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. * * Strip-organized Image Support Routines. */#include "tiffiop.h"static uint32summarize(TIFF* tif, size_t summand1, size_t summand2, const char* where){	/*	 * XXX: We are using casting to uint32 here, bacause sizeof(size_t)	 * may be larger than sizeof(uint32) on 64-bit architectures.	 */	uint32	bytes = summand1 + summand2;	if (bytes - summand1 != summand2) {		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Integer overflow in %s", where);		bytes = 0;	}	return (bytes);}static uint32multiply(TIFF* tif, size_t nmemb, size_t elem_size, const char* where){	uint32	bytes = nmemb * elem_size;	if (elem_size && bytes / elem_size != nmemb) {		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Integer overflow in %s", where);		bytes = 0;	}	return (bytes);}/* * Compute which strip a (row,sample) value is in. */tstrip_tTIFFComputeStrip(TIFF* tif, uint32 row, tsample_t sample){	TIFFDirectory *td = &tif->tif_dir;	tstrip_t strip;	strip = row / td->td_rowsperstrip;	if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {		if (sample >= td->td_samplesperpixel) {			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,			    "%lu: Sample out of range, max %lu",			    (unsigned long) sample, (unsigned long) td->td_samplesperpixel);			return ((tstrip_t) 0);		}		strip += sample*td->td_stripsperimage;	}	return (strip);}/* * Compute how many strips are in an image. */tstrip_tTIFFNumberOfStrips(TIFF* tif){	TIFFDirectory *td = &tif->tif_dir;	tstrip_t nstrips;	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :	     TIFFhowmany(td->td_imagelength, td->td_rowsperstrip));	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)		nstrips = multiply(tif, nstrips, td->td_samplesperpixel,				   "TIFFNumberOfStrips");	return (nstrips);}/* * Compute the # bytes in a variable height, row-aligned strip. */tsize_tTIFFVStripSize(TIFF* tif, uint32 nrows){	TIFFDirectory *td = &tif->tif_dir;	if (nrows == (uint32) -1)		nrows = td->td_imagelength;	if (td->td_planarconfig == PLANARCONFIG_CONTIG &&	    td->td_photometric == PHOTOMETRIC_YCBCR &&	    !isUpSampled(tif)) {		/*		 * Packed YCbCr data contain one Cb+Cr for every		 * HorizontalSampling*VerticalSampling Y values.		 * Must also roundup width and height when calculating		 * since images that are not a multiple of the		 * horizontal/vertical subsampling area include		 * YCbCr data for the extended image.		 */		uint16 ycbcrsubsampling[2];		tsize_t w, scanline, samplingarea;		TIFFGetField( tif, TIFFTAG_YCBCRSUBSAMPLING,			      ycbcrsubsampling + 0,			      ycbcrsubsampling + 1 );		samplingarea = ycbcrsubsampling[0]*ycbcrsubsampling[1];		if (samplingarea == 0) {			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,				     "Invalid YCbCr subsampling");			return 0;		}		w = TIFFroundup(td->td_imagewidth, ycbcrsubsampling[0]);		scanline = TIFFhowmany8(multiply(tif, w, td->td_bitspersample,						 "TIFFVStripSize"));		nrows = TIFFroundup(nrows, ycbcrsubsampling[1]);		/* NB: don't need TIFFhowmany here 'cuz everything is rounded */		scanline = multiply(tif, nrows, scanline, "TIFFVStripSize");		return ((tsize_t)		    summarize(tif, scanline,			      multiply(tif, 2, scanline / samplingarea,				       "TIFFVStripSize"), "TIFFVStripSize"));	} else		return ((tsize_t) multiply(tif, nrows, TIFFScanlineSize(tif),					   "TIFFVStripSize"));}/* * Compute the # bytes in a raw strip. */tsize_tTIFFRawStripSize(TIFF* tif, tstrip_t strip){	TIFFDirectory* td = &tif->tif_dir;	tsize_t bytecount = td->td_stripbytecount[strip];	if (bytecount <= 0) {		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,			  "%lu: Invalid strip byte count, strip %lu",			  (unsigned long) bytecount, (unsigned long) strip);		bytecount = (tsize_t) -1;	}	return bytecount;}/* * Compute the # bytes in a (row-aligned) strip. * * Note that if RowsPerStrip is larger than the * recorded ImageLength, then the strip size is * truncated to reflect the actual space required * to hold the strip. */tsize_tTIFFStripSize(TIFF* tif){	TIFFDirectory* td = &tif->tif_dir;	uint32 rps = td->td_rowsperstrip;	if (rps > td->td_imagelength)		rps = td->td_imagelength;	return (TIFFVStripSize(tif, rps));}/* * Compute a default strip size based on the image * characteristics and a requested value.  If the * request is <1 then we choose a strip size according * to certain heuristics. */uint32TIFFDefaultStripSize(TIFF* tif, uint32 request){	return (*tif->tif_defstripsize)(tif, request);}uint32_TIFFDefaultStripSize(TIFF* tif, uint32 s){	if ((int32) s < 1) {		/*		 * If RowsPerStrip is unspecified, try to break the		 * image up into strips that are approximately		 * STRIP_SIZE_DEFAULT bytes long.		 */		tsize_t scanline = TIFFScanlineSize(tif);		s = (uint32)STRIP_SIZE_DEFAULT / (scanline == 0 ? 1 : scanline);		if (s == 0)		/* very wide images */			s = 1;	}	return (s);}/* * Return the number of bytes to read/write in a call to * one of the scanline-oriented i/o routines.  Note that * this number may be 1/samples-per-pixel if data is * stored as separate planes. */tsize_tTIFFScanlineSize(TIFF* tif){	TIFFDirectory *td = &tif->tif_dir;	tsize_t scanline;	if (td->td_planarconfig == PLANARCONFIG_CONTIG) {		if (td->td_photometric == PHOTOMETRIC_YCBCR		    && !isUpSampled(tif)) {			uint16 ycbcrsubsampling[2];			TIFFGetField(tif, TIFFTAG_YCBCRSUBSAMPLING,				     ycbcrsubsampling + 0,				     ycbcrsubsampling + 1);			if (ycbcrsubsampling[0] == 0) {				TIFFErrorExt(tif->tif_clientdata, tif->tif_name,					     "Invalid YCbCr subsampling");				return 0;			}			scanline = TIFFroundup(td->td_imagewidth,					       ycbcrsubsampling[0]);			scanline = TIFFhowmany8(multiply(tif, scanline,							 td->td_bitspersample,							 "TIFFScanlineSize"));			return ((tsize_t)				summarize(tif, scanline,					  multiply(tif, 2,						scanline / ycbcrsubsampling[0],						"TIFFVStripSize"),					  "TIFFVStripSize"));		} else {			scanline = multiply(tif, td->td_imagewidth,					    td->td_samplesperpixel,					    "TIFFScanlineSize");		}	} else		scanline = td->td_imagewidth;	return ((tsize_t) TIFFhowmany8(multiply(tif, scanline,						td->td_bitspersample,						"TIFFScanlineSize")));}/* * Some stuff depends on this older version of TIFFScanlineSize * TODO: resolve this */tsize_tTIFFOldScanlineSize(TIFF* tif){	TIFFDirectory *td = &tif->tif_dir;	tsize_t scanline;	scanline = multiply (tif, td->td_bitspersample, td->td_imagewidth,			     "TIFFScanlineSize");	if (td->td_planarconfig == PLANARCONFIG_CONTIG)		scanline = multiply (tif, scanline, td->td_samplesperpixel,				     "TIFFScanlineSize");	return ((tsize_t) TIFFhowmany8(scanline));}/* * Return the number of bytes to read/write in a call to * one of the scanline-oriented i/o routines.  Note that * this number may be 1/samples-per-pixel if data is * stored as separate planes. * The ScanlineSize in case of YCbCrSubsampling is defined as the * strip size divided by the strip height, i.e. the size of a pack of vertical * subsampling lines divided by vertical subsampling. It should thus make * sense when multiplied by a multiple of vertical subsampling. * Some stuff depends on this newer version of TIFFScanlineSize * TODO: resolve this */tsize_tTIFFNewScanlineSize(TIFF* tif){	TIFFDirectory *td = &tif->tif_dir;	tsize_t scanline;	if (td->td_planarconfig == PLANARCONFIG_CONTIG) {		if (td->td_photometric == PHOTOMETRIC_YCBCR		    && !isUpSampled(tif)) {			uint16 ycbcrsubsampling[2];			TIFFGetField(tif, TIFFTAG_YCBCRSUBSAMPLING,				     ycbcrsubsampling + 0,				     ycbcrsubsampling + 1);			if (ycbcrsubsampling[0]*ycbcrsubsampling[1] == 0) {				TIFFErrorExt(tif->tif_clientdata, tif->tif_name,					     "Invalid YCbCr subsampling");				return 0;			}			return((tsize_t) ((((td->td_imagewidth+ycbcrsubsampling[0]-1)					    /ycbcrsubsampling[0])					   *(ycbcrsubsampling[0]*ycbcrsubsampling[1]+2)					   *td->td_bitspersample+7)					  /8)/ycbcrsubsampling[1]);		} else {			scanline = multiply(tif, td->td_imagewidth,					    td->td_samplesperpixel,					    "TIFFScanlineSize");		}	} else		scanline = td->td_imagewidth;	return ((tsize_t) TIFFhowmany8(multiply(tif, scanline,						td->td_bitspersample,						"TIFFScanlineSize")));}/* * Return the number of bytes required to store a complete * decoded and packed raster scanline (as opposed to the * I/O size returned by TIFFScanlineSize which may be less * if data is store as separate planes). */tsize_tTIFFRasterScanlineSize(TIFF* tif){	TIFFDirectory *td = &tif->tif_dir;	tsize_t scanline;		scanline = multiply (tif, td->td_bitspersample, td->td_imagewidth,			     "TIFFRasterScanlineSize");	if (td->td_planarconfig == PLANARCONFIG_CONTIG) {		scanline = multiply (tif, scanline, td->td_samplesperpixel,				     "TIFFRasterScanlineSize");		return ((tsize_t) TIFFhowmany8(scanline));	} else		return ((tsize_t) multiply (tif, TIFFhowmany8(scanline),					    td->td_samplesperpixel,					    "TIFFRasterScanlineSize"));}/* vim: set ts=8 sts=8 sw=8 noet: */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕不卡在线观看| 午夜精品久久一牛影视| 欧美日本一道本| 91网址在线看| 国产在线播放一区三区四| 亚洲欧洲韩国日本视频 | 国产激情偷乱视频一区二区三区| 日韩精品一区二区三区老鸭窝| 不卡一区二区在线| 午夜精品成人在线| 亚洲一级不卡视频| 亚洲与欧洲av电影| 亚洲观看高清完整版在线观看| 一区二区在线免费| 亚洲成人av资源| 日韩 欧美一区二区三区| 日日摸夜夜添夜夜添精品视频 | 国产精品免费aⅴ片在线观看| 日韩免费福利电影在线观看| 日韩欧美亚洲一区二区| 国产日韩欧美一区二区三区综合| 欧美国产禁国产网站cc| 亚洲精品免费视频| 亚洲成在人线免费| 国产精品水嫩水嫩| 琪琪久久久久日韩精品| 国产一区啦啦啦在线观看| av爱爱亚洲一区| 亚洲精品一区二区三区精华液 | 精品久久久久久久人人人人传媒 | 日韩精品一区二区三区在线观看| 26uuu亚洲综合色| 亚洲在线视频一区| 国产一区免费电影| 欧美r级电影在线观看| 亚洲一区二区视频在线| 午夜久久久影院| 99久久精品久久久久久清纯| 在线观看日韩电影| 国产欧美日韩视频一区二区| 99久久精品久久久久久清纯| 91精品福利在线| 亚洲韩国精品一区| 欧美一区国产二区| 亚洲免费在线播放| av电影在线观看不卡| 国产精品乱码人人做人人爱| 91色在线porny| 日本三级韩国三级欧美三级| 欧美美女网站色| 风间由美一区二区av101| 中文字幕一区二区三| 欧美熟乱第一页| 成人永久看片免费视频天堂| 夜夜亚洲天天久久| 国产欧美一二三区| 欧美日韩成人激情| 成人免费观看男女羞羞视频| 欧美一区二区精品在线| 亚洲在线视频免费观看| 91麻豆精品久久久久蜜臀| 成人高清免费观看| 国产制服丝袜一区| 日本不卡免费在线视频| 亚洲亚洲人成综合网络| 国产精品久久国产精麻豆99网站| 91麻豆精品国产91久久久 | 亚洲精品国产一区二区精华液 | 日本在线不卡视频一二三区| 中文字幕中文乱码欧美一区二区| 欧美成人一区二区三区在线观看| 在线观看国产日韩| 99久久国产免费看| www.欧美日韩| 欧美性感一区二区三区| 色8久久精品久久久久久蜜| 高清shemale亚洲人妖| 成人毛片在线观看| 色综合天天综合狠狠| 一道本成人在线| 欧美一区二区三区免费大片| 欧美午夜精品久久久久久孕妇| 色哟哟国产精品| 日韩一区二区精品| 久久久久国产精品免费免费搜索| 色婷婷精品大在线视频| 在线视频欧美区| 日韩精品中文字幕一区| 国产精品电影院| 亚洲午夜在线视频| 精品午夜久久福利影院| 91国偷自产一区二区三区观看| 亚洲青青青在线视频| 一区二区三区加勒比av| 日韩高清国产一区在线| 不卡av电影在线播放| 日韩一二三区不卡| 国产婷婷精品av在线| 亚洲成人av一区| 波多野结衣在线一区| 日韩午夜在线播放| 亚洲欧美另类久久久精品2019| 秋霞av亚洲一区二区三| 91丨porny丨蝌蚪视频| 久久婷婷色综合| 久久成人免费电影| 7777精品伊人久久久大香线蕉经典版下载 | 亚洲国产精品传媒在线观看| 久久国内精品自在自线400部| 日韩一区二区在线观看视频| 亚洲国产精品久久久久秋霞影院 | 婷婷成人综合网| 在线观看不卡视频| 日本亚洲一区二区| 一本一道综合狠狠老| 精品日韩在线观看| 国产在线视频一区二区三区| 日韩女优电影在线观看| 日本伊人午夜精品| www国产精品av| 岛国av在线一区| 怡红院av一区二区三区| 不卡一区二区在线| 亚洲最快最全在线视频| 在线成人av网站| 国产黄色成人av| 亚洲超碰精品一区二区| 精品免费99久久| 91久久国产最好的精华液| 免费成人av在线| 国产精品麻豆网站| 欧美性极品少妇| 成人免费视频一区| 99久久精品免费精品国产| av一区二区不卡| 精品久久人人做人人爽| 日韩av一区二区三区四区| 亚洲裸体xxx| 中文在线资源观看网站视频免费不卡| 成人av电影免费在线播放| 麻豆精品在线看| 一级中文字幕一区二区| 亚洲天堂免费看| 久久夜色精品一区| 欧美成人猛片aaaaaaa| 色婷婷综合久久久久中文一区二区 | 男女男精品网站| 日韩精品一二三四| 蜜桃一区二区三区四区| 欧美aaa在线| 午夜精品久久久久久久久久| 樱花草国产18久久久久| 亚洲自拍偷拍欧美| 亚洲国产精品久久不卡毛片 | 制服.丝袜.亚洲.另类.中文| 欧美三级蜜桃2在线观看| 欧美日韩美女一区二区| 欧美另类高清zo欧美| 精品三级在线看| 日韩美女视频一区| 视频一区二区三区在线| 精品一区二区精品| 成人蜜臀av电影| 欧美日韩大陆一区二区| 精品捆绑美女sm三区| 国产精品理论片在线观看| 一区二区三区四区精品在线视频| 亚洲精品伦理在线| 狠狠色狠狠色合久久伊人| 99久久国产综合色|国产精品| 欧美日韩成人综合在线一区二区| 在线一区二区三区| 欧美精品精品一区| 中文字幕一区av| 久久国内精品视频| 91国产成人在线| 欧美高清一级片在线观看| 亚洲不卡在线观看| 99久久精品情趣| 国产精品三级电影| 国产在线精品免费av| 欧美一区日本一区韩国一区| 最新欧美精品一区二区三区| 国产精品一区在线观看乱码| 91精品国产欧美日韩| 日韩va欧美va亚洲va久久| 欧美日韩精品一二三区| 亚洲国产精品久久久久秋霞影院 | 欧美一区二区三级| 午夜成人在线视频| 欧美日韩电影在线| 日日欢夜夜爽一区| 欧美大度的电影原声| 激情欧美一区二区三区在线观看| 在线不卡免费欧美| 久久精品国产亚洲aⅴ| 久久久久国产精品免费免费搜索| 国产精品亚洲一区二区三区在线| 成人免费高清在线| 一区二区欧美在线观看|