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

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

?? pngfileformat.java

?? 源碼為Eclipse開(kāi)源開(kāi)發(fā)平臺(tái)桌面開(kāi)發(fā)工具SWT的源代碼,
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v10.html *  * Contributors: *     IBM Corporation - initial API and implementation *******************************************************************************/package org.eclipse.swt.internal.image;import java.io.*;import org.eclipse.swt.*;import org.eclipse.swt.graphics.*;final class PNGFileFormat extends FileFormat {	static final int SIGNATURE_LENGTH = 8;	PngDecodingDataStream decodingStream;	PngIhdrChunk headerChunk;	PngPlteChunk paletteChunk;	PngTrnsChunk trnsChunk;	ImageData imageData;	byte[] data;	byte[] alphaPalette;/** * Skip over signature data. This has already been * verified in isPNGFile().  */void readSignature() throws IOException {	byte[] signature = new byte[SIGNATURE_LENGTH];	inputStream.read(signature);}/** * Load the PNG image from the byte stream. */ImageData[] loadFromByteStream() {	try {		readSignature();		PngChunkReader chunkReader = new PngChunkReader(inputStream);		headerChunk = chunkReader.getIhdrChunk();		int imageSize = getAlignedBytesPerRow() * headerChunk.getHeight();		data = new byte[imageSize];				imageData = ImageData.internal_new(			headerChunk.getWidth(),			headerChunk.getHeight(),			headerChunk.getSwtBitsPerPixel(),			new PaletteData(0, 0, 0),			4,			data,			0,			null,			null,			-1,			-1,			SWT.IMAGE_PNG,			0,			0,			0,			0);							if (headerChunk.usesDirectColor()) {			imageData.palette = headerChunk.getPaletteData();		}				// Read and process chunks until the IEND chunk is encountered.		while (chunkReader.hasMoreChunks()) {			readNextChunk(chunkReader);		}								return new ImageData[] {imageData};	} catch (IOException e) {		SWT.error(SWT.ERROR_INVALID_IMAGE);		return null;	}}/** * Read and handle the next chunk of data from the  * PNG file. */void readNextChunk(PngChunkReader chunkReader) {	PngChunk chunk = chunkReader.readNextChunk();	switch (chunk.getChunkType()) {		case PngChunk.CHUNK_IEND:			break;		case PngChunk.CHUNK_PLTE:			if (!headerChunk.usesDirectColor()) {				paletteChunk = (PngPlteChunk) chunk;				imageData.palette = paletteChunk.getPaletteData();									}						break;		case PngChunk.CHUNK_tRNS:			PngTrnsChunk trnsChunk = (PngTrnsChunk) chunk;			if (trnsChunk.getTransparencyType(headerChunk) == 				PngTrnsChunk.TRANSPARENCY_TYPE_PIXEL) 			{				imageData.transparentPixel = 					trnsChunk.getSwtTransparentPixel(headerChunk);			} else {				alphaPalette = trnsChunk.getAlphaValues(headerChunk, paletteChunk);				int transparentCount = 0, transparentPixel = -1;				for (int i = 0; i < alphaPalette.length; i++) {					if ((alphaPalette[i] & 0xFF) != 255) {						transparentCount++;						transparentPixel = i;					}				}				if (transparentCount == 0) {					alphaPalette = null;				} else if (transparentCount == 1 && alphaPalette[transparentPixel] == 0) {					alphaPalette = null;					imageData.transparentPixel = transparentPixel;				}			}			break;		case PngChunk.CHUNK_IDAT:			if (chunkReader.readPixelData()) {				// All IDAT chunks in an image file must be				// sequential. If the pixel data has already				// been read and another IDAT block is encountered,				// then this is an invalid image.				SWT.error(SWT.ERROR_INVALID_IMAGE);			} else {				// Read in the pixel data for the image. This should				// go through all the image's IDAT chunks. 					PngIdatChunk dataChunk = (PngIdatChunk) chunk;				readPixelData(dataChunk, chunkReader);							}			break;		default:			if (chunk.isCritical()) {				// All critical chunks must be supported.				SWT.error(SWT.ERROR_NOT_IMPLEMENTED);			}	}}void unloadIntoByteStream(ImageData p1) {	SWT.error(SWT.ERROR_NOT_IMPLEMENTED);}boolean isFileFormat(LEDataInputStream stream) {	try {		byte[] signature = new byte[SIGNATURE_LENGTH];		stream.read(signature);		stream.unread(signature);		if ((signature[0] & 0xFF) != 137) return false; //137		if ((signature[1] & 0xFF) != 80) return false; //P		if ((signature[2] & 0xFF) != 78) return false; //N		if ((signature[3] & 0xFF) != 71) return false; //G		if ((signature[4] & 0xFF) != 13) return false; //<RETURN>		if ((signature[5] & 0xFF) != 10) return false; //<LINEFEED>		if ((signature[6] & 0xFF) != 26) return false; //<CTRL/Z>		if ((signature[7] & 0xFF) != 10) return false; //<LINEFEED>				return true;	} catch (Exception e) {		return false;	}}/** * SWT does not support 16-bit depths. If this image uses * 16-bit depths, convert the data to an 8-bit depth. */byte[] validateBitDepth(byte[] data) {	if (headerChunk.getBitDepth() > 8) {		byte[] result = new byte[data.length / 2];		compress16BitDepthTo8BitDepth(data, 0, result, 0, result.length);		return result;	} else {		return data;	}}/** * SWT does not support greyscale as a color type. For * plain grayscale, we create a palette. For Grayscale * with Alpha, however, we need to convert the pixels * to use RGB values. * Note: This method assumes that the bit depth of the * data has already been restricted to 8 or less. */void setPixelData(byte[] data, ImageData imageData) {	switch (headerChunk.getColorType()) {		case PngIhdrChunk.COLOR_TYPE_GRAYSCALE_WITH_ALPHA:		{			int width = imageData.width;			int height = imageData.height;			int destBytesPerLine = imageData.bytesPerLine;			/*			* If the image uses 16-bit depth, it is converted			* to an 8-bit depth image.			*/			int srcBytesPerLine = getAlignedBytesPerRow();			if (headerChunk.getBitDepth() > 8) srcBytesPerLine /= 2;			byte[] rgbData = new byte[destBytesPerLine * height];			byte[] alphaData = new byte[width * height];			for (int y = 0; y < height; y++) {				int srcIndex = srcBytesPerLine * y;				int destIndex = destBytesPerLine * y;				int destAlphaIndex = width * y;				for (int x = 0; x < width; x++) {					byte grey = data[srcIndex];					byte alpha = data[srcIndex + 1];					rgbData[destIndex + 0] = grey;					rgbData[destIndex + 1] = grey;					rgbData[destIndex + 2] = grey;					alphaData[destAlphaIndex] = alpha;					srcIndex += 2;					destIndex += 3;					destAlphaIndex++;				}			}			imageData.data = rgbData;			imageData.alphaData = alphaData;			break;		}		case PngIhdrChunk.COLOR_TYPE_RGB_WITH_ALPHA:		{			int width = imageData.width;			int height = imageData.height;			int destBytesPerLine = imageData.bytesPerLine;			int srcBytesPerLine = getAlignedBytesPerRow();			/*			* If the image uses 16-bit depth, it is converted			* to an 8-bit depth image.			*/			if (headerChunk.getBitDepth() > 8) srcBytesPerLine /= 2;			byte[] rgbData = new byte[destBytesPerLine * height];			byte[] alphaData = new byte[width * height];			for (int y = 0; y < height; y++) {				int srcIndex = srcBytesPerLine * y;				int destIndex = destBytesPerLine * y;				int destAlphaIndex = width * y;				for (int x = 0; x < width; x++) {					rgbData[destIndex + 0] = data[srcIndex + 0];					rgbData[destIndex + 1] = data[srcIndex + 1];					rgbData[destIndex + 2] = data[srcIndex + 2];					alphaData[destAlphaIndex] = data[srcIndex + 3];					srcIndex += 4;					destIndex += 3;					destAlphaIndex++;				}			}			imageData.data = rgbData;			imageData.alphaData = alphaData;			break;		}				case PngIhdrChunk.COLOR_TYPE_RGB:			imageData.data = data;			break;		case PngIhdrChunk.COLOR_TYPE_PALETTE:			imageData.data = data;			if (alphaPalette != null) {				int size = imageData.width * imageData.height;				byte[] alphaData = new byte[size];				byte[] pixelData = new byte[size];				imageData.getPixels(0, 0, size, pixelData, 0);				for (int i = 0; i < pixelData.length; i++) {					alphaData[i] = alphaPalette[pixelData[i] & 0xFF];				}				imageData.alphaData = alphaData;			}			break;		default:			imageData.data = data;			break;	}}/** * PNG supports some color types and bit depths that are  * unsupported by SWT. If the image uses an unsupported * color type (either of the gray scale types) or bit * depth (16), convert the data to an SWT-supported * format. Then assign the data into the ImageData given. */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区三免费高清| 欧美一级高清大全免费观看| 欧美午夜精品一区二区三区 | 国产酒店精品激情| 色综合一个色综合亚洲| 久久久综合精品| 毛片不卡一区二区| 欧美天天综合网| 国产精品久久久久久久久免费相片| 日韩av中文字幕一区二区| 91在线码无精品| 国产精品入口麻豆原神| 久久精品国产亚洲5555| 欧美老肥妇做.爰bbww| 国产精品护士白丝一区av| 一本到三区不卡视频| 粉嫩高潮美女一区二区三区| 一区二区三区影院| 91精品国产一区二区三区香蕉| 六月婷婷色综合| 久久久精品综合| 欧美色图12p| 国产黑丝在线一区二区三区| 亚洲午夜精品在线| 日韩精品中文字幕在线不卡尤物| 亚洲乱码中文字幕综合| 日韩精品一区二区三区视频| 欧美一区二区三区视频在线| 欧美久久一区二区| 欧美乱熟臀69xxxxxx| 日韩视频中午一区| 精品国产自在久精品国产| 精品欧美一区二区在线观看| 91在线看国产| 国产欧美一区二区三区鸳鸯浴| 一区二区在线免费观看| 欧美在线观看你懂的| 亚洲国产一区视频| 7777精品伊人久久久大香线蕉 | 精品区一区二区| 精品伊人久久久久7777人| 日韩免费观看高清完整版| 国产综合色视频| 久久精品视频免费| 成人aa视频在线观看| 国产精品美女久久久久久久久久久| 国产69精品一区二区亚洲孕妇| 久久婷婷久久一区二区三区| 国产精品一区二区三区乱码| 国产精品私人自拍| 欧日韩精品视频| 91啪九色porn原创视频在线观看| 91色porny| 精品国产一区二区在线观看| 日韩精品一区二区三区在线播放| 精品女同一区二区| 久久久亚洲精品一区二区三区| 国产日韩精品视频一区| 久久精品视频免费观看| 久久嫩草精品久久久久| 亚洲桃色在线一区| 狠狠色2019综合网| 亚洲免费电影在线| 国产乱妇无码大片在线观看| 国产欧美日韩视频一区二区 | 国产精品电影一区二区| 色婷婷av一区二区三区之一色屋| 偷拍日韩校园综合在线| 久久久久国产成人精品亚洲午夜| av中文字幕不卡| 免费观看日韩av| 国产精品视频一区二区三区不卡| 在线欧美一区二区| 国产成人h网站| 日韩中文字幕一区二区三区| 久久久久九九视频| 欧美精品一卡二卡| 91在线视频网址| 久草这里只有精品视频| 亚洲乱码一区二区三区在线观看| 日韩一级片在线播放| 91在线云播放| 国产高清不卡二三区| 日本不卡在线视频| 亚洲人成伊人成综合网小说| 欧美变态口味重另类| 欧美日本国产视频| 99久久婷婷国产精品综合| 麻豆精品久久久| 午夜欧美一区二区三区在线播放| 欧美国产丝袜视频| 精品国产一二三区| 91麻豆精品国产无毒不卡在线观看| 99久精品国产| 成人精品小蝌蚪| 国产成人无遮挡在线视频| 麻豆国产欧美日韩综合精品二区| 一区二区三区不卡视频| 亚洲欧美中日韩| 欧美国产国产综合| 国产日韩精品视频一区| 久久夜色精品国产噜噜av| 欧美va亚洲va| 精品理论电影在线| 精品国精品国产| 欧美精品 日韩| 99在线精品观看| 国产sm精品调教视频网站| 国产精品一区三区| 樱花影视一区二区| 久久久久久久综合狠狠综合| 91久久奴性调教| 国产大陆精品国产| 石原莉奈一区二区三区在线观看| 欧美精品一区二区久久婷婷| 色婷婷久久综合| 国产91色综合久久免费分享| 老司机午夜精品| 精品久久久久久无| 欧美人狂配大交3d怪物一区| 欧美在线观看一二区| 欧美色爱综合网| 欧美一激情一区二区三区| 欧美电影免费观看高清完整版 | 亚洲精品国产高清久久伦理二区| 在线电影一区二区三区| 欧美成人伊人久久综合网| 精品久久久久久久一区二区蜜臀| 日韩免费看网站| 国产欧美日韩一区二区三区在线观看| 欧美激情一区二区三区全黄| 国产精品欧美一区喷水| 1000部国产精品成人观看| 一区二区不卡在线播放| 男人的天堂久久精品| 国产精品一区在线观看乱码| 成人激情图片网| 欧美日韩精品一区二区天天拍小说 | 欧美成人免费网站| 国产偷国产偷精品高清尤物 | 99久久综合99久久综合网站| 日本乱码高清不卡字幕| 7777精品伊人久久久大香线蕉完整版 | 成人激情免费视频| 在线亚洲人成电影网站色www| 欧美日免费三级在线| 日韩欧美国产综合一区 | 91色porny在线视频| 欧美日韩在线综合| 爽好多水快深点欧美视频| 亚洲a一区二区| 精品久久久久久久久久久久包黑料| 3751色影院一区二区三区| 欧美zozo另类异族| 一区二区三区在线观看动漫| 午夜久久久久久久久久一区二区| 亚洲午夜av在线| 成人污视频在线观看| 欧美亚一区二区| 国产精品美女久久久久久| 亚洲最大的成人av| 国产尤物一区二区在线| 国v精品久久久网| 在线观看免费亚洲| 久久久一区二区三区捆绑**| 亚洲一区二区在线免费看| 国产福利一区在线| 在线播放中文一区| 亚洲图片你懂的| 国产一区二区毛片| 91精品国产aⅴ一区二区| 国产精品视频观看| 美女久久久精品| 欧美天堂亚洲电影院在线播放| 亚洲国产高清不卡| 黄页网站大全一区二区| 制服丝袜中文字幕亚洲| 一区二区三区在线免费视频| 风间由美中文字幕在线看视频国产欧美| 欧美日韩高清一区二区三区| 亚洲视频每日更新| 成人免费看的视频| 久久久亚洲欧洲日产国码αv| 天天综合天天综合色| 日本精品免费观看高清观看| 国产精品卡一卡二| 高清在线观看日韩| 日本一区二区三区高清不卡| 韩国视频一区二区| 精品国产乱码久久久久久免费 | 亚洲免费观看高清完整版在线 | 精品一区二区三区欧美| 欧美高清www午色夜在线视频| 亚洲一区二区视频在线观看| 日本道色综合久久| 亚洲一区二区视频| 欧美三电影在线| 日韩在线一区二区| 欧美成人官网二区| 国产乱一区二区|