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


Java ColorSpace.fromCIEXYZ方法代码示例

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


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

示例1: getColorComponents

import java.awt.color.ColorSpace; //导入方法依赖的package包/类
/**
 * Returns a {@code float} array containing only the color
 * components of the {@code Color} in the
 * {@code ColorSpace} specified by the {@code cspace}
 * parameter. If {@code compArray} is {@code null}, an array
 * with length equal to the number of components in
 * {@code cspace} is created for the return value.  Otherwise,
 * {@code compArray} must have at least this length, and it is
 * filled in with the components and returned.
 * @param cspace a specified {@code ColorSpace}
 * @param compArray an array that this method fills with the color
 *          components of this {@code Color} in the specified
 *          {@code ColorSpace}
 * @return the color components in a {@code float} array.
 */
public float[] getColorComponents(ColorSpace cspace, float[] compArray) {
    if (cs == null) {
        cs = ColorSpace.getInstance(ColorSpace.CS_sRGB);
    }
    float f[];
    if (fvalue == null) {
        f = new float[3];
        f[0] = ((float)getRed())/255f;
        f[1] = ((float)getGreen())/255f;
        f[2] = ((float)getBlue())/255f;
    } else {
        f = fvalue;
    }
    float tmp[] = cs.toCIEXYZ(f);
    float tmpout[] = cspace.fromCIEXYZ(tmp);
    if (compArray == null) {
        return tmpout;
    }
    for (int i = 0 ; i < tmpout.length ; i++) {
        compArray[i] = tmpout[i];
    }
    return compArray;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:39,代码来源:Color.java

示例2: getColorComponents

import java.awt.color.ColorSpace; //导入方法依赖的package包/类
/**
 * Returns a <code>float</code> array containing only the color
 * components of the <code>Color</code> in the
 * <code>ColorSpace</code> specified by the <code>cspace</code>
 * parameter. If <code>compArray</code> is <code>null</code>, an array
 * with length equal to the number of components in
 * <code>cspace</code> is created for the return value.  Otherwise,
 * <code>compArray</code> must have at least this length, and it is
 * filled in with the components and returned.
 * @param cspace a specified <code>ColorSpace</code>
 * @param compArray an array that this method fills with the color
 *          components of this <code>Color</code> in the specified
 *          <code>ColorSpace</code>
 * @return the color components in a <code>float</code> array.
 */
public float[] getColorComponents(ColorSpace cspace, float[] compArray) {
    if (cs == null) {
        cs = ColorSpace.getInstance(ColorSpace.CS_sRGB);
    }
    float f[];
    if (fvalue == null) {
        f = new float[3];
        f[0] = ((float)getRed())/255f;
        f[1] = ((float)getGreen())/255f;
        f[2] = ((float)getBlue())/255f;
    } else {
        f = fvalue;
    }
    float tmp[] = cs.toCIEXYZ(f);
    float tmpout[] = cspace.fromCIEXYZ(tmp);
    if (compArray == null) {
        return tmpout;
    }
    for (int i = 0 ; i < tmpout.length ; i++) {
        compArray[i] = tmpout[i];
    }
    return compArray;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:Color.java

示例3: runTest

import java.awt.color.ColorSpace; //导入方法依赖的package包/类
public void runTest(Object ctx, int numReps) {
    final Context ictx = (Context) ctx;
    final ColorSpace cs = ictx.cs;

    final float[] val = ictx.cie;
    do {
        try {
            cs.fromCIEXYZ(val);
        } catch (Exception e) {
            e.printStackTrace();
        }
    } while (--numReps >= 0);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:DataConversionTests.java

示例4: getComponents

import java.awt.color.ColorSpace; //导入方法依赖的package包/类
/**
 * Returns a <code>float</code> array containing the color and alpha
 * components of the <code>Color</code>, in the
 * <code>ColorSpace</code> specified by the <code>cspace</code>
 * parameter.  If <code>compArray</code> is <code>null</code>, an
 * array with length equal to the number of components in
 * <code>cspace</code> plus one is created for the return value.
 * Otherwise, <code>compArray</code> must have at least this
 * length, and it is filled in with the components and returned.
 * @param cspace a specified <code>ColorSpace</code>
 * @param compArray an array that this method fills with the
 *          color and alpha components of this <code>Color</code> in
 *          the specified <code>ColorSpace</code> and returns
 * @return the color and alpha components in a <code>float</code>
 *          array.
 */
public float[] getComponents(ColorSpace cspace, float[] compArray) {
    if (cs == null) {
        cs = ColorSpace.getInstance(ColorSpace.CS_sRGB);
    }
    float f[];
    if (fvalue == null) {
        f = new float[3];
        f[0] = ((float)getRed())/255f;
        f[1] = ((float)getGreen())/255f;
        f[2] = ((float)getBlue())/255f;
    } else {
        f = fvalue;
    }
    float tmp[] = cs.toCIEXYZ(f);
    float tmpout[] = cspace.fromCIEXYZ(tmp);
    if (compArray == null) {
        compArray = new float[tmpout.length + 1];
    }
    for (int i = 0 ; i < tmpout.length ; i++) {
        compArray[i] = tmpout[i];
    }
    if (fvalue == null) {
        compArray[tmpout.length] = ((float)getAlpha())/255f;
    } else {
        compArray[tmpout.length] = falpha;
    }
    return compArray;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:45,代码来源:Color.java

示例5: getComponents

import java.awt.color.ColorSpace; //导入方法依赖的package包/类
/**
 * Returns a {@code float} array containing the color and alpha
 * components of the {@code Color}, in the
 * {@code ColorSpace} specified by the {@code cspace}
 * parameter.  If {@code compArray} is {@code null}, an
 * array with length equal to the number of components in
 * {@code cspace} plus one is created for the return value.
 * Otherwise, {@code compArray} must have at least this
 * length, and it is filled in with the components and returned.
 * @param cspace a specified {@code ColorSpace}
 * @param compArray an array that this method fills with the
 *          color and alpha components of this {@code Color} in
 *          the specified {@code ColorSpace} and returns
 * @return the color and alpha components in a {@code float}
 *          array.
 */
public float[] getComponents(ColorSpace cspace, float[] compArray) {
    if (cs == null) {
        cs = ColorSpace.getInstance(ColorSpace.CS_sRGB);
    }
    float f[];
    if (fvalue == null) {
        f = new float[3];
        f[0] = ((float)getRed())/255f;
        f[1] = ((float)getGreen())/255f;
        f[2] = ((float)getBlue())/255f;
    } else {
        f = fvalue;
    }
    float tmp[] = cs.toCIEXYZ(f);
    float tmpout[] = cspace.fromCIEXYZ(tmp);
    if (compArray == null) {
        compArray = new float[tmpout.length + 1];
    }
    for (int i = 0 ; i < tmpout.length ; i++) {
        compArray[i] = tmpout[i];
    }
    if (fvalue == null) {
        compArray[tmpout.length] = ((float)getAlpha())/255f;
    } else {
        compArray[tmpout.length] = falpha;
    }
    return compArray;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:45,代码来源:Color.java


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