本文整理汇总了Java中java.awt.color.ColorSpace.CS_GRAY属性的典型用法代码示例。如果您正苦于以下问题:Java ColorSpace.CS_GRAY属性的具体用法?Java ColorSpace.CS_GRAY怎么用?Java ColorSpace.CS_GRAY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.awt.color.ColorSpace
的用法示例。
在下文中一共展示了ColorSpace.CS_GRAY属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
public static void init() {
cmmRoot = new Group("cmm", "Color Management Benchmarks");
cmmRoot.setTabbed();
cmmOptRoot = new Group(cmmRoot, "opts", "General Options");
/*
usePlatfromProfiles =
new Option.Enable(cmmOptRoot, "csPlatfrom",
"Use Platfrom Profiles", false);
*/
int[] colorspaces = new int[] {
ColorSpace.CS_sRGB,
ColorSpace.CS_GRAY,
ColorSpace.CS_LINEAR_RGB,
ColorSpace.CS_CIEXYZ
};
String[] csNames = new String[]{
"CS_sRGB",
"CS_GRAY",
"CS_LINEAR_RGB",
"CS_CIEXYZ"
};
csList = new Option.IntList(cmmOptRoot,
"profiles", "Color Profiles",
colorspaces, csNames, csNames, 0x8);
ColorConversionTests.init();
ProfileTests.init();
}
示例2: getColorSpace
protected static ColorSpace getColorSpace(TestEnvironment env) {
ColorSpace cs;
Boolean usePlatfrom = true; //(Boolean)env.getModifier(usePlatfromProfiles);
int cs_code = env.getIntValue(csList);
if (usePlatfrom) {
cs = ColorSpace.getInstance(cs_code);
} else {
String resource = "profiles/";
switch (cs_code) {
case ColorSpace.CS_CIEXYZ:
resource += "CIEXYZ.pf";
break;
case ColorSpace.CS_GRAY:
resource += "GRAY.pf";
break;
case ColorSpace.CS_LINEAR_RGB:
resource += "LINEAR_RGB.pf";
break;
case ColorSpace.CS_PYCC:
resource += "PYCC.pf";
break;
case ColorSpace.CS_sRGB:
resource += "sRGB.pf";
break;
default:
throw new RuntimeException("Unknown color space: " + cs_code);
}
try {
InputStream is = CMMTests.class.getResourceAsStream(resource);
ICC_Profile p = ICC_Profile.getInstance(is);
cs = new ICC_ColorSpace(p);
} catch (IOException e) {
throw new RuntimeException("Unable load profile from resource " + resource, e);
}
}
return cs;
}
示例3: getCSName
static String getCSName(int cs) {
switch(cs) {
case ColorSpace.CS_GRAY:
return "CS_GRAY";
case ColorSpace.CS_CIEXYZ:
return "CS_CIEXYZ";
case ColorSpace.CS_LINEAR_RGB:
return "CS_LINEAR_RGB";
case ColorSpace.CS_PYCC:
return "CS_PYCC";
case ColorSpace.CS_sRGB:
return "CS_sRGB";
}
return "UNKNOWN";
}
示例4: init
public static void init() {
cmmRoot = new Group("cmm", "Color Management Benchmarks");
cmmRoot.setTabbed();
cmmOptRoot = new Group(cmmRoot, "opts", "General Options");
/*
usePlatformProfiles =
new Option.Enable(cmmOptRoot, "csPlatform",
"Use Platform Profiles", false);
*/
int[] colorspaces = new int[] {
ColorSpace.CS_sRGB,
ColorSpace.CS_GRAY,
ColorSpace.CS_LINEAR_RGB,
ColorSpace.CS_CIEXYZ
};
String[] csNames = new String[]{
"CS_sRGB",
"CS_GRAY",
"CS_LINEAR_RGB",
"CS_CIEXYZ"
};
csList = new Option.IntList(cmmOptRoot,
"profiles", "Color Profiles",
colorspaces, csNames, csNames, 0x8);
ColorConversionTests.init();
ProfileTests.init();
}
示例5: getColorSpace
protected static ColorSpace getColorSpace(TestEnvironment env) {
ColorSpace cs;
boolean usePlatform = true; //(Boolean)env.getModifier(usePlatformProfiles);
int cs_code = env.getIntValue(csList);
if (usePlatform) {
cs = ColorSpace.getInstance(cs_code);
} else {
String resource = "profiles/";
switch (cs_code) {
case ColorSpace.CS_CIEXYZ:
resource += "CIEXYZ.pf";
break;
case ColorSpace.CS_GRAY:
resource += "GRAY.pf";
break;
case ColorSpace.CS_LINEAR_RGB:
resource += "LINEAR_RGB.pf";
break;
case ColorSpace.CS_PYCC:
resource += "PYCC.pf";
break;
case ColorSpace.CS_sRGB:
resource += "sRGB.pf";
break;
default:
throw new RuntimeException("Unknown color space: " + cs_code);
}
try {
InputStream is = CMMTests.class.getResourceAsStream(resource);
ICC_Profile p = ICC_Profile.getInstance(is);
cs = new ICC_ColorSpace(p);
} catch (IOException e) {
throw new RuntimeException("Unable load profile from resource " + resource, e);
}
}
return cs;
}