KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > ext > awt > ColorSpaceHintKey


1 /*
2
3    Copyright 2002 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.ext.awt;
19
20 import java.awt.RenderingHints JavaDoc;
21
22 /**
23  * TranscodingHint as to what the destination of the drawing is.
24  *
25  * @author <a HREF="mailto:deweese@apache.org">Thomas DeWeese</a>
26  * @version $Id: ColorSpaceHintKey.java,v 1.3 2004/08/18 07:13:41 vhardy Exp $
27  */

28 public final class ColorSpaceHintKey extends RenderingHints.Key JavaDoc {
29
30     /**
31      * Notice to source that we prefer an Alpha RGB Image.
32      */

33     public static Object JavaDoc VALUE_COLORSPACE_ARGB = new Object JavaDoc();
34
35     /**
36      * Notice to source that we will not use Alpha Channel but
37      * we still want RGB data.
38      */

39     public static Object JavaDoc VALUE_COLORSPACE_RGB = new Object JavaDoc();
40
41     /**
42      * Notice to source that we only want Greyscale data (no Alpha).
43      */

44     public static Object JavaDoc VALUE_COLORSPACE_GREY = new Object JavaDoc();
45
46     /**
47      * Notice to source that we only want Greyscale data with
48      * an alpha channel.
49      */

50     public static Object JavaDoc VALUE_COLORSPACE_AGREY = new Object JavaDoc();
51
52     /**
53      * Notice to source that we only want an alpha channel.
54      * The source should simply render alpha (no conversion)
55      */

56     public static Object JavaDoc VALUE_COLORSPACE_ALPHA = new Object JavaDoc();
57
58     /**
59      * Notice to source that we only want an alpha channel.
60      * The source should follow the SVG spec for how to
61      * convert ARGB, RGB, Grey and AGrey to just an Alpha channel.
62      */

63     public static Object JavaDoc VALUE_COLORSPACE_ALPHA_CONVERT = new Object JavaDoc();
64
65     public static final String JavaDoc PROPERTY_COLORSPACE =
66         "org.apache.batik.gvt.filter.Colorspace";
67
68     /**
69      * Note that this is package private.
70      */

71     ColorSpaceHintKey(int number) { super(number); }
72
73     public boolean isCompatibleValue(Object JavaDoc val) {
74         if (val == VALUE_COLORSPACE_ARGB) return true;
75         if (val == VALUE_COLORSPACE_RGB) return true;
76         if (val == VALUE_COLORSPACE_GREY) return true;
77         if (val == VALUE_COLORSPACE_AGREY) return true;
78         if (val == VALUE_COLORSPACE_ALPHA) return true;
79         if (val == VALUE_COLORSPACE_ALPHA_CONVERT) return true;
80         return false;
81     }
82 }
83
84
Popular Tags