javacolormodel.java

来自「kaffe是一个java虚拟机的源代码。里面包含了一些java例程和标准的jav」· Java 代码 · 共 56 行

JAVA
56
字号
package kaffe.awt;import java.awt.image.ColorModel;/** * JavaColorModel - This is a ColorModel for Javas own color 8888 ARGB scheme. * It doesn't make sense to do all the bit shuffling if we just return what * we get in. Unfortunately, we can't derive that from DirectColorModel * (which is actually is) because of all the final methods (spec, again) * in there * * Copyright (c) 1999 *      Transvirtual Technologies, Inc.  All rights reserved. * * See the file "license.terms" for information on usage and redistribution * of this file. * * @author P. Mehlitz */public class JavaColorModel  extends ColorModel{	static JavaColorModel singleton;public JavaColorModel () {	super( 32);}public int getAlpha ( int pixel ){	return (pixel & 0xff000000);}public int getBlue ( int pixel ){	return (pixel & 0xff);}public int getGreen ( int pixel ){	return (pixel & 0xff00);}public int getRGB ( int pixel ) {	return pixel;}public int getRed ( int pixel ){	return (pixel & 0xff0000);}public static JavaColorModel getSingleton() {	if (singleton == null)		singleton = new JavaColorModel();	return singleton;}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?