Minor clean up and doc changes.

This commit is contained in:
Harald Kuhr 2011-02-16 22:11:03 +01:00
parent 4d9661f950
commit d772674223

View File

@ -165,7 +165,7 @@ public final class ColorSpaces {
// TODO: Document how to download, install and configure Adobe color profiles or other profiles
/**
* Gets or creates the color space specified by the given color space constant.
* Returns the color space specified by the given color space constant.
* <p />
* For standard Java color spaces, the built-in instance is returned.
* Otherwise, color spaces are looked up from cache and created on demand.
@ -196,7 +196,8 @@ public final class ColorSpaces {
catch (IOException ignore) {
}
// Fall back to the bundled ClayRGB1998 public domain Adobe RGB 1998 compatible profile
// Fall back to the bundled ClayRGB1998 public domain Adobe RGB 1998 compatible profile,
// identical for all practical purposes
InputStream stream = ColorSpaces.class.getResourceAsStream("/profiles/ClayRGB1998.icc");
try {
return createColorSpace(ICC_Profile.getInstance(stream));
@ -207,7 +208,7 @@ public final class ColorSpaces {
FileUtil.close(stream);
}
// Should never happen...
// Should never happen given we now bundle the profile...
throw new RuntimeException("Could not read AdobeRGB1998 profile");
case CS_GENERIC_CMYK:
@ -215,7 +216,11 @@ public final class ColorSpaces {
// TODO: C:\Windows\System32\spool\drivers\color\RSWOP.icm for Windows Vista?
try {
// This works for OS X only
// return createColorSpace(ICC_Profile.getInstance("/C:/Windows/System32/spool/drivers/color/RSWOP.icm"));
return createColorSpace(ICC_Profile.getInstance("/System/Library/ColorSync/Profiles/Generic CMYK Profile.icc"));
// return createColorSpace(ICC_Profile.getInstance("/Downloads/coated_FOGRA39L_argl.icc"));
// return createColorSpace(ICC_Profile.getInstance("/Downloads/RSWOP.icm"));
// return createColorSpace(ICC_Profile.getInstance("/Downloads/USWebCoatedSWOP.icc"));
}
catch (IOException ignore) {
}
@ -224,7 +229,7 @@ public final class ColorSpaces {
return CMYKColorSpace.getInstance();
default:
// TODO: Allow more customizable models based on the config file?
// TODO: Allow more customizable models based on the config file?
}
throw new IllegalArgumentException(String.format("Unsupported color space: %s", colorSpace));