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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? winbmpfileformat.java

?? 源碼為Eclipse開(kāi)源開(kāi)發(fā)平臺(tái)桌面開(kāi)發(fā)工具SWT的源代碼,
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
	int stride = (width * bitCount + 7) / 8;	stride = (stride + 3) / 4 * 4; // Round up to 4 byte multiple	byte[] data = loadData(infoHeader, stride);	flipScanLines(data, stride, height);	return data;}byte[] loadData(byte[] infoHeader, int stride) {	int height = (infoHeader[8] & 0xFF) | ((infoHeader[9] & 0xFF) << 8) | ((infoHeader[10] & 0xFF) << 16) | ((infoHeader[11] & 0xFF) << 24);	int dataSize = height * stride;	byte[] data = new byte[dataSize];	int cmp = (infoHeader[16] & 0xFF) | ((infoHeader[17] & 0xFF) << 8) | ((infoHeader[18] & 0xFF) << 16) | ((infoHeader[19] & 0xFF) << 24);	if (cmp == 0) { // BMP_NO_COMPRESSION		try {			if (inputStream.read(data) != dataSize)				SWT.error(SWT.ERROR_INVALID_IMAGE);		} catch (IOException e) {			SWT.error(SWT.ERROR_IO, e);		}	} else {		int compressedSize = (infoHeader[20] & 0xFF) | ((infoHeader[21] & 0xFF) << 8) | ((infoHeader[22] & 0xFF) << 16) | ((infoHeader[23] & 0xFF) << 24);		byte[] compressed = new byte[compressedSize];		try {			if (inputStream.read(compressed) != compressedSize)				SWT.error(SWT.ERROR_INVALID_IMAGE);		} catch (IOException e) {			SWT.error(SWT.ERROR_IO, e);		}		decompressData(compressed, data, stride, cmp);	}	return data;}int[] loadFileHeader() {	int[] header = new int[5];	try {		header[0] = inputStream.readShort();		header[1] = inputStream.readInt();		header[2] = inputStream.readShort();		header[3] = inputStream.readShort();		header[4] = inputStream.readInt();	} catch (IOException e) {		SWT.error(SWT.ERROR_IO, e);	}	if (header[0] != 0x4D42)		SWT.error(SWT.ERROR_INVALID_IMAGE);	return header;}ImageData[] loadFromByteStream() {	int[] fileHeader = loadFileHeader();	byte[] infoHeader = new byte[BMPHeaderFixedSize];	try {		inputStream.read(infoHeader);	} catch (Exception e) {		SWT.error(SWT.ERROR_IO, e);	}	PaletteData palette = loadPalette(infoHeader);	if (inputStream.getPosition() < fileHeader[4]) {		// Seek to the specified offset		try {			inputStream.skip(fileHeader[4] - inputStream.getPosition());		} catch (IOException e) {			SWT.error(SWT.ERROR_IO, e);		}	}	byte[] data = loadData(infoHeader);	this.compression = (infoHeader[16] & 0xFF) | ((infoHeader[17] & 0xFF) << 8) | ((infoHeader[18] & 0xFF) << 16) | ((infoHeader[19] & 0xFF) << 24);	this.importantColors = (infoHeader[36] & 0xFF) | ((infoHeader[37] & 0xFF) << 8) | ((infoHeader[38] & 0xFF) << 16) | ((infoHeader[39] & 0xFF) << 24);	int xPelsPerMeter = (infoHeader[24] & 0xFF) | ((infoHeader[25] & 0xFF) << 8) | ((infoHeader[26] & 0xFF) << 16) | ((infoHeader[27] & 0xFF) << 24);	int yPelsPerMeter = (infoHeader[28] & 0xFF) | ((infoHeader[29] & 0xFF) << 8) | ((infoHeader[30] & 0xFF) << 16) | ((infoHeader[31] & 0xFF) << 24);	this.pelsPerMeter = new Point(xPelsPerMeter, yPelsPerMeter);	int width = (infoHeader[4] & 0xFF) | ((infoHeader[5] & 0xFF) << 8) | ((infoHeader[6] & 0xFF) << 16) | ((infoHeader[7] & 0xFF) << 24);	int height = (infoHeader[8] & 0xFF) | ((infoHeader[9] & 0xFF) << 8) | ((infoHeader[10] & 0xFF) << 16) | ((infoHeader[11] & 0xFF) << 24);	int bitCount = (infoHeader[14] & 0xFF) | ((infoHeader[15] & 0xFF) << 8);	int type = (this.compression == 1 /*BMP_RLE8_COMPRESSION*/) || (this.compression == 2 /*BMP_RLE4_COMPRESSION*/) ? SWT.IMAGE_BMP_RLE : SWT.IMAGE_BMP;	return new ImageData[] {		ImageData.internal_new(			width,			height,			bitCount,			palette,			4,			data,			0,			null,			null,			-1,			-1,			type,			0,			0,			0,			0)	};}PaletteData loadPalette(byte[] infoHeader) {	int depth = (infoHeader[14] & 0xFF) | ((infoHeader[15] & 0xFF) << 8);	if (depth <= 8) {		int numColors = (infoHeader[32] & 0xFF) | ((infoHeader[33] & 0xFF) << 8) | ((infoHeader[34] & 0xFF) << 16) | ((infoHeader[35] & 0xFF) << 24);		if (numColors == 0) {			numColors = 1 << ((infoHeader[14] & 0xFF) | ((infoHeader[15] & 0xFF) << 8));		} else {			if (numColors > 256)				numColors = 256;		}		byte[] buf = new byte[numColors * 4];		try {			if (inputStream.read(buf) != buf.length)				SWT.error(SWT.ERROR_INVALID_IMAGE);		} catch (IOException e) {			SWT.error(SWT.ERROR_IO, e);		}		return paletteFromBytes(buf, numColors);	}	if (depth == 16) return new PaletteData(0x7C00, 0x3E0, 0x1F);	if (depth == 24) return new PaletteData(0xFF, 0xFF00, 0xFF0000);	return new PaletteData(0xFF00, 0xFF0000, 0xFF000000);}PaletteData paletteFromBytes(byte[] bytes, int numColors) {	int bytesOffset = 0;	RGB[] colors = new RGB[numColors];	for (int i = 0; i < numColors; i++) {		colors[i] = new RGB(bytes[bytesOffset + 2] & 0xFF,			bytes[bytesOffset + 1] & 0xFF,			bytes[bytesOffset] & 0xFF);		bytesOffset += 4;	}	return new PaletteData(colors);}/** * Answer a byte array containing the BMP representation of * the given device independent palette. */static byte[] paletteToBytes(PaletteData pal) {	int n = pal.colors == null ? 0 : (pal.colors.length < 256 ? pal.colors.length : 256);	byte[] bytes = new byte[n * 4];	int offset = 0;	for (int i = 0; i < n; i++) {		RGB col = pal.colors[i];		bytes[offset] = (byte)col.blue;		bytes[offset + 1] = (byte)col.green;		bytes[offset + 2] = (byte)col.red;		offset += 4;	}	return bytes;}/** * Unload the given image's data into the given byte stream * using the given compression strategy.  * Answer the number of bytes written. */int unloadData(ImageData image, OutputStream out, int comp) {	int totalSize = 0;	try {		if (comp == 0)			return unloadDataNoCompression(image, out);		int bpl = (image.width * image.depth + 7) / 8;		int bmpBpl = (bpl + 3) / 4 * 4; // BMP pads scanlines to multiples of 4 bytes		int imageBpl = image.bytesPerLine;		// Compression can actually take twice as much space, in worst case		byte[] buf = new byte[bmpBpl * 2];		int srcOffset = imageBpl * (image.height - 1); // Start at last line		byte[] data = image.data;		totalSize = 0;		byte[] buf2 = new byte[32768];		int buf2Offset = 0;		for (int y = image.height - 1; y >= 0; y--) {			int lineSize = compress(comp, data, srcOffset, bpl, buf, y == 0);			if (buf2Offset + lineSize > buf2.length) {				out.write(buf2, 0, buf2Offset);				buf2Offset = 0;			}			System.arraycopy(buf, 0, buf2, buf2Offset, lineSize);			buf2Offset += lineSize;			totalSize += lineSize;			srcOffset -= imageBpl;		}		if (buf2Offset > 0)			out.write(buf2, 0, buf2Offset);	} catch (IOException e) {		SWT.error(SWT.ERROR_IO, e);	}	return totalSize;}/** * Prepare the given image's data for unloading into a byte stream * using no compression strategy. * Answer the number of bytes written. */int unloadDataNoCompression(ImageData image, OutputStream out) {	int bmpBpl = 0;	try {		int bpl = (image.width * image.depth + 7) / 8;		bmpBpl = (bpl + 3) / 4 * 4; // BMP pads scanlines to multiples of 4 bytes		int linesPerBuf = 32678 / bmpBpl;		byte[] buf = new byte[linesPerBuf * bmpBpl];		byte[] data = image.data;		int imageBpl = image.bytesPerLine;		int dataIndex = imageBpl * (image.height - 1); // Start at last line		if (image.depth == 16) {			for (int y = 0; y < image.height; y += linesPerBuf) {				int count = image.height - y;				if (linesPerBuf < count) count = linesPerBuf;				int bufOffset = 0;				for (int i = 0; i < count; i++) {					for (int wIndex = 0; wIndex < bpl; wIndex += 2) {						buf[bufOffset + wIndex + 1] = data[dataIndex + wIndex + 1];						buf[bufOffset + wIndex] = data[dataIndex + wIndex];					}					bufOffset += bmpBpl;					dataIndex -= imageBpl;				}				out.write(buf, 0, bufOffset);			}		} else {			for (int y = 0; y < image.height; y += linesPerBuf) {				int tmp = image.height - y;				int count = tmp < linesPerBuf ? tmp : linesPerBuf;				int bufOffset = 0;				for (int i = 0; i < count; i++) {					System.arraycopy(data, dataIndex, buf, bufOffset, bpl);					bufOffset += bmpBpl;					dataIndex -= imageBpl;				}				out.write(buf, 0, bufOffset);			}		}	} catch (IOException e) {		SWT.error(SWT.ERROR_IO, e);	}	return bmpBpl * image.height;}/** * Unload a DeviceIndependentImage using Windows .BMP format into the given * byte stream. */void unloadIntoByteStream(ImageData image) {	byte[] rgbs;	int numCols;	if (!((image.depth == 1) || (image.depth == 4) || (image.depth == 8) ||		  (image.depth == 16) || (image.depth == 24) || (image.depth == 32)))			SWT.error(SWT.ERROR_UNSUPPORTED_DEPTH);	int comp = this.compression;	if (!((comp == 0) || ((comp == 1) && (image.depth == 8)) ||		  ((comp == 2) && (image.depth == 4))))			SWT.error(SWT.ERROR_INVALID_IMAGE);	PaletteData pal = image.palette;	if ((image.depth == 16) || (image.depth == 24) || (image.depth == 32)) {		if (!pal.isDirect)			SWT.error(SWT.ERROR_INVALID_IMAGE);		numCols = 0;		rgbs = null;	} else {		if (pal.isDirect)			SWT.error(SWT.ERROR_INVALID_IMAGE);		numCols = pal.colors.length;		rgbs = paletteToBytes(pal);	}	// Fill in file header, except for bfsize, which is done later.	int headersSize = 54;	int[] fileHeader = new int[5];	fileHeader[0] = 0x4D42;	// Signature	fileHeader[1] = 0; // File size - filled in later	fileHeader[2] = 0; // Reserved 1	fileHeader[3] = 0; // Reserved 2	fileHeader[4] = headersSize; // Offset to data	if (rgbs != null) {		fileHeader[4] += rgbs.length;	}	// Prepare data. This is done first so we don't have to try to rewind	// the stream and fill in the details later.	ByteArrayOutputStream out = new ByteArrayOutputStream();	unloadData(image, out, comp);	byte[] compressedData = out.toByteArray();		// Calculate file size	fileHeader[1] = fileHeader[4] + compressedData.length;	// Write the headers	try {		outputStream.writeShort(fileHeader[0]);		outputStream.writeInt(fileHeader[1]);		outputStream.writeShort(fileHeader[2]);		outputStream.writeShort(fileHeader[3]);		outputStream.writeInt(fileHeader[4]);	} catch (IOException e) {		SWT.error(SWT.ERROR_IO, e);	}	try {		outputStream.writeInt(WinBMPFileFormat.BMPHeaderFixedSize);		outputStream.writeInt(image.width);		outputStream.writeInt(image.height);		outputStream.writeShort(1);		outputStream.writeShort((short)image.depth);		outputStream.writeInt(comp);		outputStream.writeInt(compressedData.length);		outputStream.writeInt(pelsPerMeter.x);		outputStream.writeInt(pelsPerMeter.y);		outputStream.writeInt(numCols);		outputStream.writeInt(importantColors);	} catch (IOException e) {		SWT.error(SWT.ERROR_IO, e);	}		// Unload palette	if (numCols > 0) {		try {			outputStream.write(rgbs);		} catch (IOException e) {			SWT.error(SWT.ERROR_IO, e);		}	}	// Unload the data	try {		outputStream.write(compressedData);	} catch (IOException e) {		SWT.error(SWT.ERROR_IO, e);	}}void flipScanLines(byte[] data, int stride, int height) {	int i1 = 0;	int i2 = (height - 1) * stride;	for (int i = 0; i < height / 2; i++) {		for (int index = 0; index < stride; index++) {			byte b = data[index + i1];			data[index + i1] = data[index + i2];			data[index + i2] = b;		}		i1 += stride;		i2 -= stride;	}}}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人激情电影免费在线观看| 欧美激情资源网| 国产一区二区在线观看免费 | 欧美日本精品一区二区三区| 国产精品456露脸| 午夜久久久久久久久| 国产精品久久久久影院色老大| 欧美日本一道本| 91在线视频播放地址| 韩国毛片一区二区三区| 亚洲国产精品精华液网站| 欧美国产精品专区| 精品久久久久一区二区国产| 欧美三级一区二区| 成人va在线观看| 韩国三级在线一区| 日本视频中文字幕一区二区三区| 亚洲女同ⅹxx女同tv| 久久久久久久性| 精品国产青草久久久久福利| 在线电影欧美成精品| 日本黄色一区二区| 9l国产精品久久久久麻豆| 国产黄色精品网站| 国产在线精品免费| 蜜臀国产一区二区三区在线播放| 亚洲在线成人精品| 亚洲精品亚洲人成人网在线播放| 亚洲欧美欧美一区二区三区| 久久久欧美精品sm网站| 欧美成人aa大片| 欧美xxxx老人做受| 日韩免费福利电影在线观看| 91精品免费观看| 欧美男人的天堂一二区| 欧美性大战久久久久久久| 色婷婷激情久久| 99视频精品在线| 99精品欧美一区二区三区小说 | 亚洲日本va在线观看| 中文字幕亚洲综合久久菠萝蜜| 久久青草欧美一区二区三区| 亚洲精品在线三区| 精品国精品自拍自在线| 欧美电影免费观看高清完整版| 在线不卡中文字幕播放| 91精品国产欧美一区二区成人 | 91精品办公室少妇高潮对白| 99视频在线观看一区三区| av资源网一区| 色999日韩国产欧美一区二区| 在线精品视频免费播放| 欧美日韩精品一二三区| 91精品国产综合久久婷婷香蕉 | 1024国产精品| 亚洲日本一区二区| 亚洲一区在线视频| 天堂成人免费av电影一区| 日产欧产美韩系列久久99| 极品少妇一区二区| 国产xxx精品视频大全| 99re热视频精品| 欧美性感一类影片在线播放| 日韩一级成人av| 久久久精品2019中文字幕之3| 国产精品色在线观看| 亚洲人成在线观看一区二区| 午夜欧美电影在线观看| 精品一区二区三区日韩| 国产精品乡下勾搭老头1| 99riav久久精品riav| 精品视频色一区| 精品99999| 亚洲欧美日韩在线| 麻豆国产一区二区| eeuss鲁片一区二区三区| 在线观看视频一区二区| 精品国产一二三区| 中文字幕一区日韩精品欧美| 亚洲午夜激情av| 国产一区二区三区美女| 色婷婷亚洲精品| 日韩一区二区在线免费观看| 久久久国产精品不卡| 亚洲精品欧美在线| 九九视频精品免费| 99久久国产综合色|国产精品| 欧美日韩日日摸| 国产精品丝袜久久久久久app| 亚洲高清免费观看高清完整版在线观看 | 国产成人av影院| 欧美性大战久久久久久久蜜臀| 久久综合色8888| 亚洲永久免费视频| 国产乱妇无码大片在线观看| 在线免费亚洲电影| 国产日韩欧美精品一区| 午夜视频一区二区| 不卡一区在线观看| 91精品国产一区二区三区香蕉| 中文成人综合网| 九九精品视频在线看| 欧美唯美清纯偷拍| 国产欧美一区二区三区鸳鸯浴| 亚洲国产裸拍裸体视频在线观看乱了 | 国产女人水真多18毛片18精品视频| 亚洲精品一二三四区| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 亚洲精品视频自拍| 国产成人精品一区二| 欧美一区二区福利在线| 亚洲男人的天堂av| 精品伊人久久久久7777人| 欧美在线观看18| 中文字幕视频一区| 国产精品影视在线| 日韩视频免费观看高清在线视频| 一区二区三区在线影院| 成人v精品蜜桃久久一区| 久久久久久久久一| 免费人成精品欧美精品| 精品视频免费看| 亚洲色图都市小说| 不卡一区中文字幕| 中文字幕乱码日本亚洲一区二区 | 欧美成人一区二区三区| 午夜精品在线看| 欧美日韩久久一区| 一区二区三区四区视频精品免费| www.欧美.com| 国产欧美日韩中文久久| 国内精品国产成人国产三级粉色| 欧美一级国产精品| 日本va欧美va精品发布| 欧美人牲a欧美精品| 亚洲3atv精品一区二区三区| 欧美怡红院视频| 亚洲五码中文字幕| 欧美亚洲国产一区二区三区va| 一区二区三区久久| 欧美视频在线一区| 亚洲成人免费视频| 欧美日韩免费一区二区三区视频| 亚洲愉拍自拍另类高清精品| 欧美视频在线观看一区二区| 亚洲一区二区三区国产| 欧美日韩亚洲综合在线| 亚洲制服丝袜一区| 欧美一级艳片视频免费观看| 免费成人在线播放| 日韩免费观看高清完整版| 国产综合一区二区| 国产精品日日摸夜夜摸av| 不卡一区二区在线| 一区二区三区精品在线| 欧美精品粉嫩高潮一区二区| 日本欧美一区二区在线观看| 欧美成人在线直播| 国产精品主播直播| 国产精品毛片久久久久久 | 久久午夜羞羞影院免费观看| 国产成人自拍高清视频在线免费播放| 中文字幕精品一区二区三区精品| 97se亚洲国产综合自在线不卡 | 国产成人在线影院 | 一区二区三区四区精品在线视频| 欧美视频在线一区二区三区| 男女男精品网站| 国产精品乱码一区二区三区软件 | 欧美日韩国产美| 久久99精品网久久| 国产精品福利av| 欧美日韩亚洲不卡| 国产精品99久久久久久似苏梦涵| 自拍av一区二区三区| 538在线一区二区精品国产| 国产精品自拍网站| 一区二区免费在线| 久久综合成人精品亚洲另类欧美| 99国产精品久久久久久久久久久| 亚洲成人免费在线| 亚洲国产精品v| 51午夜精品国产| 色综合视频在线观看| 青娱乐精品视频在线| 中文字幕一区免费在线观看| 欧美一区午夜视频在线观看| voyeur盗摄精品| 六月婷婷色综合| 亚洲伦理在线精品| 欧美精品一区二区三区四区| 精品视频一区二区不卡| 国产 欧美在线| 日本中文字幕不卡| 亚洲色图第一区| 久久蜜桃香蕉精品一区二区三区| 欧美午夜片在线观看| 粉嫩av一区二区三区在线播放| 免费看日韩a级影片| 亚洲另类春色国产|