jdk/src/share/classes/java/awt/color/ColorSpace.java
changeset 16734 da1901d79073
parent 12813 c10ab96dcf41
child 21957 97758de70fbd
equal deleted inserted replaced
16733:9267ec7004a1 16734:da1901d79073
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    33  **********************************************************************
    33  **********************************************************************
    34  **********************************************************************/
    34  **********************************************************************/
    35 
    35 
    36 package java.awt.color;
    36 package java.awt.color;
    37 
    37 
    38 import javax.tools.annotation.GenerateNativeHeader;
    38 import java.lang.annotation.Native;
    39 
    39 
    40 import sun.java2d.cmm.PCMM;
    40 import sun.java2d.cmm.PCMM;
    41 import sun.java2d.cmm.CMSManager;
    41 import sun.java2d.cmm.CMSManager;
    42 
    42 
    43 
    43 
    93  *
    93  *
    94  * <p>
    94  * <p>
    95  * @see ICC_ColorSpace
    95  * @see ICC_ColorSpace
    96  */
    96  */
    97 
    97 
    98 /* No native methods here, but the constants are needed in the supporting JNI code */
       
    99 @GenerateNativeHeader
       
   100 public abstract class ColorSpace implements java.io.Serializable {
    98 public abstract class ColorSpace implements java.io.Serializable {
   101 
    99 
   102     static final long serialVersionUID = -409452704308689724L;
   100     static final long serialVersionUID = -409452704308689724L;
   103 
   101 
   104     private int type;
   102     private int type;
   113     private static ColorSpace LINEAR_RGBspace;
   111     private static ColorSpace LINEAR_RGBspace;
   114 
   112 
   115     /**
   113     /**
   116      * Any of the family of XYZ color spaces.
   114      * Any of the family of XYZ color spaces.
   117      */
   115      */
   118     public static final int TYPE_XYZ = 0;
   116     @Native public static final int TYPE_XYZ = 0;
   119 
   117 
   120     /**
   118     /**
   121      * Any of the family of Lab color spaces.
   119      * Any of the family of Lab color spaces.
   122      */
   120      */
   123     public static final int TYPE_Lab = 1;
   121     @Native public static final int TYPE_Lab = 1;
   124 
   122 
   125     /**
   123     /**
   126      * Any of the family of Luv color spaces.
   124      * Any of the family of Luv color spaces.
   127      */
   125      */
   128     public static final int TYPE_Luv = 2;
   126     @Native public static final int TYPE_Luv = 2;
   129 
   127 
   130     /**
   128     /**
   131      * Any of the family of YCbCr color spaces.
   129      * Any of the family of YCbCr color spaces.
   132      */
   130      */
   133     public static final int TYPE_YCbCr = 3;
   131     @Native public static final int TYPE_YCbCr = 3;
   134 
   132 
   135     /**
   133     /**
   136      * Any of the family of Yxy color spaces.
   134      * Any of the family of Yxy color spaces.
   137      */
   135      */
   138     public static final int TYPE_Yxy = 4;
   136     @Native public static final int TYPE_Yxy = 4;
   139 
   137 
   140     /**
   138     /**
   141      * Any of the family of RGB color spaces.
   139      * Any of the family of RGB color spaces.
   142      */
   140      */
   143     public static final int TYPE_RGB = 5;
   141     @Native public static final int TYPE_RGB = 5;
   144 
   142 
   145     /**
   143     /**
   146      * Any of the family of GRAY color spaces.
   144      * Any of the family of GRAY color spaces.
   147      */
   145      */
   148     public static final int TYPE_GRAY = 6;
   146     @Native public static final int TYPE_GRAY = 6;
   149 
   147 
   150     /**
   148     /**
   151      * Any of the family of HSV color spaces.
   149      * Any of the family of HSV color spaces.
   152      */
   150      */
   153     public static final int TYPE_HSV = 7;
   151     @Native public static final int TYPE_HSV = 7;
   154 
   152 
   155     /**
   153     /**
   156      * Any of the family of HLS color spaces.
   154      * Any of the family of HLS color spaces.
   157      */
   155      */
   158     public static final int TYPE_HLS = 8;
   156     @Native public static final int TYPE_HLS = 8;
   159 
   157 
   160     /**
   158     /**
   161      * Any of the family of CMYK color spaces.
   159      * Any of the family of CMYK color spaces.
   162      */
   160      */
   163     public static final int TYPE_CMYK = 9;
   161     @Native public static final int TYPE_CMYK = 9;
   164 
   162 
   165     /**
   163     /**
   166      * Any of the family of CMY color spaces.
   164      * Any of the family of CMY color spaces.
   167      */
   165      */
   168     public static final int TYPE_CMY = 11;
   166     @Native public static final int TYPE_CMY = 11;
   169 
   167 
   170     /**
   168     /**
   171      * Generic 2 component color spaces.
   169      * Generic 2 component color spaces.
   172      */
   170      */
   173     public static final int TYPE_2CLR = 12;
   171     @Native public static final int TYPE_2CLR = 12;
   174 
   172 
   175     /**
   173     /**
   176      * Generic 3 component color spaces.
   174      * Generic 3 component color spaces.
   177      */
   175      */
   178     public static final int TYPE_3CLR = 13;
   176     @Native public static final int TYPE_3CLR = 13;
   179 
   177 
   180     /**
   178     /**
   181      * Generic 4 component color spaces.
   179      * Generic 4 component color spaces.
   182      */
   180      */
   183     public static final int TYPE_4CLR = 14;
   181     @Native public static final int TYPE_4CLR = 14;
   184 
   182 
   185     /**
   183     /**
   186      * Generic 5 component color spaces.
   184      * Generic 5 component color spaces.
   187      */
   185      */
   188     public static final int TYPE_5CLR = 15;
   186     @Native public static final int TYPE_5CLR = 15;
   189 
   187 
   190     /**
   188     /**
   191      * Generic 6 component color spaces.
   189      * Generic 6 component color spaces.
   192      */
   190      */
   193     public static final int TYPE_6CLR = 16;
   191     @Native public static final int TYPE_6CLR = 16;
   194 
   192 
   195     /**
   193     /**
   196      * Generic 7 component color spaces.
   194      * Generic 7 component color spaces.
   197      */
   195      */
   198     public static final int TYPE_7CLR = 17;
   196     @Native public static final int TYPE_7CLR = 17;
   199 
   197 
   200     /**
   198     /**
   201      * Generic 8 component color spaces.
   199      * Generic 8 component color spaces.
   202      */
   200      */
   203     public static final int TYPE_8CLR = 18;
   201     @Native public static final int TYPE_8CLR = 18;
   204 
   202 
   205     /**
   203     /**
   206      * Generic 9 component color spaces.
   204      * Generic 9 component color spaces.
   207      */
   205      */
   208     public static final int TYPE_9CLR = 19;
   206     @Native public static final int TYPE_9CLR = 19;
   209 
   207 
   210     /**
   208     /**
   211      * Generic 10 component color spaces.
   209      * Generic 10 component color spaces.
   212      */
   210      */
   213     public static final int TYPE_ACLR = 20;
   211     @Native public static final int TYPE_ACLR = 20;
   214 
   212 
   215     /**
   213     /**
   216      * Generic 11 component color spaces.
   214      * Generic 11 component color spaces.
   217      */
   215      */
   218     public static final int TYPE_BCLR = 21;
   216     @Native public static final int TYPE_BCLR = 21;
   219 
   217 
   220     /**
   218     /**
   221      * Generic 12 component color spaces.
   219      * Generic 12 component color spaces.
   222      */
   220      */
   223     public static final int TYPE_CCLR = 22;
   221     @Native public static final int TYPE_CCLR = 22;
   224 
   222 
   225     /**
   223     /**
   226      * Generic 13 component color spaces.
   224      * Generic 13 component color spaces.
   227      */
   225      */
   228     public static final int TYPE_DCLR = 23;
   226     @Native public static final int TYPE_DCLR = 23;
   229 
   227 
   230     /**
   228     /**
   231      * Generic 14 component color spaces.
   229      * Generic 14 component color spaces.
   232      */
   230      */
   233     public static final int TYPE_ECLR = 24;
   231     @Native public static final int TYPE_ECLR = 24;
   234 
   232 
   235     /**
   233     /**
   236      * Generic 15 component color spaces.
   234      * Generic 15 component color spaces.
   237      */
   235      */
   238     public static final int TYPE_FCLR = 25;
   236     @Native public static final int TYPE_FCLR = 25;
   239 
   237 
   240     /**
   238     /**
   241      * The sRGB color space defined at
   239      * The sRGB color space defined at
   242      * <A href="http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html">
   240      * <A href="http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html">
   243      * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html
   241      * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html
   244      * </A>.
   242      * </A>.
   245      */
   243      */
   246     public static final int CS_sRGB = 1000;
   244     @Native public static final int CS_sRGB = 1000;
   247 
   245 
   248     /**
   246     /**
   249      * A built-in linear RGB color space.  This space is based on the
   247      * A built-in linear RGB color space.  This space is based on the
   250      * same RGB primaries as CS_sRGB, but has a linear tone reproduction curve.
   248      * same RGB primaries as CS_sRGB, but has a linear tone reproduction curve.
   251      */
   249      */
   252     public static final int CS_LINEAR_RGB = 1004;
   250     @Native public static final int CS_LINEAR_RGB = 1004;
   253 
   251 
   254     /**
   252     /**
   255      * The CIEXYZ conversion color space defined above.
   253      * The CIEXYZ conversion color space defined above.
   256      */
   254      */
   257     public static final int CS_CIEXYZ = 1001;
   255     @Native public static final int CS_CIEXYZ = 1001;
   258 
   256 
   259     /**
   257     /**
   260      * The Photo YCC conversion color space.
   258      * The Photo YCC conversion color space.
   261      */
   259      */
   262     public static final int CS_PYCC = 1002;
   260     @Native public static final int CS_PYCC = 1002;
   263 
   261 
   264     /**
   262     /**
   265      * The built-in linear gray scale color space.
   263      * The built-in linear gray scale color space.
   266      */
   264      */
   267     public static final int CS_GRAY = 1003;
   265     @Native public static final int CS_GRAY = 1003;
   268 
   266 
   269 
   267 
   270     /**
   268     /**
   271      * Constructs a ColorSpace object given a color space type
   269      * Constructs a ColorSpace object given a color space type
   272      * and the number of components.
   270      * and the number of components.