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

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

?? pnm_dec.c

?? This code demonstrate Fast Wavelet Transform. Executable and can be run on Visual C++ platform
?? C
字號:
/* * Copyright (c) 1999-2000 Image Power, Inc. and the University of *   British Columbia. * Copyright (c) 2001-2003 Michael David Adams. * All rights reserved. *//* __START_OF_JASPER_LICENSE__ *  * JasPer License Version 2.0 *  * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * Copyright (c) 2001-2003 Michael David Adams *  * All rights reserved. *  * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: *  * 1.  The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. *  * 2.  The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. *  * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. *  * __END_OF_JASPER_LICENSE__ *//* * Portable Pixmap/Graymap Format Support * * $Id$ *//******************************************************************************\* Includes.\******************************************************************************/#include <ctype.h>#include <math.h>#include <stdlib.h>#include <assert.h>#include "jasper/jas_types.h"#include "jasper/jas_stream.h"#include "jasper/jas_image.h"#include "pnm_cod.h"/******************************************************************************\* Local function prototypes.\******************************************************************************/static int pnm_gethdr(jas_stream_t *in, pnm_hdr_t *hdr);static int pnm_getdata(jas_stream_t *in, pnm_hdr_t *hdr, jas_image_t *image);static int pnm_getsintstr(jas_stream_t *in, int_fast32_t *val);static int pnm_getuintstr(jas_stream_t *in, uint_fast32_t *val);static int pnm_getbitstr(jas_stream_t *in, int *val);static int pnm_getc(jas_stream_t *in);static int pnm_getsint(jas_stream_t *in, int wordsize, int_fast32_t *val);static int pnm_getuint(jas_stream_t *in, int wordsize, uint_fast32_t *val);static int pnm_getint16(jas_stream_t *in, int *val);#define	pnm_getuint32(in, val)	pnm_getuint(in, 32, val)/******************************************************************************\* Local data.\******************************************************************************/static int pnm_allowtrunc = 1;/******************************************************************************\* Load function.\******************************************************************************/jas_image_t *pnm_decode(jas_stream_t *in, char *opts){	pnm_hdr_t hdr;	jas_image_t *image;	jas_image_cmptparm_t cmptparms[3];	jas_image_cmptparm_t *cmptparm;	int i;	if (opts) {		fprintf(stderr, "warning: ignoring options\n");	}	/* Read the file header. */	if (pnm_gethdr(in, &hdr)) {		return 0;	}	/* Create an image of the correct size. */	for (i = 0, cmptparm = cmptparms; i < hdr.numcmpts; ++i, ++cmptparm) {		cmptparm->tlx = 0;		cmptparm->tly = 0;		cmptparm->hstep = 1;		cmptparm->vstep = 1;		cmptparm->width = hdr.width;		cmptparm->height = hdr.height;		cmptparm->prec = pnm_maxvaltodepth(hdr.maxval);		cmptparm->sgnd = hdr.sgnd;	}	if (!(image = jas_image_create(hdr.numcmpts, cmptparms, JAS_CLRSPC_UNKNOWN))) {		return 0;	}	if (hdr.numcmpts == 3) {		jas_image_setclrspc(image, JAS_CLRSPC_SRGB);		jas_image_setcmpttype(image, 0,		  JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R));		jas_image_setcmpttype(image, 1,		  JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G));		jas_image_setcmpttype(image, 2,		  JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_B));	} else {		jas_image_setclrspc(image, JAS_CLRSPC_SGRAY);		jas_image_setcmpttype(image, 0,		  JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y));	}	/* Read image data from stream into image. */	if (pnm_getdata(in, &hdr, image)) {		jas_image_destroy(image);		return 0;	}	return image;}/******************************************************************************\* Validation function.\******************************************************************************/int pnm_validate(jas_stream_t *in){	uchar buf[2];	int i;	int n;	assert(JAS_STREAM_MAXPUTBACK >= 2);	/* Read the first two characters that constitute the signature. */	if ((n = jas_stream_read(in, buf, 2)) < 0) {		return -1;	}	/* Put these characters back to the stream. */	for (i = n - 1; i >= 0; --i) {		if (jas_stream_ungetc(in, buf[i]) == EOF) {			return -1;		}	}	/* Did we read enough data? */	if (n < 2) {		return -1;	}	/* Is this the correct signature for a PNM file? */	if (buf[0] == 'P' && isdigit(buf[1])) {		return 0;	}	return -1;}/******************************************************************************\* Functions for reading the header.\******************************************************************************/static int pnm_gethdr(jas_stream_t *in, pnm_hdr_t *hdr){	int_fast32_t maxval;	if (pnm_getint16(in, &hdr->magic) || pnm_getsintstr(in, &hdr->width) ||	  pnm_getsintstr(in, &hdr->height)) {		return -1;	}	if (pnm_type(hdr->magic) != PNM_TYPE_PBM) {		if (pnm_getsintstr(in, &maxval)) {			return -1;		}	} else {		maxval = 1;	}	if (maxval < 0) {		hdr->maxval = -maxval;		hdr->sgnd = true;	} else {		hdr->maxval = maxval;		hdr->sgnd = false;	}	switch (pnm_type(hdr->magic)) {	case PNM_TYPE_PBM:	case PNM_TYPE_PGM:		hdr->numcmpts = 1;		break;	case PNM_TYPE_PPM:		hdr->numcmpts = 3;		break;	default:		abort();		break;	}	return 0;}/******************************************************************************\* Functions for processing the sample data.\******************************************************************************/static int pnm_getdata(jas_stream_t *in, pnm_hdr_t *hdr, jas_image_t *image){	int ret;#if 0	int numcmpts;#endif	int cmptno;	int fmt;	jas_matrix_t *data[3];	int x;	int y;	int_fast64_t v;	int depth;	int type;	int c;	int n;	ret = -1;#if 0	numcmpts = jas_image_numcmpts(image);#endif	fmt = pnm_fmt(hdr->magic);	type = pnm_type(hdr->magic);	depth = pnm_maxvaltodepth(hdr->maxval);	data[0] = 0;	data[1] = 0;	data[2] = 0;	for (cmptno = 0; cmptno < hdr->numcmpts; ++cmptno) {		if (!(data[cmptno] = jas_matrix_create(1, hdr->width))) {			goto done;		}	}	for (y = 0; y < hdr->height; ++y) {		if (type == PNM_TYPE_PBM) {			if (fmt == PNM_FMT_BIN) {				for (x = 0; x < hdr->width;) {					if ((c = jas_stream_getc(in)) == EOF) {						goto done;					}					n = 8;					while (n > 0 && x < hdr->width) {						jas_matrix_set(data[0], 0, x, 1 - ((c >> 7) & 1));						c <<= 1;						--n;						++x;					}				}			} else {				for (x = 0; x < hdr->width; ++x) {					int uv;					if (pnm_getbitstr(in, &uv)) {						goto done;					}					jas_matrix_set(data[0], 0, x, 1 - uv);				}			}		} else {			for (x = 0; x < hdr->width; ++x) {				for (cmptno = 0; cmptno < hdr->numcmpts; ++cmptno) {					if (fmt == PNM_FMT_BIN) {						/* The sample data is in binary format. */						if (hdr->sgnd) {							/* The sample data is signed. */							int_fast32_t sv;							if (pnm_getsint(in, depth, &sv)) {								if (!pnm_allowtrunc) {									goto done;								}								sv = 0;							}							v = sv;						} else {							/* The sample data is unsigned. */							uint_fast32_t uv;							if (pnm_getuint(in, depth, &uv)) {								if (!pnm_allowtrunc) {									goto done;								}								uv = 0;							}							v = uv;						}					} else {						/* The sample data is in text format. */						if (hdr->sgnd) {							/* The sample data is signed. */							int_fast32_t sv;							if (pnm_getsintstr(in, &sv)) {								if (!pnm_allowtrunc) {									goto done;								}								sv = 0;							}							v = sv;						} else {							/* The sample data is unsigned. */							uint_fast32_t uv;							if (pnm_getuintstr(in, &uv)) {								if (!pnm_allowtrunc) {									goto done;								}								uv = 0;							}							v = uv;						}					}					jas_matrix_set(data[cmptno], 0, x, v);				}			}		}		for (cmptno = 0; cmptno < hdr->numcmpts; ++cmptno) {			if (jas_image_writecmpt(image, cmptno, 0, y, hdr->width, 1,			  data[cmptno])) {				goto done;			}		}	}	ret = 0;done:	for (cmptno = 0; cmptno < hdr->numcmpts; ++cmptno) {		if (data[cmptno]) {			jas_matrix_destroy(data[cmptno]);		}	}	return ret;}/******************************************************************************\* Miscellaneous functions.\******************************************************************************/static int pnm_getsint(jas_stream_t *in, int wordsize, int_fast32_t *val){	uint_fast32_t tmpval;	if (pnm_getuint(in, wordsize, &tmpval)) {		return -1;	}	if (val) {		assert((tmpval & (1 << (wordsize - 1))) == 0);		*val = tmpval;	}	return 0;}static int pnm_getuint(jas_stream_t *in, int wordsize, uint_fast32_t *val){	uint_fast32_t tmpval;	int c;	int n;	tmpval = 0;	n = (wordsize + 7) / 8;	while (--n >= 0) {		if ((c = jas_stream_getc(in)) == EOF) {			return -1;		}		tmpval = (tmpval << 8) | c;	}	tmpval &= (((uint_fast64_t) 1) << wordsize) - 1;	if (val) {		*val = tmpval;	}	return 0;}static int pnm_getbitstr(jas_stream_t *in, int *val){	int c;	int_fast32_t v;	for (;;) {		if ((c = pnm_getc(in)) == EOF) {			return -1;		}		if (c == '#') {			for (;;) {				if ((c = pnm_getc(in)) == EOF) {					return -1;				}				if (c == '\n') {					break;				}			}		} else if (c == '0' || c == '1') {			v = c - '0';			break;		}	}	if (val) {		*val = v;	}	return 0;}static int pnm_getuintstr(jas_stream_t *in, uint_fast32_t *val){	uint_fast32_t v;	int c;	/* Discard any leading whitespace. */	do {		if ((c = pnm_getc(in)) == EOF) {			return -1;		}	} while (isspace(c));	/* Parse the number. */	v = 0;	while (isdigit(c)) {		v = 10 * v + c - '0';		if ((c = pnm_getc(in)) < 0) {			return -1;		}	}	/* The number must be followed by whitespace. */	if (!isspace(c)) {		return -1;	}	if (val) {		*val = v;	}	return 0;}static int pnm_getsintstr(jas_stream_t *in, int_fast32_t *val){	int c;	int s;	int_fast32_t v;	/* Discard any leading whitespace. */	do {		if ((c = pnm_getc(in)) == EOF) {			return -1;		}	} while (isspace(c));	/* Get the number, allowing for a negative sign. */	s = 1;	if (c == '-') {		s = -1;		if ((c = pnm_getc(in)) == EOF) {			return -1;		}	} else if (c == '+') {		if ((c = pnm_getc(in)) == EOF) {			return -1;		}	}	v = 0;	while (isdigit(c)) {		v = 10 * v + c - '0';		if ((c = pnm_getc(in)) < 0) {			return -1;		}	}	/* The number must be followed by whitespace. */	if (!isspace(c)) {		return -1;	}	if (val) {		*val = (s >= 0) ? v : (-v);	}	return 0;}static int pnm_getc(jas_stream_t *in){	int c;	for (;;) {		if ((c = jas_stream_getc(in)) == EOF) {			return -1;		}		if (c != '#') {			return c;		}		do {			if ((c = jas_stream_getc(in)) == EOF) {				return -1;			}		} while (c != '\n' && c != '\r');	}}static int pnm_getint16(jas_stream_t *in, int *val){	int v;	int c;	if ((c = jas_stream_getc(in)) == EOF) {		return -1;	}	v = c & 0xff;	if ((c = jas_stream_getc(in)) == EOF) {		return -1;	}	v = (v << 8) | (c & 0xff);	*val = v;	return 0;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
丝袜美腿亚洲色图| 欧美精品自拍偷拍| 婷婷久久综合九色综合伊人色| 久久免费视频色| 欧美日韩一卡二卡三卡| 国产在线视频不卡二| 一二三四区精品视频| 国产日韩欧美高清| 国产精品国产馆在线真实露脸| 日韩你懂的电影在线观看| 日本一区二区三区四区 | 精品欧美一区二区在线观看| 欧美成人精品3d动漫h| 欧美激情中文字幕一区二区| 亚洲三级理论片| 麻豆精品视频在线观看视频| 国产精品主播直播| 欧美日韩亚洲高清一区二区| 精品国产乱码久久| 偷拍与自拍一区| 三级久久三级久久| 日韩成人免费在线| 久久精品国产亚洲高清剧情介绍 | 奇米888四色在线精品| 亚洲成在人线在线播放| 天天做天天摸天天爽国产一区| 偷拍日韩校园综合在线| 午夜一区二区三区在线观看| 国产制服丝袜一区| 国产ts人妖一区二区| 色哟哟国产精品免费观看| 久久亚洲免费视频| 午夜精品久久久久久久蜜桃app| 亚洲欧美日韩久久| 亚洲丝袜另类动漫二区| 亚洲综合一区在线| 久久国产三级精品| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 蜜桃av噜噜一区| 99久久夜色精品国产网站| 欧美日韩在线观看一区二区| 日韩一级成人av| 国产精品国产三级国产普通话三级| 亚洲免费资源在线播放| 蜜桃av一区二区| 色婷婷综合久久久中文一区二区| 欧美一区二区三区公司| 欧美国产视频在线| 免费在线成人网| 日本韩国一区二区三区视频| 日韩一级大片在线观看| 亚洲一区中文在线| 成人av电影在线网| 久久一留热品黄| 日日摸夜夜添夜夜添国产精品| 成人国产免费视频| 久久亚洲一区二区三区明星换脸| 亚洲国产精品欧美一二99| 成人一道本在线| 26uuu精品一区二区三区四区在线| 亚洲精品欧美激情| 97se狠狠狠综合亚洲狠狠| 久久精品视频在线看| 日韩av中文在线观看| 欧美在线小视频| 久久国产精品色| 欧美三级三级三级爽爽爽| 亚洲精品日日夜夜| 色综合天天综合网国产成人综合天| 国产欧美在线观看一区| 国产一区二区三区久久久| 久久亚洲二区三区| 不卡av免费在线观看| 国产精品毛片高清在线完整版| 久久99精品国产.久久久久久| 欧美日韩一本到| 美国欧美日韩国产在线播放| 欧美一区二区三区在线观看 | 亚洲精品国产精品乱码不99 | 国产高清亚洲一区| 欧美激情一区二区三区在线| 风流少妇一区二区| 亚洲品质自拍视频网站| 9191成人精品久久| 久久99精品国产| 成人欧美一区二区三区白人| 色综合视频一区二区三区高清| 亚洲综合免费观看高清在线观看| 欧美疯狂做受xxxx富婆| 国产在线精品一区在线观看麻豆| 欧美国产欧美综合| 欧美性大战久久久久久久 | 色久综合一二码| 热久久国产精品| 一区二区三区中文字幕电影| 欧美日韩高清一区二区三区| 免费黄网站欧美| 亚洲一区自拍偷拍| 国产人成亚洲第一网站在线播放| 色综合久久久久久久久| 一区二区三区在线观看视频 | 亚洲综合久久av| 99在线精品免费| 亚洲日本一区二区| 欧美久久久久久久久久| 欧美嫩在线观看| 亚洲黄色性网站| 蜜桃久久久久久| 色诱亚洲精品久久久久久| 国产欧美综合色| 美腿丝袜亚洲综合| 亚洲国产日韩在线一区模特| 久久久久9999亚洲精品| 成人av在线网| 亚洲精品视频自拍| 欧美日韩亚洲综合| 99亚偷拍自图区亚洲| 国产精品久久久久久久久免费相片 | 欧美色图片你懂的| 一区二区三区免费网站| 精品国产乱码久久久久久浪潮| 国产精品77777| 韩日欧美一区二区三区| 午夜天堂影视香蕉久久| 亚洲欧美一区二区久久| 久久色视频免费观看| 欧美揉bbbbb揉bbbbb| 波多野结衣的一区二区三区| 韩国av一区二区三区在线观看| 国产精品一级二级三级| 免费成人美女在线观看| 国产成人福利片| 精品一区二区三区免费毛片爱 | 日韩美女精品在线| 亚洲国产精品久久久久秋霞影院 | 国模无码大尺度一区二区三区| 久久电影网站中文字幕| 激情文学综合插| 欧美日韩国产综合视频在线观看| 精品理论电影在线观看 | 久久久久久久久一| 日韩专区在线视频| 欧美综合欧美视频| 一本久道中文字幕精品亚洲嫩| 在线看国产日韩| 精品国产免费人成在线观看| 欧美激情资源网| 日韩影视精彩在线| 不卡视频在线看| 日韩午夜三级在线| 国产精品视频在线看| 偷拍日韩校园综合在线| 国产成人自拍在线| 欧美美女网站色| 亚洲人妖av一区二区| 久久精品国产99久久6| 91毛片在线观看| 国产亚洲精久久久久久| 午夜精品爽啪视频| 91麻豆福利精品推荐| 久久一夜天堂av一区二区三区| 日韩激情在线观看| 在线观看亚洲成人| 国产精品国产成人国产三级| 激情久久五月天| 日韩一区二区三区高清免费看看| 亚洲欧美日韩电影| 色综合久久88色综合天天| 国产精品免费丝袜| 91在线观看免费视频| 日本一区二区成人| 97se亚洲国产综合自在线| 国产欧美日韩中文久久| 国产一区二区久久| 久久精品欧美一区二区三区麻豆| 久久99国内精品| 精品久久久久久无| 韩日精品视频一区| 国产欧美精品在线观看| 福利电影一区二区| 国产精品成人一区二区艾草| 99天天综合性| 午夜精品在线看| xnxx国产精品| 成人亚洲一区二区一| 亚洲九九爱视频| 精品视频全国免费看| 久久99精品一区二区三区| 精品99999| 国v精品久久久网| 精品成人一区二区三区四区| 国产麻豆精品久久一二三| 国产日韩亚洲欧美综合| 日本高清免费不卡视频| 亚洲综合丁香婷婷六月香| 日韩欧美在线网站| 国模娜娜一区二区三区| 最新久久zyz资源站| 6080午夜不卡| 国产精品夜夜嗨|