Source Code Cross Referenced for LogDescriptor.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: LogDescriptor.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:38 $
010:         * $State: Exp $
011:         */
012:        package javax.media.jai.operator;
013:
014:        import java.awt.RenderingHints;
015:        import java.awt.image.RenderedImage;
016:        import java.awt.image.renderable.RenderableImage;
017:        import javax.media.jai.JAI;
018:        import javax.media.jai.OperationDescriptorImpl;
019:        import javax.media.jai.ParameterBlockJAI;
020:        import javax.media.jai.RenderableOp;
021:        import javax.media.jai.RenderedOp;
022:        import javax.media.jai.registry.RenderableRegistryMode;
023:        import javax.media.jai.registry.RenderedRegistryMode;
024:
025:        /**
026:         * An <code>OperationDescriptor</code> describing the "Log" operation.
027:         *
028:         * <p> The "Log" operation takes the natural logarithm of the pixel
029:         * values of an image.  The operation is done on a per-pixel, per-band
030:         * basis.  For integral data types, the result will be rounded and
031:         * clamped as needed.  The pixel values of the destination image are
032:         * defined as:
033:         * <pre>
034:         * dst[x][y][b] = java.lang.Math.log(src[x][y][b])
035:         * </pre>
036:         *
037:         * <p> For all integral data types, the log of 0 is set to 0.  For
038:         * signed integral data types (<code>short</code> and <code>int</code>),
039:         * the log of a negative pixel value is set to -1.
040:         *
041:         * <p> For all floating point data types ((<code>float</code> and
042:         * <code>double</code>), the log of 0 is set to <code>-Infinity</code>,
043:         * and the log of a negative pixel value is set to <code>NaN</code>.
044:         *
045:         * <p><table border=1>
046:         * <caption>Resource List</caption>
047:         * <tr><th>Name</th>        <th>Value</th></tr>
048:         * <tr><td>GlobalName</td>  <td>Log</td></tr>
049:         * <tr><td>LocalName</td>   <td>Log</td></tr>
050:         * <tr><td>Vendor</td>      <td>com.sun.media.jai</td></tr>
051:         * <tr><td>Description</td> <td>Computes the natural logarithm of the pixel values
052:         *                              of an image.</td></tr>
053:         * <tr><td>DocURL</td>      <td>http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/LogDescriptor.html</td></tr>
054:         * <tr><td>Version</td>     <td>1.0</td></tr>
055:         * </table></p>
056:         *
057:         * <p> No parameters are needed for the "Log" operation.
058:         *
059:         * @see javax.media.jai.OperationDescriptor
060:         */
061:        public class LogDescriptor extends OperationDescriptorImpl {
062:
063:            /**
064:             * The resource strings that provide the general documentation
065:             * and specify the parameter list for this operation.
066:             */
067:            private static final String[][] resources = {
068:                    { "GlobalName", "Log" },
069:                    { "LocalName", "Log" },
070:                    { "Vendor", "com.sun.media.jai" },
071:                    { "Description", JaiI18N.getString("LogDescriptor0") },
072:                    {
073:                            "DocURL",
074:                            "http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/LogDescriptor.html" },
075:                    { "Version", JaiI18N.getString("DescriptorVersion") } };
076:
077:            /** Constructor. */
078:            public LogDescriptor() {
079:                super (resources, 1, null, null, null);
080:            }
081:
082:            /** Returns <code>true</code> since renderable operation is supported. */
083:            public boolean isRenderableSupported() {
084:                return true;
085:            }
086:
087:            /**
088:             * Computes the natural logarithm of the pixel values of an image.
089:             *
090:             * <p>Creates a <code>ParameterBlockJAI</code> from all
091:             * supplied arguments except <code>hints</code> and invokes
092:             * {@link JAI#create(String,ParameterBlock,RenderingHints)}.
093:             *
094:             * @see JAI
095:             * @see ParameterBlockJAI
096:             * @see RenderedOp
097:             *
098:             * @param source0 <code>RenderedImage</code> source 0.
099:             * @param hints The <code>RenderingHints</code> to use.
100:             * May be <code>null</code>.
101:             * @return The <code>RenderedOp</code> destination.
102:             * @throws IllegalArgumentException if <code>source0</code> is <code>null</code>.
103:             */
104:            public static RenderedOp create(RenderedImage source0,
105:                    RenderingHints hints) {
106:                ParameterBlockJAI pb = new ParameterBlockJAI("Log",
107:                        RenderedRegistryMode.MODE_NAME);
108:
109:                pb.setSource("source0", source0);
110:
111:                return JAI.create("Log", pb, hints);
112:            }
113:
114:            /**
115:             * Computes the natural logarithm of the pixel values of an image.
116:             *
117:             * <p>Creates a <code>ParameterBlockJAI</code> from all
118:             * supplied arguments except <code>hints</code> and invokes
119:             * {@link JAI#createRenderable(String,ParameterBlock,RenderingHints)}.
120:             *
121:             * @see JAI
122:             * @see ParameterBlockJAI
123:             * @see RenderableOp
124:             *
125:             * @param source0 <code>RenderableImage</code> source 0.
126:             * @param hints The <code>RenderingHints</code> to use.
127:             * May be <code>null</code>.
128:             * @return The <code>RenderableOp</code> destination.
129:             * @throws IllegalArgumentException if <code>source0</code> is <code>null</code>.
130:             */
131:            public static RenderableOp createRenderable(
132:                    RenderableImage source0, RenderingHints hints) {
133:                ParameterBlockJAI pb = new ParameterBlockJAI("Log",
134:                        RenderableRegistryMode.MODE_NAME);
135:
136:                pb.setSource("source0", source0);
137:
138:                return JAI.createRenderable("Log", pb, hints);
139:            }
140:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.