Source Code Cross Referenced for FCT.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » com » sun » media » jai » opimage » 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 » com.sun.media.jai.opimage 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $RCSfile: FCT.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:56:25 $
010:         * $State: Exp $
011:         */
012:        package com.sun.media.jai.opimage;
013:
014:        import java.awt.image.DataBuffer;
015:        import javax.media.jai.operator.DFTDescriptor;
016:        import com.sun.media.jai.util.MathJAI;
017:
018:        /**
019:         * The Fast Cosine Transform (FCT) class.
020:         *
021:         * @since EA3
022:         */
023:        public class FCT {
024:            /*
025:             * Flag indicating whether the transform is forward (true)
026:             * or inverse (false).
027:             */
028:            protected boolean isForwardTransform;
029:
030:            /** The FFT object by which the FCT is actually calculated. */
031:            private FFT fft = null;
032:
033:            /** Default constructor */
034:            public FCT() {
035:            }
036:
037:            /**
038:             * Construct a new FCT object.
039:             *
040:             * @param length The length of the FCT; must be a positive power of 2.
041:             */
042:            public FCT(boolean isForwardTransform, int length) {
043:                // Cache the directional flag.
044:                this .isForwardTransform = isForwardTransform;
045:
046:                // Create the FFT object.
047:                fft = new FFT(isForwardTransform, new Integer(
048:                        DFTDescriptor.SCALING_NONE.getValue()), length);
049:            }
050:
051:            /**
052:             * Initialize the length-dependent fields.
053:             *
054:             * @param length The length of the FCT; must be a positive power of 2.
055:             */
056:            public void setLength(int length) {
057:                fft.setLength(length);
058:            }
059:
060:            /**
061:             * Set the internal work data array of the FCT object.
062:             *
063:             * @param dataType The data type of the source data according to
064:             * one of the DataBuffer TYPE_* flags. This should be either
065:             * DataBuffer.TYPE_FLOAT or DataBuffer.TYPE_DOUBLE.
066:             * @param data Float or double array of data.
067:             * @param offset Offset into the data array.
068:             * @param stride The data array stride value.
069:             * @param count The number of values to copy.
070:             */
071:            public void setData(int dataType, Object data, int offset,
072:                    int stride, int count) {
073:                if (isForwardTransform) {
074:                    fft.setFCTData(dataType, data, offset, stride, count);
075:                } else {
076:                    fft.setIFCTData(dataType, data, offset, stride, count);
077:                }
078:            }
079:
080:            /**
081:             * Get data from the internal work data array of the FCT object.
082:             *
083:             * @param dataType The data type of the source data according to
084:             * one of the DataBuffer TYPE_* flags. This should be either
085:             * DataBuffer.TYPE_FLOAT or DataBuffer.TYPE_DOUBLE.
086:             * @param data Float or double array of data.
087:             * @param offset Offset into the data array.
088:             * @param stride The data array stride value.
089:             */
090:            public void getData(int dataType, Object data, int offset,
091:                    int stride) {
092:                if (isForwardTransform) {
093:                    fft.getFCTData(dataType, data, offset, stride);
094:                } else {
095:                    fft.getIFCTData(dataType, data, offset, stride);
096:                }
097:            }
098:
099:            /**
100:             * Calculate the DCT of a sequence using the FCT algorithm.
101:             */
102:            public void transform() {
103:                fft.transform();
104:            }
105:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.