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

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

?? img_pnm.c

?? It is extension program for SDL to display images other than bmp, but all the other formats.
?? C
字號:
/*    SDL_image:  An example image loading library for use with SDL    Copyright (C) 1997-2006 Sam Lantinga    This library is free software; you can redistribute it and/or    modify it under the terms of the GNU Lesser General Public    License as published by the Free Software Foundation; either    version 2.1 of the License, or (at your option) any later version.    This library is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU    Lesser General Public License for more details.    You should have received a copy of the GNU Lesser General Public    License along with this library; if not, write to the Free Software    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA    Sam Lantinga    slouken@libsdl.org*//* * PNM (portable anymap) image loader: * * Supports: PBM, PGM and PPM, ASCII and binary formats * (PBM and PGM are loaded as 8bpp surfaces) * Does not support: maximum component value > 255 */#include <stdio.h>#include <stdlib.h>#include <ctype.h>#include <string.h>#include "SDL_image.h"#ifdef LOAD_PNM/* See if an image is contained in a data source */int IMG_isPNM(SDL_RWops *src){	int start;	int is_PNM;	char magic[2];	if ( !src )		return 0;	start = SDL_RWtell(src);	is_PNM = 0;	if ( SDL_RWread(src, magic, sizeof(magic), 1) ) {		/*		 * PNM magic signatures:		 * P1	PBM, ascii format		 * P2	PGM, ascii format		 * P3	PPM, ascii format		 * P4	PBM, binary format		 * P5	PGM, binary format		 * P6	PPM, binary format		 * P7	PAM, a general wrapper for PNM data		 */		if ( magic[0] == 'P' && magic[1] >= '1' && magic[1] <= '6' ) {			is_PNM = 1;		}	}	SDL_RWseek(src, start, SEEK_SET);	return(is_PNM);}/* read a non-negative integer from the source. return -1 upon error */static int ReadNumber(SDL_RWops *src){	int number;	unsigned char ch;	/* Initialize return value */	number = 0;	/* Skip leading whitespace */	do {		if ( ! SDL_RWread(src, &ch, 1, 1) ) {			return(0);		}		/* Eat comments as whitespace */		if ( ch == '#' ) {  /* Comment is '#' to end of line */			do {				if ( ! SDL_RWread(src, &ch, 1, 1) ) {					return -1;				}			} while ( (ch != '\r') && (ch != '\n') );		}	} while ( isspace(ch) );	/* Add up the number */	do {		number *= 10;		number += ch-'0';		if ( !SDL_RWread(src, &ch, 1, 1) ) {			return -1;		}	} while ( isdigit(ch) );	return(number);}SDL_Surface *IMG_LoadPNM_RW(SDL_RWops *src){	int start;	SDL_Surface *surface = NULL;	int width, height;	int maxval, y, bpl;	Uint8 *row;	Uint8 *buf = NULL;	char *error = NULL;	Uint8 magic[2];	int ascii;	enum { PBM, PGM, PPM, PAM } kind;#define ERROR(s) do { error = (s); goto done; } while(0)	if ( !src ) {		/* The error message has been set in SDL_RWFromFile */		return NULL;	}	start = SDL_RWtell(src);	SDL_RWread(src, magic, 2, 1);	kind = magic[1] - '1';	ascii = 1;	if(kind >= 3) {		ascii = 0;		kind -= 3;	}	width = ReadNumber(src);	height = ReadNumber(src);	if(width <= 0 || height <= 0)		ERROR("Unable to read image width and height");	if(kind != PBM) {		maxval = ReadNumber(src);		if(maxval <= 0 || maxval > 255)			ERROR("unsupported PNM format");	} else		maxval = 255;	/* never scale PBMs */	/* binary PNM allows just a single character of whitespace after	   the last parameter, and we've already consumed it */	if(kind == PPM) {		/* 24-bit surface in R,G,B byte order */		surface = SDL_AllocSurface(SDL_SWSURFACE, width, height, 24,#if SDL_BYTEORDER == SDL_LIL_ENDIAN					   0x000000ff, 0x0000ff00, 0x00ff0000,#else					   0x00ff0000, 0x0000ff00, 0x000000ff,#endif					   0);	} else {		/* load PBM/PGM as 8-bit indexed images */		surface = SDL_AllocSurface(SDL_SWSURFACE, width, height, 8,					   0, 0, 0, 0);	}	if ( surface == NULL )		ERROR("Out of memory");	bpl = width * surface->format->BytesPerPixel;	if(kind == PGM) {		SDL_Color *c = surface->format->palette->colors;		int i;		for(i = 0; i < 256; i++)			c[i].r = c[i].g = c[i].b = i;		surface->format->palette->ncolors = 256;	} else if(kind == PBM) {		/* for some reason PBM has 1=black, 0=white */		SDL_Color *c = surface->format->palette->colors;		c[0].r = c[0].g = c[0].b = 255;		c[1].r = c[1].g = c[1].b = 0;		surface->format->palette->ncolors = 2;		bpl = (width + 7) >> 3;		buf = malloc(bpl);		if(buf == NULL)			ERROR("Out of memory");	}	/* Read the image into the surface */	row = surface->pixels;	for(y = 0; y < height; y++) {		if(ascii) {			int i;			if(kind == PBM) {				for(i = 0; i < width; i++) {					Uint8 ch;					do {						if(!SDL_RWread(src, &ch,							       1, 1))						       ERROR("file truncated");						ch -= '0';					} while(ch > 1);					row[i] = ch;				}			} else {				for(i = 0; i < bpl; i++) {					int c;					c = ReadNumber(src);					if(c < 0)						ERROR("file truncated");					row[i] = c;				}			}		} else {			Uint8 *dst = (kind == PBM) ? buf : row;			if(!SDL_RWread(src, dst, bpl, 1))				ERROR("file truncated");			if(kind == PBM) {				/* expand bitmap to 8bpp */				int i;				for(i = 0; i < width; i++) {					int bit = 7 - (i & 7);					row[i] = (buf[i >> 3] >> bit) & 1;				}			}		}		if(maxval < 255) {			/* scale up to full dynamic range (slow) */			int i;			for(i = 0; i < bpl; i++)				row[i] = row[i] * 255 / maxval;		}		row += surface->pitch;	}done:	free(buf);	if(error) {		SDL_RWseek(src, start, SEEK_SET);		if ( surface ) {			SDL_FreeSurface(surface);			surface = NULL;		}		IMG_SetError(error);	}	return(surface);}#else/* See if an image is contained in a data source */int IMG_isPNM(SDL_RWops *src){	return(0);}/* Load a PNM type image from an SDL datasource */SDL_Surface *IMG_LoadPNM_RW(SDL_RWops *src){	return(NULL);}#endif /* LOAD_PNM */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲欧洲一区高清在线观看| 91丨九色丨蝌蚪富婆spa| 日韩欧美国产麻豆| 热久久免费视频| 日韩午夜在线观看视频| 久久99最新地址| 国产农村妇女毛片精品久久麻豆| 成人app在线| 亚洲成人免费在线观看| 日韩你懂的电影在线观看| 国产精品一区在线观看乱码| 国产精品私人影院| 欧美影院午夜播放| 蜜桃久久精品一区二区| 国产女主播一区| 在线视频国产一区| 激情文学综合网| 亚洲免费在线视频一区 二区| 欧美日韩激情在线| 国产综合久久久久影院| 亚洲特黄一级片| 欧美精三区欧美精三区| 国产成人自拍网| 亚洲曰韩产成在线| 精品成a人在线观看| 91色在线porny| 蜜桃av一区二区| **性色生活片久久毛片| 日韩亚洲欧美综合| 成人精品高清在线| 久久99精品久久久久久动态图| 亚洲天堂2016| 精品久久久久久久久久久久久久久久久 | 看国产成人h片视频| 国产欧美一区二区三区鸳鸯浴 | 51精品国自产在线| 国产成人精品aa毛片| 日本网站在线观看一区二区三区| 国产精品天干天干在线综合| 日韩午夜在线播放| 欧美做爰猛烈大尺度电影无法无天| 经典一区二区三区| 一二三四区精品视频| 欧美极品aⅴ影院| 欧美一区二区三区男人的天堂| 99精品视频中文字幕| 国内偷窥港台综合视频在线播放| 亚洲一线二线三线视频| 国产精品久久久久影院老司| 精品国产乱码久久| 欧美日韩黄视频| 91在线视频免费91| 国产成人三级在线观看| 捆绑调教一区二区三区| 午夜电影久久久| 亚洲人成在线观看一区二区| 国产亚洲精品7777| 欧美刺激脚交jootjob| 欧美日韩另类一区| 一本到高清视频免费精品| 不卡电影一区二区三区| 韩国av一区二区三区在线观看| 日本91福利区| 日韩va亚洲va欧美va久久| 一区二区三区四区中文字幕| 亚洲欧美色图小说| 亚洲日本丝袜连裤袜办公室| **性色生活片久久毛片| 国产精品国产三级国产aⅴ入口 | 麻豆一区二区三| 日韩国产一区二| 偷拍一区二区三区| 日韩电影免费在线看| 日韩国产欧美三级| 久久激情五月婷婷| 麻豆精品视频在线观看| 韩国成人福利片在线播放| 黑人巨大精品欧美一区| 国产剧情av麻豆香蕉精品| 韩国理伦片一区二区三区在线播放 | 国精品**一区二区三区在线蜜桃| 久久精品二区亚洲w码| 激情综合色丁香一区二区| 激情文学综合插| 国产宾馆实践打屁股91| www.成人网.com| 色999日韩国产欧美一区二区| 在线观看日韩电影| 欧美一区二区三区视频在线| 欧美一区二区三区日韩视频| 精品欧美久久久| 日本一区二区三区电影| 亚洲人成网站影音先锋播放| 亚洲精品视频免费看| 午夜精品一区二区三区免费视频| 日本免费新一区视频| 激情久久五月天| 欧美大片在线观看一区二区| 久久九九影视网| 亚洲精品videosex极品| 午夜一区二区三区视频| 国内精品久久久久影院色| 成人免费毛片片v| 91久久免费观看| 欧美不卡一区二区三区| 中文一区一区三区高中清不卡| 伊人色综合久久天天| 日韩专区一卡二卡| 国产jizzjizz一区二区| 欧美视频一区二区三区四区| 久久综合999| 亚洲综合在线观看视频| 久久99深爱久久99精品| 色一情一伦一子一伦一区| 在线成人高清不卡| 中文一区在线播放| 日韩av一区二区三区四区| 福利电影一区二区| 911精品国产一区二区在线| 久久久一区二区三区捆绑**| 一区二区日韩av| 国产精品影视在线观看| 欧美日韩亚洲综合| 中文字幕乱码日本亚洲一区二区| 五月激情综合网| 91同城在线观看| 久久综合久久综合九色| 亚洲成人精品在线观看| 成人黄色777网| 欧美精品一区二区三区在线 | 亚洲国产婷婷综合在线精品| 久久se这里有精品| 欧美在线|欧美| 国产精品免费网站在线观看| 蜜桃免费网站一区二区三区| 日本丰满少妇一区二区三区| 国产日韩在线不卡| 男女男精品网站| 欧美主播一区二区三区美女| 日本一区二区三区在线观看| 九一久久久久久| 欧美日本高清视频在线观看| 亚洲男人电影天堂| 丁香激情综合国产| 精品88久久久久88久久久| 午夜国产精品影院在线观看| 欧美主播一区二区三区美女| 日韩伦理av电影| 成人精品视频一区二区三区尤物| wwwwxxxxx欧美| 久久99精品久久久| 日韩精品中文字幕一区二区三区 | 精品国产3级a| 人妖欧美一区二区| 7777精品伊人久久久大香线蕉的| 亚洲激情校园春色| 在线观看区一区二| 一区二区三区高清| 色94色欧美sute亚洲线路一久 | 香港成人在线视频| 欧美日韩亚洲另类| 亚洲国产精品久久久久秋霞影院| 91天堂素人约啪| 亚洲欧美日韩成人高清在线一区| 成人午夜激情影院| 国产精品私房写真福利视频| 顶级嫩模精品视频在线看| 日本一区二区综合亚洲| 成人毛片在线观看| 亚洲码国产岛国毛片在线| 一本到一区二区三区| 亚洲国产裸拍裸体视频在线观看乱了| 色婷婷国产精品| 偷窥国产亚洲免费视频| 日韩写真欧美这视频| 韩国一区二区在线观看| 国产日韩欧美麻豆| 91色|porny| 婷婷一区二区三区| 精品国产乱码久久久久久闺蜜| 国产精品 欧美精品| 国产精品灌醉下药二区| 欧美综合久久久| 蜜桃久久久久久久| 久久综合久久综合久久综合| 成人精品一区二区三区四区| 一区二区三区四区不卡在线| 欧美日韩一区二区三区不卡| 美女视频黄频大全不卡视频在线播放| 精品久久久久久久久久久久久久久| 国产宾馆实践打屁股91| 亚洲免费三区一区二区| 制服丝袜激情欧洲亚洲| 国产精品中文字幕一区二区三区| 亚洲欧洲三级电影| 欧美精品少妇一区二区三区| 激情综合亚洲精品| 亚洲精品视频在线观看网站| 欧美一区二区女人| 高清国产一区二区三区|