Source Code Cross Referenced for ColorConvertDescriptor.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » javax » media » jai » operator » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » Java Advanced Imaging » javax.media.jai.operator 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $RCSfile: ColorConvertDescriptor.java,v $
003:         *
004:         * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
005:         *
006:         * Use is subject to license terms.
007:         *
008:         * $Revision: 1.1 $
009:         * $Date: 2005/02/11 04:57:31 $
010:         * $State: Exp $
011:         */
012:        package javax.media.jai.operator;
013:
014:        import java.awt.RenderingHints;
015:        import java.awt.image.ColorModel;
016:        import java.awt.image.RenderedImage;
017:        import java.awt.image.renderable.RenderableImage;
018:        import javax.media.jai.JAI;
019:        import javax.media.jai.OperationDescriptorImpl;
020:        import javax.media.jai.ParameterBlockJAI;
021:        import javax.media.jai.RenderableOp;
022:        import javax.media.jai.RenderedOp;
023:        import javax.media.jai.registry.RenderableRegistryMode;
024:        import javax.media.jai.registry.RenderedRegistryMode;
025:
026:        /**
027:         * An <code>OperationDescriptor</code> describing the "ColorConvert" operation.
028:         *
029:         * <p> The "ColorConvert" operation performs a pixel-by-pixel color
030:         * conversion of the data in a rendered or renderable source image.
031:         *
032:         * <p> The data are treated as having no alpha channel, i.e., all bands are
033:         * color bands.  The color space of the source image is specified by the
034:         * <code>ColorSpace</code> object of the source image <code>ColorModel</code>
035:         * which must not be <code>null</code>.  The color space of the destination
036:         * image is specified by the <code>ColorSpace</code> of the "colorModel"
037:         * parameter which must be a <code>ColorModel</code>.  If a
038:         * <code>ColorModel</code> is suggested via the <code>RenderingHints</code>
039:         * it is ignored.
040:         *
041:         * <p> The calculation pathway is selected to optimize performance and
042:         * accuracy based on which <code>ColorSpace</code> subclasses are used to
043:         * represent the source and destination color spaces.  The subclass
044:         * categories are <code>ICC_ColorSpace</code>, <code>ColorSpaceJAI</code>,
045:         * and generic <code>ColorSpace</code>, i.e., one which is not an instance
046:         * of either the two aforementioned subclasses.  Note that in the Sun
047:         * Microsystems implementation, an <code>ICC_ColorSpace</code> instance
048:         * is what is returned by <code>ColorSpace.getInstance()</code>.
049:         *
050:         * <p> Integral data are assumed to occupy the full range of the respective
051:         * data type; floating point data are assumed to be normalized to the range
052:         * [0.0,1.0].
053:         *
054:         * <p> By default, the destination image bounds, data type, and number of
055:         * bands are the same as those of the source image.
056:         *
057:         * <p><table border=1>
058:         * <caption>Resource List</caption>
059:         * <tr><th>Name</th>        <th>Value</th></tr>
060:         * <tr><td>GlobalName</td>  <td>ColorConvert</td></tr>
061:         * <tr><td>LocalName</td>   <td>ColorConvert</td></tr>
062:         * <tr><td>Vendor</td>      <td>com.sun.media.jai</td></tr>
063:         * <tr><td>Description</td> <td>Convert the color space of an image.<td></tr>
064:         * <tr><td>DocURL</td>      <td>http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/ColorConvertDescriptor.html</td></tr>
065:         * <tr><td>Version</td>     <td>1.0</td></tr>
066:         * <tr><td>arg0Desc</td>    <td>The destination <code>ColorModel</code>.</td></tr>
067:         * </table></p>
068:         *
069:         * <p><table border=1>
070:         * <caption>Parameter List</caption>
071:         * <tr><th>Name</th>      <th>Class Type</th>
072:         *                        <th>Default Value</th></tr>
073:         * <tr><td>colorModel</td> <td>java.awt.image.ColorModel</td>
074:         *                        <td>NO_PARAMETER_DEFAULT</td>
075:         * </table></p>
076:         *
077:         * @see javax.media.jai.OperationDescriptor
078:         * @see java.awt.color.ColorSpace
079:         * @see java.awt.color.ICC_ColorSpace
080:         * @see java.awt.image.ColorModel
081:         * @see javax.media.jai.ColorSpaceJAI
082:         * @see javax.media.jai.IHSColorSpace
083:         */
084:        public class ColorConvertDescriptor extends OperationDescriptorImpl {
085:
086:            /**
087:             * The resource strings that provide the general documentation
088:             * and specify the parameter list for this operation.
089:             */
090:            private static final String[][] resources = {
091:                    { "GlobalName", "ColorConvert" },
092:                    { "LocalName", "ColorConvert" },
093:                    { "Vendor", "com.sun.media.jai" },
094:                    { "Description",
095:                            JaiI18N.getString("ColorConvertDescriptor0") },
096:                    {
097:                            "DocURL",
098:                            "http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/ColorConvertDescriptor.html" },
099:                    { "Version", JaiI18N.getString("DescriptorVersion2") },
100:                    { "arg0Desc", JaiI18N.getString("ColorConvertDescriptor1") } };
101:
102:            /**
103:             * The parameter class list for this operation.
104:             */
105:            private static final Class[] paramClasses = { java.awt.image.ColorModel.class };
106:
107:            /** The parameter name list for this operation. */
108:            private static final String[] paramNames = { "colorModel" };
109:
110:            /** The parameter default value list for this operation. */
111:            private static final Object[] paramDefaults = { NO_PARAMETER_DEFAULT };
112:
113:            /** Constructor. */
114:            public ColorConvertDescriptor() {
115:                super (resources, 1, paramClasses, paramNames, paramDefaults);
116:            }
117:
118:            /** Returns <code>true</code> since renderable operation is supported. */
119:            public boolean isRenderableSupported() {
120:                return true;
121:            }
122:
123:            /**
124:             * Convert the color space of an image.
125:             *
126:             * <p>Creates a <code>ParameterBlockJAI</code> from all
127:             * supplied arguments except <code>hints</code> and invokes
128:             * {@link JAI#create(String,ParameterBlock,RenderingHints)}.
129:             *
130:             * @see JAI
131:             * @see ParameterBlockJAI
132:             * @see RenderedOp
133:             *
134:             * @param source0 <code>RenderedImage</code> source 0.
135:             * @param colorModel The destination color space.
136:             * @param hints The <code>RenderingHints</code> to use.
137:             * May be <code>null</code>.
138:             * @return The <code>RenderedOp</code> destination.
139:             * @throws IllegalArgumentException if <code>source0</code> is <code>null</code>.
140:             * @throws IllegalArgumentException if <code>colorModel</code> is <code>null</code>.
141:             */
142:            public static RenderedOp create(RenderedImage source0,
143:                    ColorModel colorModel, RenderingHints hints) {
144:                ParameterBlockJAI pb = new ParameterBlockJAI("ColorConvert",
145:                        RenderedRegistryMode.MODE_NAME);
146:
147:                pb.setSource("source0", source0);
148:
149:                pb.setParameter("colorModel", colorModel);
150:
151:                return JAI.create("ColorConvert", pb, hints);
152:            }
153:
154:            /**
155:             * Convert the color space of an image.
156:             *
157:             * <p>Creates a <code>ParameterBlockJAI</code> from all
158:             * supplied arguments except <code>hints</code> and invokes
159:             * {@link JAI#createRenderable(String,ParameterBlock,RenderingHints)}.
160:             *
161:             * @see JAI
162:             * @see ParameterBlockJAI
163:             * @see RenderableOp
164:             *
165:             * @param source0 <code>RenderableImage</code> source 0.
166:             * @param colorModel The destination color space.
167:             * @param hints The <code>RenderingHints</code> to use.
168:             * May be <code>null</code>.
169:             * @return The <code>RenderableOp</code> destination.
170:             * @throws IllegalArgumentException if <code>source0</code> is <code>null</code>.
171:             * @throws IllegalArgumentException if <code>colorModel</code> is <code>null</code>.
172:             */
173:            public static RenderableOp createRenderable(
174:                    RenderableImage source0, ColorModel colorModel,
175:                    RenderingHints hints) {
176:                ParameterBlockJAI pb = new ParameterBlockJAI("ColorConvert",
177:                        RenderableRegistryMode.MODE_NAME);
178:
179:                pb.setSource("source0", source0);
180:
181:                pb.setParameter("colorModel", colorModel);
182:
183:                return JAI.createRenderable("ColorConvert", pb, hints);
184:            }
185:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.