当前位置: 首页>>代码示例>>Java>>正文


Java Color.getRGBColorComponents方法代码示例

本文整理汇总了Java中java.awt.Color.getRGBColorComponents方法的典型用法代码示例。如果您正苦于以下问题:Java Color.getRGBColorComponents方法的具体用法?Java Color.getRGBColorComponents怎么用?Java Color.getRGBColorComponents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.Color的用法示例。


在下文中一共展示了Color.getRGBColorComponents方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: colorPixel

import java.awt.Color; //导入方法依赖的package包/类
/** @param x x location of pixel
 *@param y y location
 *@param fr the frame data
 *@param channel the RGB channel number 0-2
 *@param brightness the brightness 0-1
 */
final void colorPixel(final int x, final int y, final float[][][] fr, Color color){
	if((y<0) || (y>(fr.length-1)) || (x<0) || (x>(fr[0].length-1))) {
		return;
	}
	float[] rgb=color.getRGBColorComponents(null);
	float[] f=fr[y][x];
	for(int i=0;i<3;i++){
		f[i]=rgb[i];
	}
	//        fr[y][x][channel]=brightness;
	////        if(brightness<1){
	//        for(int i=0;i<3;i++){
	//            if(i!=channel) fr[y][x][i]=0;
	//        }
	////        }
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:23,代码来源:KalmanFilter.java

示例2: emitPSColor

import java.awt.Color; //导入方法依赖的package包/类
void emitPSColor(Color color) {
    if (color != null && color.equals(mColor) == false) {
        float[] rgb = color.getRGBColorComponents(null);

        /* If the color is a gray value then use
         * setgray.
         */
        if (rgb[0] == rgb[1] && rgb[1] == rgb[2]) {
            mPSStream.println(rgb[0] + SETGRAY_STR);

        /* It's not gray so use setrgbcolor.
         */
        } else {
            mPSStream.println(rgb[0] + " "
                              + rgb[1] + " "
                              + rgb[2] + " "
                              + SETRGBCOLOR_STR);
        }

        mColor = color;

    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:PSPrinterJob.java

示例3: colorPixel

import java.awt.Color; //导入方法依赖的package包/类
/** @param x x location of pixel
 *@param y y location
 *@param fr the frame data
 *@param channel the RGB channel number 0-2
 *@param brightness the brightness 0-1
 */
private void colorPixel (final int x,final int y,final float[][][] fr,int channel,Color color){
	if ( (y < 0) || (y > (fr.length - 1)) || (x < 0) || (x > (fr[0].length - 1)) ){
		return;
	}
	float[] rgb = color.getRGBColorComponents(null);
	float[] f = fr[y][x];
	System.arraycopy(rgb, 0, f, 0, 3);
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:15,代码来源:BlurringTunnelTracker.java

示例4: compareWithTolerance

import java.awt.Color; //导入方法依赖的package包/类
private static boolean compareWithTolerance(Color a, Color b, float delta) {
    float[] a_rgb = new float[3];
    a_rgb = a.getRGBColorComponents(a_rgb);
    float[] b_rgb = new float[3];
    b_rgb = b.getRGBColorComponents(b_rgb);

    for (int i = 0; i < 3; i++) {
        if (Math.abs(a_rgb[i] - b_rgb[i]) > delta) {
            return false;
        }
    }
    return true;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:ReadAsGrayTest.java

示例5: setColor

import java.awt.Color; //导入方法依赖的package包/类
public static void setColor(org.gephi.graph.api.Edge edge, Color color) {
	float[] rgb = color.getRGBColorComponents(null);

	edge.getEdgeData().setR(rgb[0]);
	edge.getEdgeData().setG(rgb[1]);
	edge.getEdgeData().setB(rgb[2]);
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:8,代码来源:Edge.java

示例6: selectSolidBrush

import java.awt.Color; //导入方法依赖的package包/类
protected void selectSolidBrush(Color color) {

        /* We only need to select a brush if the color has changed.
        */
        if (color.equals(mLastColor) == false) {
            mLastColor = color;
            float[] rgb = color.getRGBColorComponents(null);

            selectSolidBrush(getPrintDC(),
                             (int) (rgb[0] * MAX_WCOLOR),
                             (int) (rgb[1] * MAX_WCOLOR),
                             (int) (rgb[2] * MAX_WCOLOR));
        }
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:WPrinterJob.java

示例7: fillRect

import java.awt.Color; //导入方法依赖的package包/类
protected void fillRect(float x, float y, float width, float height,
                        Color color) {
    float[] rgb = color.getRGBColorComponents(null);

    fillRect(getPrintDC(), x, y, width, height,
             (int) (rgb[0] * MAX_WCOLOR),
             (int) (rgb[1] * MAX_WCOLOR),
             (int) (rgb[2] * MAX_WCOLOR));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:WPrinterJob.java

示例8: selectPen

import java.awt.Color; //导入方法依赖的package包/类
protected void selectPen(float width, Color color) {

        float[] rgb = color.getRGBColorComponents(null);

        selectPen(getPrintDC(), width,
                  (int) (rgb[0] * MAX_WCOLOR),
                  (int) (rgb[1] * MAX_WCOLOR),
                  (int) (rgb[2] * MAX_WCOLOR));
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:WPrinterJob.java

示例9: selectStylePen

import java.awt.Color; //导入方法依赖的package包/类
protected boolean selectStylePen(int cap, int join, float width,
                                 Color color) {

    long endCap;
    long lineJoin;

    float[] rgb = color.getRGBColorComponents(null);

    switch(cap) {
    case BasicStroke.CAP_BUTT: endCap = PS_ENDCAP_FLAT; break;
    case BasicStroke.CAP_ROUND: endCap = PS_ENDCAP_ROUND; break;
    default:
    case BasicStroke.CAP_SQUARE: endCap = PS_ENDCAP_SQUARE; break;
    }

    switch(join) {
    case BasicStroke.JOIN_BEVEL:lineJoin = PS_JOIN_BEVEL; break;
    default:
    case BasicStroke.JOIN_MITER:lineJoin = PS_JOIN_MITER; break;
    case BasicStroke.JOIN_ROUND:lineJoin = PS_JOIN_ROUND; break;
    }

    return (selectStylePen(getPrintDC(), endCap, lineJoin, width,
                           (int) (rgb[0] * MAX_WCOLOR),
                           (int) (rgb[1] * MAX_WCOLOR),
                           (int) (rgb[2] * MAX_WCOLOR)));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:WPrinterJob.java

示例10: setBorderColor

import java.awt.Color; //导入方法依赖的package包/类
public static void setBorderColor(Node node, Color borderColor) {
	float[] comp = borderColor.getRGBColorComponents(null);

	node.getAttributes().setValue(ATTR_BORDER_R, comp[0]);
	node.getAttributes().setValue(ATTR_BORDER_G, comp[1]);
	node.getAttributes().setValue(ATTR_BORDER_B, comp[2]);
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:8,代码来源:Vertex.java

示例11: setFillColor

import java.awt.Color; //导入方法依赖的package包/类
public static void setFillColor(Node node, Color fillColor) {
	float[] comp = fillColor.getRGBColorComponents(null);

	node.getNodeData().setR(comp[0]);
	node.getNodeData().setG(comp[1]);
	node.getNodeData().setB(comp[2]);
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:8,代码来源:Vertex.java

示例12: setTextColor

import java.awt.Color; //导入方法依赖的package包/类
/**
 * Set the GDI color for text drawing.
 */
protected void setTextColor(Color color) {

    /* We only need to select a brush if the color has changed.
    */
    if (color.equals(mLastTextColor) == false) {
        mLastTextColor = color;
        float[] rgb = color.getRGBColorComponents(null);

        setTextColor(getPrintDC(),
                     (int) (rgb[0] * MAX_WCOLOR),
                     (int) (rgb[1] * MAX_WCOLOR),
                     (int) (rgb[2] * MAX_WCOLOR));
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:18,代码来源:WPrinterJob.java


注:本文中的java.awt.Color.getRGBColorComponents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。