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

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

?? tif_jpeg.c

?? 支持各種柵格圖像和矢量圖像讀取的庫
?? C
?? 第 1 頁 / 共 4 頁
字號(hào):
			if (TIFFjpeg_write_raw_data(sp, sp->ds_buffer, n) != n)				return (0);			sp->scancount = 0;		}		tif->tif_row += sp->v_sampling;		buf += sp->bytesperline;		nrows -= sp->v_sampling;	}	return (1);}/* * Finish up at the end of a strip or tile. */static intJPEGPostEncode(TIFF* tif){	JPEGState *sp = JState(tif);	if (sp->scancount > 0) {		/*		 * Need to emit a partial bufferload of downsampled data.		 * Pad the data vertically.		 */		int ci, ypos, n;		jpeg_component_info* compptr;		for (ci = 0, compptr = sp->cinfo.c.comp_info;		     ci < sp->cinfo.c.num_components;		     ci++, compptr++) {			int vsamp = compptr->v_samp_factor;			tsize_t row_width = compptr->width_in_blocks * DCTSIZE				* sizeof(JSAMPLE);			for (ypos = sp->scancount * vsamp;			     ypos < DCTSIZE * vsamp; ypos++) {				_TIFFmemcpy((tdata_t)sp->ds_buffer[ci][ypos],					    (tdata_t)sp->ds_buffer[ci][ypos-1],					    row_width);			}		}		n = sp->cinfo.c.max_v_samp_factor * DCTSIZE;		if (TIFFjpeg_write_raw_data(sp, sp->ds_buffer, n) != n)			return (0);	}	return (TIFFjpeg_finish_compress(JState(tif)));}static voidJPEGCleanup(TIFF* tif){	JPEGState *sp = JState(tif);		assert(sp != 0);	tif->tif_tagmethods.vgetfield = sp->vgetparent;	tif->tif_tagmethods.vsetfield = sp->vsetparent;	tif->tif_tagmethods.printdir = sp->printdir;	if( sp->cinfo_initialized )	    TIFFjpeg_destroy(sp);	/* release libjpeg resources */	if (sp->jpegtables)		/* tag value */		_TIFFfree(sp->jpegtables);	_TIFFfree(tif->tif_data);	/* release local state */	tif->tif_data = NULL;	_TIFFSetDefaultCompressionState(tif);}static void JPEGResetUpsampled( TIFF* tif ){	JPEGState* sp = JState(tif);	TIFFDirectory* td = &tif->tif_dir;	/*	 * Mark whether returned data is up-sampled or not so TIFFStripSize	 * and TIFFTileSize return values that reflect the true amount of	 * data.	 */	tif->tif_flags &= ~TIFF_UPSAMPLED;	if (td->td_planarconfig == PLANARCONFIG_CONTIG) {		if (td->td_photometric == PHOTOMETRIC_YCBCR &&		    sp->jpegcolormode == JPEGCOLORMODE_RGB) {			tif->tif_flags |= TIFF_UPSAMPLED;		} else {#ifdef notdef			if (td->td_ycbcrsubsampling[0] != 1 ||			    td->td_ycbcrsubsampling[1] != 1)				; /* XXX what about up-sampling? */#endif		}	}	/*	 * Must recalculate cached tile size in case sampling state changed.	 * Should we really be doing this now if image size isn't set? 	 */	tif->tif_tilesize = isTiled(tif) ? TIFFTileSize(tif) : (tsize_t) -1;}static intJPEGVSetField(TIFF* tif, ttag_t tag, va_list ap){	JPEGState* sp = JState(tif);	const TIFFFieldInfo* fip;	uint32 v32;	assert(sp != NULL);	switch (tag) {	case TIFFTAG_JPEGTABLES:		v32 = va_arg(ap, uint32);		if (v32 == 0) {			/* XXX */			return (0);		}		_TIFFsetByteArray(&sp->jpegtables, va_arg(ap, void*),		    (long) v32);		sp->jpegtables_length = v32;		TIFFSetFieldBit(tif, FIELD_JPEGTABLES);		break;	case TIFFTAG_JPEGQUALITY:		sp->jpegquality = va_arg(ap, int);		return (1);			/* pseudo tag */	case TIFFTAG_JPEGCOLORMODE:		sp->jpegcolormode = va_arg(ap, int);                JPEGResetUpsampled( tif );		return (1);			/* pseudo tag */	case TIFFTAG_PHOTOMETRIC:        {                int ret_value = (*sp->vsetparent)(tif, tag, ap);                JPEGResetUpsampled( tif );                return ret_value;        }	case TIFFTAG_JPEGTABLESMODE:		sp->jpegtablesmode = va_arg(ap, int);		return (1);			/* pseudo tag */	case TIFFTAG_YCBCRSUBSAMPLING:                /* mark the fact that we have a real ycbcrsubsampling! */		sp->ycbcrsampling_fetched = 1;                /* should we be recomputing upsampling info here? */		return (*sp->vsetparent)(tif, tag, ap);	case TIFFTAG_FAXRECVPARAMS:		sp->recvparams = va_arg(ap, uint32);		break;	case TIFFTAG_FAXSUBADDRESS:		_TIFFsetString(&sp->subaddress, va_arg(ap, char*));		break;	case TIFFTAG_FAXRECVTIME:		sp->recvtime = va_arg(ap, uint32);		break;	case TIFFTAG_FAXDCS:		_TIFFsetString(&sp->faxdcs, va_arg(ap, char*));		break;	default:		return (*sp->vsetparent)(tif, tag, ap);	}	if ((fip = _TIFFFieldWithTag(tif, tag))) {		TIFFSetFieldBit(tif, fip->field_bit);	} else {		return (0);	}	tif->tif_flags |= TIFF_DIRTYDIRECT;	return (1);}/* * Some JPEG-in-TIFF produces do not emit the YCBCRSUBSAMPLING values in * the TIFF tags, but still use non-default (2,2) values within the jpeg * data stream itself.  In order for TIFF applications to work properly * - for instance to get the strip buffer size right - it is imperative * that the subsampling be available before we start reading the image * data normally.  This function will attempt to load the first strip in * order to get the sampling values from the jpeg data stream.  Various * hacks are various places are done to ensure this function gets called * before the td_ycbcrsubsampling values are used from the directory structure, * including calling TIFFGetField() for the YCBCRSUBSAMPLING field from  * TIFFStripSize(), and the printing code in tif_print.c.  * * Note that JPEGPreDeocode() will produce a fairly loud warning when the * discovered sampling does not match the default sampling (2,2) or whatever * was actually in the tiff tags.  * * Problems: *  o This code will cause one whole strip/tile of compressed data to be *    loaded just to get the tags right, even if the imagery is never read. *    It would be more efficient to just load a bit of the header, and *    initialize things from that.  * * See the bug in bugzilla for details: * * http://bugzilla.remotesensing.org/show_bug.cgi?id=168 * * Frank Warmerdam, July 2002 */static void JPEGFixupTestSubsampling( TIFF * tif ){#ifdef CHECK_JPEG_YCBCR_SUBSAMPLING    JPEGState *sp = JState(tif);    TIFFDirectory *td = &tif->tif_dir;    JPEGInitializeLibJPEG( tif, 0, 0 );    /*     * Some JPEG-in-TIFF files don't provide the ycbcrsampling tags,      * and use a sampling schema other than the default 2,2.  To handle     * this we actually have to scan the header of a strip or tile of     * jpeg data to get the sampling.       */    if( !sp->cinfo.comm.is_decompressor         || sp->ycbcrsampling_fetched          || td->td_photometric != PHOTOMETRIC_YCBCR )        return;    sp->ycbcrsampling_fetched = 1;    if( TIFFIsTiled( tif ) )    {        if( !TIFFFillTile( tif, 0 ) )			return;    }    else	{        if( !TIFFFillStrip( tif, 0 ) )            return;    }    TIFFSetField( tif, TIFFTAG_YCBCRSUBSAMPLING,                   (uint16) sp->h_sampling, (uint16) sp->v_sampling );#endif /* CHECK_JPEG_YCBCR_SUBSAMPLING */}static intJPEGVGetField(TIFF* tif, ttag_t tag, va_list ap){	JPEGState* sp = JState(tif);	assert(sp != NULL);	switch (tag) {		case TIFFTAG_JPEGTABLES:			*va_arg(ap, uint32*) = sp->jpegtables_length;			*va_arg(ap, void**) = sp->jpegtables;			break;		case TIFFTAG_JPEGQUALITY:			*va_arg(ap, int*) = sp->jpegquality;			break;		case TIFFTAG_JPEGCOLORMODE:			*va_arg(ap, int*) = sp->jpegcolormode;			break;		case TIFFTAG_JPEGTABLESMODE:			*va_arg(ap, int*) = sp->jpegtablesmode;			break;		case TIFFTAG_YCBCRSUBSAMPLING:			JPEGFixupTestSubsampling( tif );			return (*sp->vgetparent)(tif, tag, ap);		case TIFFTAG_FAXRECVPARAMS:			*va_arg(ap, uint32*) = sp->recvparams;			break;		case TIFFTAG_FAXSUBADDRESS:			*va_arg(ap, char**) = sp->subaddress;			break;		case TIFFTAG_FAXRECVTIME:			*va_arg(ap, uint32*) = sp->recvtime;			break;		case TIFFTAG_FAXDCS:			*va_arg(ap, char**) = sp->faxdcs;			break;		default:			return (*sp->vgetparent)(tif, tag, ap);	}	return (1);}static voidJPEGPrintDir(TIFF* tif, FILE* fd, long flags){	JPEGState* sp = JState(tif);	assert(sp != NULL);	(void) flags;	if (TIFFFieldSet(tif,FIELD_JPEGTABLES))		fprintf(fd, "  JPEG Tables: (%lu bytes)\n",			(unsigned long) sp->jpegtables_length);        if (TIFFFieldSet(tif,FIELD_RECVPARAMS))                fprintf(fd, "  Fax Receive Parameters: %08lx\n",                   (unsigned long) sp->recvparams);        if (TIFFFieldSet(tif,FIELD_SUBADDRESS))                fprintf(fd, "  Fax SubAddress: %s\n", sp->subaddress);        if (TIFFFieldSet(tif,FIELD_RECVTIME))                fprintf(fd, "  Fax Receive Time: %lu secs\n",                    (unsigned long) sp->recvtime);        if (TIFFFieldSet(tif,FIELD_FAXDCS))                fprintf(fd, "  Fax DCS: %s\n", sp->faxdcs);}static uint32JPEGDefaultStripSize(TIFF* tif, uint32 s){	JPEGState* sp = JState(tif);	TIFFDirectory *td = &tif->tif_dir;	s = (*sp->defsparent)(tif, s);	if (s < td->td_imagelength)		s = TIFFroundup(s, td->td_ycbcrsubsampling[1] * DCTSIZE);	return (s);}static voidJPEGDefaultTileSize(TIFF* tif, uint32* tw, uint32* th){	JPEGState* sp = JState(tif);	TIFFDirectory *td = &tif->tif_dir;	(*sp->deftparent)(tif, tw, th);	*tw = TIFFroundup(*tw, td->td_ycbcrsubsampling[0] * DCTSIZE);	*th = TIFFroundup(*th, td->td_ycbcrsubsampling[1] * DCTSIZE);}/* * The JPEG library initialized used to be done in TIFFInitJPEG(), but * now that we allow a TIFF file to be opened in update mode it is necessary * to have some way of deciding whether compression or decompression is * desired other than looking at tif->tif_mode.  We accomplish this by  * examining {TILE/STRIP}BYTECOUNTS to see if there is a non-zero entry. * If so, we assume decompression is desired.  * * This is tricky, because TIFFInitJPEG() is called while the directory is * being read, and generally speaking the BYTECOUNTS tag won't have been read * at that point.  So we try to defer jpeg library initialization till we * do have that tag ... basically any access that might require the compressor * or decompressor that occurs after the reading of the directory.  * * In an ideal world compressors or decompressors would be setup * at the point where a single tile or strip was accessed (for read or write) * so that stuff like update of missing tiles, or replacement of tiles could * be done. However, we aren't trying to crack that nut just yet ... * * NFW, Feb 3rd, 2003. */static int JPEGInitializeLibJPEG( TIFF * tif, int force_encode, int force_decode ){    JPEGState* sp = JState(tif);    uint32 *byte_counts = NULL;    int     data_is_empty = TRUE;    int     decompress;    if(sp->cinfo_initialized)        return 1;    /*     * Do we have tile data already?  Make sure we initialize the     * the state in decompressor mode if we have tile data, even if we     * are not in read-only file access mode.      */    if( TIFFIsTiled( tif )         && TIFFGetField( tif, TIFFTAG_TILEBYTECOUNTS, &byte_counts )         && byte_counts != NULL )    {        data_is_empty = byte_counts[0] == 0;    }    if( !TIFFIsTiled( tif )         && TIFFGetField( tif, TIFFTAG_STRIPBYTECOUNTS, &byte_counts)         && byte_counts != NULL )    {        data_is_empty = byte_counts[0] == 0;    }    if( force_decode )        decompress = 1;    else if( force_encode )        decompress = 0;    else if( tif->tif_mode == O_RDONLY )        decompress = 1;    else if( data_is_empty )        decompress = 0;    else        decompress = 1;    /*     * Initialize libjpeg.     */    if ( decompress ) {        if (!TIFFjpeg_create_decompress(sp))            return (0);    } else {        if (!TIFFjpeg_create_compress(sp))            return (0);    }    sp->cinfo_initialized = TRUE;    return 1;}intTIFFInitJPEG(TIFF* tif, int scheme){	JPEGState* sp;	assert(scheme == COMPRESSION_JPEG);	/*	 * Allocate state block so tag methods have storage to record values.	 */	tif->tif_data = (tidata_t) _TIFFmalloc(sizeof (JPEGState));	if (tif->tif_data == NULL) {		TIFFErrorExt(tif->tif_clientdata,			     "TIFFInitJPEG", "No space for JPEG state block");		return (0);	}        _TIFFmemset( tif->tif_data, 0, sizeof(JPEGState));	sp = JState(tif);	sp->tif = tif;				/* back link */	/*	 * Merge codec-specific tag information and override parent get/set	 * field methods.	 */	_TIFFMergeFieldInfo(tif, jpegFieldInfo, N(jpegFieldInfo));	sp->vgetparent = tif->tif_tagmethods.vgetfield;	tif->tif_tagmethods.vgetfield = JPEGVGetField; /* hook for codec tags */	sp->vsetparent = tif->tif_tagmethods.vsetfield;	tif->tif_tagmethods.vsetfield = JPEGVSetField; /* hook for codec tags */	sp->printdir = tif->tif_tagmethods.printdir;	tif->tif_tagmethods.printdir = JPEGPrintDir;   /* hook for codec tags */	/* Default values for codec-specific fields */	sp->jpegtables = NULL;	sp->jpegtables_length = 0;	sp->jpegquality = 75;			/* Default IJG quality */	sp->jpegcolormode = JPEGCOLORMODE_RAW;	sp->jpegtablesmode = JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF;        sp->recvparams = 0;        sp->subaddress = NULL;        sp->faxdcs = NULL;        sp->ycbcrsampling_fetched = 0;	/*	 * Install codec methods.	 */	tif->tif_setupdecode = JPEGSetupDecode;	tif->tif_predecode = JPEGPreDecode;	tif->tif_decoderow = JPEGDecode;	tif->tif_decodestrip = JPEGDecode;	tif->tif_decodetile = JPEGDecode;	tif->tif_setupencode = JPEGSetupEncode;	tif->tif_preencode = JPEGPreEncode;	tif->tif_postencode = JPEGPostEncode;	tif->tif_encoderow = JPEGEncode;	tif->tif_encodestrip = JPEGEncode;	tif->tif_encodetile = JPEGEncode;	tif->tif_cleanup = JPEGCleanup;	sp->defsparent = tif->tif_defstripsize;	tif->tif_defstripsize = JPEGDefaultStripSize;	sp->deftparent = tif->tif_deftilesize;	tif->tif_deftilesize = JPEGDefaultTileSize;	tif->tif_flags |= TIFF_NOBITREV;	/* no bit reversal, please */        sp->cinfo_initialized = FALSE;	/*        ** Create a JPEGTables field if no directory has yet been created.         ** We do this just to ensure that sufficient space is reserved for        ** the JPEGTables field.  It will be properly created the right        ** size later.         */        if( tif->tif_diroff == 0 )        {#define SIZE_OF_JPEGTABLES 2000            TIFFSetFieldBit(tif, FIELD_JPEGTABLES);            sp->jpegtables_length = SIZE_OF_JPEGTABLES;            sp->jpegtables = (void *) _TIFFmalloc(sp->jpegtables_length);	    _TIFFmemset(sp->jpegtables, 0, SIZE_OF_JPEGTABLES);#undef SIZE_OF_JPEGTABLES        }        /*         * Mark the TIFFTAG_YCBCRSAMPLES as present even if it is not         * see: JPEGFixupTestSubsampling().         */        TIFFSetFieldBit( tif, FIELD_YCBCRSUBSAMPLING );	return 1;}#endif /* JPEG_SUPPORT *//* 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一区二区三区免费野_久草精品视频
国产午夜精品一区二区| 亚洲免费成人av| 久久精品综合网| 日本一区二区免费在线| 亚洲欧美影音先锋| 视频一区视频二区中文| 久久精品国产第一区二区三区| 国产精品一区一区三区| 波多野结衣中文字幕一区二区三区| 美女视频黄 久久| 成人午夜激情影院| 自拍偷拍欧美精品| 欧美精品黑人性xxxx| 国产人妖乱国产精品人妖| 亚洲另类中文字| 精品一二三四区| youjizz国产精品| 欧美精品色综合| 久久免费偷拍视频| 亚洲电影一区二区三区| 国产精品一级片在线观看| 欧美性极品少妇| 中国av一区二区三区| 三级精品在线观看| 色综合一区二区三区| 精品国产不卡一区二区三区| 亚洲永久精品大片| 成人一区二区三区| 欧美一区二区精品久久911| 亚洲免费视频成人| 国内偷窥港台综合视频在线播放| 91国产福利在线| 欧美激情一二三区| 精品一区二区三区免费毛片爱| 日本高清不卡aⅴ免费网站| 久久久美女毛片| 日本亚洲欧美天堂免费| 日本精品一区二区三区四区的功能| 欧美v日韩v国产v| 日韩在线卡一卡二| 欧美日韩在线一区二区| 亚洲人成电影网站色mp4| 国产精品资源在线| 精品1区2区在线观看| 日日摸夜夜添夜夜添精品视频| 色综合色综合色综合| 国产精品妹子av| 成人天堂资源www在线| 欧美白人最猛性xxxxx69交| 美女一区二区视频| 欧美日韩国产综合一区二区三区| 亚洲激情在线激情| 91麻豆免费在线观看| 中文字幕欧美一区| 成人激情黄色小说| 国产精品电影一区二区| 不卡高清视频专区| 国产精品国产a| 色系网站成人免费| 亚洲综合一区二区三区| 欧美日韩一区二区三区四区五区| 亚洲成人av中文| 在线电影欧美成精品| 91久久精品国产91性色tv| 精品国产免费久久| 青青国产91久久久久久 | 亚洲天堂福利av| 成人av免费网站| 亚洲精品美国一| 欧美军同video69gay| 免费成人你懂的| 久久精品夜色噜噜亚洲a∨| 成人激情av网| 樱花影视一区二区| 51精品秘密在线观看| 精品制服美女丁香| 国产情人综合久久777777| kk眼镜猥琐国模调教系列一区二区 | 91丝袜国产在线播放| 亚洲欧美日韩一区二区 | 国产精品一线二线三线精华| 国产亚洲一区字幕| 99久久精品国产麻豆演员表| 亚洲一区国产视频| 日韩视频永久免费| 国产91丝袜在线播放0| 亚洲欧美区自拍先锋| 欧美疯狂性受xxxxx喷水图片| 激情文学综合丁香| 亚洲人成亚洲人成在线观看图片| 欧美精品在线视频| 国产综合久久久久影院| 亚洲欧洲中文日韩久久av乱码| 欧美人牲a欧美精品| 国产精品小仙女| 亚洲午夜激情网站| 国产肉丝袜一区二区| 欧美日韩亚洲另类| 国产高清不卡一区二区| 亚洲成人自拍一区| 亚洲国产高清在线| 91精品国产一区二区三区 | 国产成人av一区二区三区在线| 亚洲精品欧美激情| 久久伊人蜜桃av一区二区| 国产91高潮流白浆在线麻豆 | 亚洲精品一区二区三区99| 色综合欧美在线| 精品一区二区三区久久久| 一区二区中文字幕在线| 日韩美一区二区三区| 欧洲视频一区二区| caoporm超碰国产精品| 国产综合成人久久大片91| 亚洲综合一区二区三区| 亚洲成av人片在线观看无码| 欧美国产精品久久| 欧美mv和日韩mv国产网站| 欧美日韩一区二区三区四区 | 成人av免费网站| 九色综合狠狠综合久久| 亚洲成人免费视频| 亚洲精品国产无天堂网2021| 国产女人18毛片水真多成人如厕| 91精品久久久久久蜜臀| 欧美日韩国产大片| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 成人永久免费视频| 免费欧美在线视频| 一区二区久久久久| 国产精品久久99| 国产色产综合色产在线视频| 精品国精品国产| 欧美xxxxxxxx| 欧美成人艳星乳罩| 日韩午夜精品视频| 日韩一区二区麻豆国产| 制服丝袜亚洲精品中文字幕| 欧美手机在线视频| 欧美亚洲综合久久| 在线观看www91| 欧美日韩在线电影| 欧美日韩美女一区二区| 欧美日精品一区视频| 色乱码一区二区三区88| 色婷婷av一区二区三区gif | 欧美一区二区三区小说| 欧美丰满美乳xxx高潮www| 欧美日韩精品高清| 在线电影一区二区三区| 91精品国产麻豆国产自产在线 | 91精品欧美福利在线观看| 欧美丝袜第三区| 欧美一区二区精品久久911| 日韩一区二区精品在线观看| 制服丝袜亚洲播放| 日韩三级免费观看| 欧美一区二区在线看| 欧美sm极限捆绑bd| 国产午夜精品一区二区| 亚洲少妇中出一区| 亚洲丰满少妇videoshd| 亚洲国产精品久久人人爱蜜臀| 亚洲一区二区欧美| 午夜a成v人精品| 国产在线视频精品一区| 国产aⅴ精品一区二区三区色成熟| 成人手机电影网| 欧美日韩一级黄| 欧美一二三区在线观看| 国产亚洲精品aa| 亚洲中国最大av网站| 日本欧美一区二区在线观看| 久久99在线观看| 成人性生交大片免费看中文网站| 91丨porny丨蝌蚪视频| 91精品国产综合久久久久久漫画| 久久这里只有精品首页| 亚洲免费在线观看| 日本欧美肥老太交大片| 国产成人午夜电影网| 在线亚洲一区二区| 欧美成人vps| 亚洲精品国产一区二区三区四区在线 | 国产精品77777| 在线观看亚洲精品| 2020国产精品自拍| 伊人色综合久久天天人手人婷| 日韩和的一区二区| 丁香婷婷综合五月| 91精品国产色综合久久不卡电影 | 亚洲国产成人高清精品| 蜜桃av一区二区在线观看| 国产91精品在线观看| 欧美日韩国产一二三| 国产精品无圣光一区二区| 日本欧美一区二区三区乱码| 91麻豆精东视频| 精品国产凹凸成av人导航| 一区二区三国产精华液|