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

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

?? tif_jpeg.c

?? 支持各種柵格圖像和矢量圖像讀取的庫
?? C
?? 第 1 頁 / 共 4 頁
字號:
	return (1);}/* * JPEG library source data manager. * These routines supply compressed data to libjpeg. */static voidstd_init_source(j_decompress_ptr cinfo){	JPEGState* sp = (JPEGState*) cinfo;	TIFF* tif = sp->tif;	sp->src.next_input_byte = (const JOCTET*) tif->tif_rawdata;	sp->src.bytes_in_buffer = (size_t) tif->tif_rawcc;}static booleanstd_fill_input_buffer(j_decompress_ptr cinfo){	JPEGState* sp = (JPEGState* ) cinfo;	static const JOCTET dummy_EOI[2] = { 0xFF, JPEG_EOI };	/*	 * Should never get here since entire strip/tile is	 * read into memory before the decompressor is called,	 * and thus was supplied by init_source.	 */	WARNMS(cinfo, JWRN_JPEG_EOF);	/* insert a fake EOI marker */	sp->src.next_input_byte = dummy_EOI;	sp->src.bytes_in_buffer = 2;	return (TRUE);}static voidstd_skip_input_data(j_decompress_ptr cinfo, long num_bytes){	JPEGState* sp = (JPEGState*) cinfo;	if (num_bytes > 0) {		if (num_bytes > (long) sp->src.bytes_in_buffer) {			/* oops, buffer overrun */			(void) std_fill_input_buffer(cinfo);		} else {			sp->src.next_input_byte += (size_t) num_bytes;			sp->src.bytes_in_buffer -= (size_t) num_bytes;		}	}}static voidstd_term_source(j_decompress_ptr cinfo){	/* No work necessary here */	/* Or must we update tif->tif_rawcp, tif->tif_rawcc ??? */	/* (if so, need empty tables_term_source!) */	(void) cinfo;}static voidTIFFjpeg_data_src(JPEGState* sp, TIFF* tif){	(void) tif;	sp->cinfo.d.src = &sp->src;	sp->src.init_source = std_init_source;	sp->src.fill_input_buffer = std_fill_input_buffer;	sp->src.skip_input_data = std_skip_input_data;	sp->src.resync_to_restart = jpeg_resync_to_restart;	sp->src.term_source = std_term_source;	sp->src.bytes_in_buffer = 0;		/* for safety */	sp->src.next_input_byte = NULL;}/* * Alternate source manager for reading from JPEGTables. * We can share all the code except for the init routine. */static voidtables_init_source(j_decompress_ptr cinfo){	JPEGState* sp = (JPEGState*) cinfo;	sp->src.next_input_byte = (const JOCTET*) sp->jpegtables;	sp->src.bytes_in_buffer = (size_t) sp->jpegtables_length;}static voidTIFFjpeg_tables_src(JPEGState* sp, TIFF* tif){	TIFFjpeg_data_src(sp, tif);	sp->src.init_source = tables_init_source;}/* * Allocate downsampled-data buffers needed for downsampled I/O. * We use values computed in jpeg_start_compress or jpeg_start_decompress. * We use libjpeg's allocator so that buffers will be released automatically * when done with strip/tile. * This is also a handy place to compute samplesperclump, bytesperline. */static intalloc_downsampled_buffers(TIFF* tif, jpeg_component_info* comp_info,			  int num_components){	JPEGState* sp = JState(tif);	int ci;	jpeg_component_info* compptr;	JSAMPARRAY buf;	int samples_per_clump = 0;	for (ci = 0, compptr = comp_info; ci < num_components;	     ci++, compptr++) {		samples_per_clump += compptr->h_samp_factor *			compptr->v_samp_factor;		buf = TIFFjpeg_alloc_sarray(sp, JPOOL_IMAGE,				compptr->width_in_blocks * DCTSIZE,				(JDIMENSION) (compptr->v_samp_factor*DCTSIZE));		if (buf == NULL)			return (0);		sp->ds_buffer[ci] = buf;	}	sp->samplesperclump = samples_per_clump;	return (1);}/* * JPEG Decoding. */static intJPEGSetupDecode(TIFF* tif){	JPEGState* sp = JState(tif);	TIFFDirectory *td = &tif->tif_dir;        JPEGInitializeLibJPEG( tif, 0, 1 );	assert(sp != NULL);	assert(sp->cinfo.comm.is_decompressor);	/* Read JPEGTables if it is present */	if (TIFFFieldSet(tif,FIELD_JPEGTABLES)) {		TIFFjpeg_tables_src(sp, tif);		if(TIFFjpeg_read_header(sp,FALSE) != JPEG_HEADER_TABLES_ONLY) {			TIFFErrorExt(tif->tif_clientdata, "JPEGSetupDecode", "Bogus JPEGTables field");			return (0);		}	}	/* Grab parameters that are same for all strips/tiles */	sp->photometric = td->td_photometric;	switch (sp->photometric) {	case PHOTOMETRIC_YCBCR:		sp->h_sampling = td->td_ycbcrsubsampling[0];		sp->v_sampling = td->td_ycbcrsubsampling[1];		break;	default:		/* TIFF 6.0 forbids subsampling of all other color spaces */		sp->h_sampling = 1;		sp->v_sampling = 1;		break;	}	/* Set up for reading normal data */	TIFFjpeg_data_src(sp, tif);	tif->tif_postdecode = _TIFFNoPostDecode; /* override byte swapping */	return (1);}/* * Set up for decoding a strip or tile. */static intJPEGPreDecode(TIFF* tif, tsample_t s){	JPEGState *sp = JState(tif);	TIFFDirectory *td = &tif->tif_dir;	static const char module[] = "JPEGPreDecode";	uint32 segment_width, segment_height;	int downsampled_output;	int ci;	assert(sp != NULL);	assert(sp->cinfo.comm.is_decompressor);	/*	 * Reset decoder state from any previous strip/tile,	 * in case application didn't read the whole strip.	 */	if (!TIFFjpeg_abort(sp))		return (0);	/*	 * Read the header for this strip/tile.	 */	if (TIFFjpeg_read_header(sp, TRUE) != JPEG_HEADER_OK)		return (0);	/*	 * Check image parameters and set decompression parameters.	 */	segment_width = td->td_imagewidth;	segment_height = td->td_imagelength - tif->tif_row;	if (isTiled(tif)) {                segment_width = td->td_tilewidth;                segment_height = td->td_tilelength;		sp->bytesperline = TIFFTileRowSize(tif);	} else {		if (segment_height > td->td_rowsperstrip)			segment_height = td->td_rowsperstrip;		sp->bytesperline = TIFFOldScanlineSize(tif);	}	if (td->td_planarconfig == PLANARCONFIG_SEPARATE && s > 0) {		/*		 * For PC 2, scale down the expected strip/tile size		 * to match a downsampled component		 */		segment_width = TIFFhowmany(segment_width, sp->h_sampling);		segment_height = TIFFhowmany(segment_height, sp->v_sampling);	}	if (sp->cinfo.d.image_width < segment_width ||	    sp->cinfo.d.image_height < segment_height) {		TIFFWarningExt(tif->tif_clientdata, module,			       "Improper JPEG strip/tile size, "			       "expected %dx%d, got %dx%d",			       segment_width, segment_height,			       sp->cinfo.d.image_width,			       sp->cinfo.d.image_height);	} 	if (sp->cinfo.d.image_width > segment_width ||	    sp->cinfo.d.image_height > segment_height) {		/*		 * This case could be dangerous, if the strip or tile size has		 * been reported as less than the amount of data jpeg will		 * return, some potential security issues arise. Catch this		 * case and error out.		 */		TIFFErrorExt(tif->tif_clientdata, module,			     "JPEG strip/tile size exceeds expected dimensions,"			     " expected %dx%d, got %dx%d",			     segment_width, segment_height,			     sp->cinfo.d.image_width, sp->cinfo.d.image_height);		return (0);	}	if (sp->cinfo.d.num_components !=	    (td->td_planarconfig == PLANARCONFIG_CONTIG ?	     td->td_samplesperpixel : 1)) {		TIFFErrorExt(tif->tif_clientdata, module, "Improper JPEG component count");		return (0);	}#ifdef JPEG_LIB_MK1	if (12 != td->td_bitspersample && 8 != td->td_bitspersample) {			TIFFErrorExt(tif->tif_clientdata, module, "Improper JPEG data precision");            return (0);	}        sp->cinfo.d.data_precision = td->td_bitspersample;        sp->cinfo.d.bits_in_jsample = td->td_bitspersample;#else	if (sp->cinfo.d.data_precision != td->td_bitspersample) {			TIFFErrorExt(tif->tif_clientdata, module, "Improper JPEG data precision");            return (0);	}#endif	if (td->td_planarconfig == PLANARCONFIG_CONTIG) {		/* Component 0 should have expected sampling factors */		if (sp->cinfo.d.comp_info[0].h_samp_factor != sp->h_sampling ||		    sp->cinfo.d.comp_info[0].v_samp_factor != sp->v_sampling) {				TIFFWarningExt(tif->tif_clientdata, module,                                    "Improper JPEG sampling factors %d,%d\n"                                    "Apparently should be %d,%d.",                                    sp->cinfo.d.comp_info[0].h_samp_factor,                                    sp->cinfo.d.comp_info[0].v_samp_factor,                                    sp->h_sampling, sp->v_sampling);				/*				 * There are potential security issues here				 * for decoders that have already allocated				 * buffers based on the expected sampling				 * factors. Lets check the sampling factors				 * dont exceed what we were expecting.				 */				if (sp->cinfo.d.comp_info[0].h_samp_factor					> sp->h_sampling				    || sp->cinfo.d.comp_info[0].v_samp_factor					> sp->v_sampling) {					TIFFErrorExt(tif->tif_clientdata,						     module,					"Cannot honour JPEG sampling factors"					" that exceed those specified.");					return (0);				}			    /*			     * XXX: Files written by the Intergraph software			     * has different sampling factors stored in the			     * TIFF tags and in the JPEG structures. We will			     * try to deduce Intergraph files by the presense			     * of the tag 33918.			     */			    if (!_TIFFFindFieldInfo(tif, 33918, TIFF_ANY)) {					TIFFWarningExt(tif->tif_clientdata, module,					"Decompressor will try reading with "					"sampling %d,%d.",					sp->cinfo.d.comp_info[0].h_samp_factor,					sp->cinfo.d.comp_info[0].v_samp_factor);				    sp->h_sampling = (uint16)					sp->cinfo.d.comp_info[0].h_samp_factor;				    sp->v_sampling = (uint16)					sp->cinfo.d.comp_info[0].v_samp_factor;			    }		}		/* Rest should have sampling factors 1,1 */		for (ci = 1; ci < sp->cinfo.d.num_components; ci++) {			if (sp->cinfo.d.comp_info[ci].h_samp_factor != 1 ||			    sp->cinfo.d.comp_info[ci].v_samp_factor != 1) {				TIFFErrorExt(tif->tif_clientdata, module, "Improper JPEG sampling factors");				return (0);			}		}	} else {		/* PC 2's single component should have sampling factors 1,1 */		if (sp->cinfo.d.comp_info[0].h_samp_factor != 1 ||		    sp->cinfo.d.comp_info[0].v_samp_factor != 1) {			TIFFErrorExt(tif->tif_clientdata, module, "Improper JPEG sampling factors");			return (0);		}	}	downsampled_output = FALSE;	if (td->td_planarconfig == PLANARCONFIG_CONTIG &&	    sp->photometric == PHOTOMETRIC_YCBCR &&	    sp->jpegcolormode == JPEGCOLORMODE_RGB) {	/* Convert YCbCr to RGB */		sp->cinfo.d.jpeg_color_space = JCS_YCbCr;		sp->cinfo.d.out_color_space = JCS_RGB;	} else {			/* Suppress colorspace handling */		sp->cinfo.d.jpeg_color_space = JCS_UNKNOWN;		sp->cinfo.d.out_color_space = JCS_UNKNOWN;		if (td->td_planarconfig == PLANARCONFIG_CONTIG &&		    (sp->h_sampling != 1 || sp->v_sampling != 1))			downsampled_output = TRUE;		/* XXX what about up-sampling? */	}	if (downsampled_output) {		/* Need to use raw-data interface to libjpeg */		sp->cinfo.d.raw_data_out = TRUE;		tif->tif_decoderow = JPEGDecodeRaw;		tif->tif_decodestrip = JPEGDecodeRaw;		tif->tif_decodetile = JPEGDecodeRaw;	} else {		/* Use normal interface to libjpeg */		sp->cinfo.d.raw_data_out = FALSE;		tif->tif_decoderow = JPEGDecode;		tif->tif_decodestrip = JPEGDecode;		tif->tif_decodetile = JPEGDecode;	}	/* Start JPEG decompressor */	if (!TIFFjpeg_start_decompress(sp))		return (0);	/* Allocate downsampled-data buffers if needed */	if (downsampled_output) {		if (!alloc_downsampled_buffers(tif, sp->cinfo.d.comp_info,					       sp->cinfo.d.num_components))			return (0);		sp->scancount = DCTSIZE;	/* mark buffer empty */	}	return (1);}/* * Decode a chunk of pixels. * "Standard" case: returned data is not downsampled. *//*ARGSUSED*/ static intJPEGDecode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s){    JPEGState *sp = JState(tif);    tsize_t nrows;    (void) s;    nrows = cc / sp->bytesperline;    if (cc % sp->bytesperline)		TIFFWarningExt(tif->tif_clientdata, tif->tif_name, "fractional scanline not read");    if( nrows > (int) sp->cinfo.d.image_height )        nrows = sp->cinfo.d.image_height;    /* data is expected to be read in multiples of a scanline */    if (nrows)    {        JSAMPROW line_work_buf = NULL;        /*        ** For 6B, only use temporary buffer for 12 bit imagery.         ** For Mk1 always use it.         */#if !defined(JPEG_LIB_MK1)                if( sp->cinfo.d.data_precision == 12 )#endif        {            line_work_buf = (JSAMPROW)                 _TIFFmalloc(sizeof(short) * sp->cinfo.d.output_width                             * sp->cinfo.d.num_components );        }        do {            if( line_work_buf != NULL )            {                /*                 ** In the MK1 case, we aways read into a 16bit buffer, and then                ** pack down to 12bit or 8bit.  In 6B case we only read into 16                ** bit buffer for 12bit data, which we need to repack.                 */                if (TIFFjpeg_read_scanlines(sp, &line_work_buf, 1) != 1)                    return (0);                if( sp->cinfo.d.data_precision == 12 )                {                    int value_pairs = (sp->cinfo.d.output_width                                        * sp->cinfo.d.num_components) / 2;                    int iPair;                    for( iPair = 0; iPair < value_pairs; iPair++ )                    {                        unsigned char *out_ptr =                             ((unsigned char *) buf) + iPair * 3;                        JSAMPLE *in_ptr = line_work_buf + iPair * 2;                        out_ptr[0] = (in_ptr[0] & 0xff0) >> 4;                        out_ptr[1] = ((in_ptr[0] & 0xf) << 4)                            | ((in_ptr[1] & 0xf00) >> 8);                        out_ptr[2] = ((in_ptr[1] & 0xff) >> 0);                    }                }                else if( sp->cinfo.d.data_precision == 8 )                {                    int value_count = (sp->cinfo.d.output_width                                        * sp->cinfo.d.num_components);                    int iValue;                    for( iValue = 0; iValue < value_count; iValue++ )                    {                        ((unsigned char *) buf)[iValue] =                             line_work_buf[iValue] & 0xff;                    }                }            }            else            {                /*                ** In the libjpeg6b 8bit case.  We read directly into the                 ** TIFF buffer.                */                JSAMPROW bufptr = (JSAMPROW)buf;                  if (TIFFjpeg_read_scanlines(sp, &bufptr, 1) != 1)                    return (0);            }            ++tif->tif_row;            buf += sp->bytesperline;            cc -= sp->bytesperline;        } while (--nrows > 0);        if( line_work_buf != NULL )            _TIFFfree( line_work_buf );    }    /* Close down the decompressor if we've finished the strip or tile. */    return sp->cinfo.d.output_scanline < sp->cinfo.d.output_height        || TIFFjpeg_finish_decompress(sp);}/* * Decode a chunk of pixels. * Returned data is downsampled per sampling factors. *//*ARGSUSED*/ static intJPEGDecodeRaw(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s){	JPEGState *sp = JState(tif);	tsize_t nrows;	(void) s;	/* data is expected to be read in multiples of a scanline */	if ( (nrows = sp->cinfo.d.image_height) ) {		/* Cb,Cr both have sampling factors 1, so this is correct */		JDIMENSION clumps_per_line = sp->cinfo.d.comp_info[1].downsampled_width;            		int samples_per_clump = sp->samplesperclump;#ifdef JPEG_LIB_MK1		unsigned short* tmpbuf = _TIFFmalloc(sizeof(unsigned short) *		    sp->cinfo.d.output_width *		    sp->cinfo.d.num_components);#endif		do {			jpeg_component_info *compptr;			int ci, clumpoffset;			/* Reload downsampled-data buffer if needed */			if (sp->scancount >= DCTSIZE) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品视频在线看| 欧美巨大另类极品videosbest | 欧美性视频一区二区三区| 色狠狠色狠狠综合| 欧美tickling挠脚心丨vk| 国产欧美一区视频| 亚洲h动漫在线| 国产美女精品人人做人人爽| 九色综合狠狠综合久久| 国产iv一区二区三区| 日本乱人伦一区| 欧美激情一区在线| 久久国产精品99精品国产| a美女胸又www黄视频久久| 91精品国产福利| 亚洲综合激情网| 99在线视频精品| 日本一区二区免费在线| 天天综合色天天| 欧洲精品一区二区| 国产欧美日本一区视频| 蜜桃在线一区二区三区| 欧美日韩一区二区在线视频| 综合久久国产九一剧情麻豆| 国产一区二区三区蝌蚪| 日韩免费性生活视频播放| 首页国产丝袜综合| 欧美色网一区二区| 亚洲国产日日夜夜| 欧美日韩免费观看一区三区| 亚洲女与黑人做爰| 91蜜桃在线免费视频| 亚洲欧美乱综合| 在线精品视频免费观看| 午夜影视日本亚洲欧洲精品| 欧美熟乱第一页| 日韩国产成人精品| 欧美va亚洲va香蕉在线| 国产美女视频一区| 亚洲丝袜美腿综合| 欧美三区在线视频| 另类欧美日韩国产在线| 久久综合色综合88| 色综合久久综合网| 亚洲成人免费电影| 国产日韩欧美激情| 99久久99久久免费精品蜜臀| 亚洲美女视频在线观看| 91精品国产色综合久久ai换脸 | 色综合久久久久综合99| 日韩精品电影在线观看| 一区二区三区日韩欧美精品| 欧美另类高清zo欧美| 久久不见久久见中文字幕免费| 日韩亚洲欧美成人一区| 国产成人精品免费| 奇米影视一区二区三区小说| 久久久久国产精品免费免费搜索| 99久久久免费精品国产一区二区| 一区二区三区高清在线| 久久久精品日韩欧美| 色综合久久久久网| 裸体在线国模精品偷拍| 亚洲国产成人va在线观看天堂| www精品美女久久久tv| 91麻豆精品国产自产在线观看一区| 国产精品伊人色| 另类人妖一区二区av| 午夜精品久久久久久久99樱桃| 中文字幕欧美区| 国产日韩在线不卡| 国产欧美一区二区精品性色| 欧美一级免费观看| 制服丝袜成人动漫| 欧美日韩第一区日日骚| 欧美日韩中文另类| 欧美精品 日韩| 日韩欧美在线影院| 日韩视频免费观看高清在线视频| 欧美日韩一区不卡| 69av一区二区三区| xnxx国产精品| 国产精品久久久久久久久果冻传媒 | 精品国产91久久久久久久妲己| 欧美日韩国产另类一区| 555www色欧美视频| 欧美www视频| 亚洲天堂成人网| 亚洲超丰满肉感bbw| 蜜臀精品一区二区三区在线观看 | 精品粉嫩aⅴ一区二区三区四区| 日韩三级免费观看| 国产日韩欧美一区二区三区综合 | 91黄视频在线| 欧美成人vr18sexvr| 亚洲第一激情av| 精品美女被调教视频大全网站| 99久久免费视频.com| 欧美午夜精品久久久久久孕妇| 在线观看91精品国产入口| 欧美一级视频精品观看| 久久精品视频网| 一卡二卡三卡日韩欧美| 免费在线观看视频一区| 不卡影院免费观看| 精品少妇一区二区| 亚洲日本乱码在线观看| 国产尤物一区二区| 国产在线精品国自产拍免费| 综合欧美亚洲日本| 久久99精品一区二区三区| 色94色欧美sute亚洲线路一久| 欧美哺乳videos| 午夜精品在线看| 91国偷自产一区二区开放时间 | 国产欧美日韩在线视频| 五月激情六月综合| 在线视频综合导航| 中文字幕人成不卡一区| 国精产品一区一区三区mba桃花| 日本韩国一区二区三区视频| 国产日韩欧美激情| 国产一区 二区| 久久一区二区视频| 国产盗摄女厕一区二区三区| 欧美sm美女调教| 国产一区91精品张津瑜| 91久久久免费一区二区| 亚洲色图.com| 色香蕉成人二区免费| 一区二区三区91| 欧美日韩精品专区| 捆绑调教一区二区三区| 精品美女一区二区三区| 国产在线精品一区在线观看麻豆| 日韩美女一区二区三区| 国产美女视频一区| 亚洲视频在线一区观看| 欧美高清视频不卡网| 欧美a一区二区| 国产精品水嫩水嫩| 欧美丝袜自拍制服另类| 免费观看在线综合色| 国产精品免费看片| 在线成人午夜影院| 爽爽淫人综合网网站| 国产日韩欧美在线一区| 欧美午夜精品久久久久久孕妇| 久久av老司机精品网站导航| 国产欧美中文在线| 日韩欧美www| 欧美日韩激情一区二区| 99久久精品国产导航| 精品制服美女丁香| 亚洲一区国产视频| 日本一二三四高清不卡| 在线播放欧美女士性生活| 成人av资源在线| 国产在线麻豆精品观看| 午夜精品123| 一区二区三区欧美日韩| 久久婷婷久久一区二区三区| 欧美电影在哪看比较好| 91麻豆自制传媒国产之光| 国产一区二区成人久久免费影院| 亚洲成av人片一区二区| 亚洲中国最大av网站| 亚洲人被黑人高潮完整版| 26uuu亚洲综合色欧美| 日韩无一区二区| 日韩午夜激情免费电影| 91精品国产全国免费观看| 欧美日韩国产一区二区三区地区| 91影视在线播放| 色av综合在线| 日本道精品一区二区三区| 欧美伊人久久久久久午夜久久久久| 成人一区二区三区| 色综合天天综合狠狠| 91丨porny丨户外露出| 欧美精品久久天天躁| 日韩精品一区二区三区swag| 国产亚洲欧美激情| 国产精品天干天干在线综合| 亚洲欧洲av色图| 麻豆极品一区二区三区| 国产成人午夜精品影院观看视频| 粉嫩av一区二区三区| 在线一区二区三区做爰视频网站| 91美女片黄在线| 精品国产一区二区国模嫣然| 国产亚洲欧美一区在线观看| 久久九九久久九九| 午夜不卡在线视频| 国产99精品视频| 欧美一区二区精品久久911| 国产欧美精品一区二区色综合 | 欧美一级片在线看| 亚洲精品自拍动漫在线| 蜜桃精品视频在线观看|