mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-02 11:05:29 -04:00
Renamed CS constant to be more consistent.
This commit is contained in:
parent
5c6c9e3e26
commit
47ab16457a
@ -51,7 +51,7 @@ public final class ColorSpaces {
|
||||
// NOTE: java.awt.color.ColorSpace.CS_* uses 1000-1004, we'll use 5000+ to not interfere with future additions
|
||||
|
||||
/** The Adobe RGB 1998 (or compatible) color space. Either read from disk or built-in. */
|
||||
public static final int CS_ADOBE_RGB_98 = 5000;
|
||||
public static final int CS_ADOBE_RGB_1998 = 5000;
|
||||
|
||||
/** A best-effort "generic" CMYK color space. Either read from disk or built-in. */
|
||||
public static final int CS_GENERIC_CMYK = 5001;
|
||||
@ -175,7 +175,7 @@ public final class ColorSpaces {
|
||||
* @return the {@link ColorSpace} specified by the color space constant.
|
||||
* @throws IllegalArgumentException if {@code colorSpace} is not one of the defined color spaces ({@code CS_*}).
|
||||
* @see ColorSpace
|
||||
* @see ColorSpaces#CS_ADOBE_RGB_98
|
||||
* @see ColorSpaces#CS_ADOBE_RGB_1998
|
||||
* @see ColorSpaces#CS_GENERIC_CMYK
|
||||
*/
|
||||
public static ColorSpace getColorSpace(int colorSpace) {
|
||||
@ -188,7 +188,7 @@ public final class ColorSpaces {
|
||||
case ColorSpace.CS_LINEAR_RGB:
|
||||
return ColorSpace.getInstance(colorSpace);
|
||||
|
||||
case CS_ADOBE_RGB_98:
|
||||
case CS_ADOBE_RGB_1998:
|
||||
// TODO: Read profile specified by config file instead of hard coded
|
||||
try {
|
||||
// This works for OS X only
|
||||
|
@ -121,18 +121,18 @@ public class ColorSpacesTest {
|
||||
|
||||
@Test
|
||||
public void testAdobeRGB98NotNull() {
|
||||
assertNotNull(ColorSpaces.getColorSpace(ColorSpaces.CS_ADOBE_RGB_98));
|
||||
assertNotNull(ColorSpaces.getColorSpace(ColorSpaces.CS_ADOBE_RGB_1998));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAdobeRGB98IsTypeRGB() {
|
||||
assertEquals(ColorSpace.TYPE_RGB, ColorSpaces.getColorSpace(ColorSpaces.CS_ADOBE_RGB_98).getType());
|
||||
assertEquals(ColorSpace.TYPE_RGB, ColorSpaces.getColorSpace(ColorSpaces.CS_ADOBE_RGB_1998).getType());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAdobeRGB98AlwaysSame() {
|
||||
ColorSpace cs = ColorSpaces.getColorSpace(ColorSpaces.CS_ADOBE_RGB_98);
|
||||
assertSame(cs, ColorSpaces.getColorSpace(ColorSpaces.CS_ADOBE_RGB_98));
|
||||
ColorSpace cs = ColorSpaces.getColorSpace(ColorSpaces.CS_ADOBE_RGB_1998);
|
||||
assertSame(cs, ColorSpaces.getColorSpace(ColorSpaces.CS_ADOBE_RGB_1998));
|
||||
|
||||
if (cs instanceof ICC_ColorSpace) {
|
||||
ICC_ColorSpace iccCs = (ICC_ColorSpace) cs;
|
||||
|
Loading…
x
Reference in New Issue
Block a user