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


001:        /*
002:         * $RCSfile: TIFFImageDecoder.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.2 $
009:         * $Date: 2006/08/22 00:12:04 $
010:         * $State: Exp $
011:         */
012:        package com.sun.media.jai.codecimpl;
013:
014:        import java.awt.Point;
015:        import java.awt.Rectangle;
016:        import java.awt.Transparency;
017:        import java.awt.color.ColorSpace;
018:        import java.awt.image.ColorModel;
019:        import java.awt.image.DataBuffer;
020:        import java.awt.image.DataBufferByte;
021:        import java.awt.image.DataBufferShort;
022:        import java.awt.image.DataBufferUShort;
023:        import java.awt.image.Raster;
024:        import java.awt.image.WritableRaster;
025:        import java.awt.image.RenderedImage;
026:        import java.awt.image.SampleModel;
027:        import java.awt.image.IndexColorModel;
028:        import java.awt.image.MultiPixelPackedSampleModel;
029:        import java.awt.image.PixelInterleavedSampleModel;
030:        import java.awt.image.ComponentColorModel;
031:        import java.io.File;
032:        import java.io.InputStream;
033:        import java.io.IOException;
034:        import com.sun.media.jai.codec.ImageCodec;
035:        import com.sun.media.jai.codec.ImageDecoder;
036:        import com.sun.media.jai.codec.ImageDecoderImpl;
037:        import com.sun.media.jai.codec.ImageDecodeParam;
038:        import com.sun.media.jai.codec.SeekableStream;
039:        import com.sun.media.jai.codec.TIFFDecodeParam;
040:        import com.sun.media.jai.codec.TIFFDirectory;
041:        import com.sun.media.jai.codec.TIFFField;
042:        import com.sun.media.jai.codecimpl.util.RasterFactory;
043:
044:        /**
045:         * A baseline TIFF reader. The reader has some functionality in addition to 
046:         * the baseline specifications for Bilevel images, for which the group 3 and
047:         * group 4 decompression schemes have been implemented. Support for LZW 
048:         * decompression has also been added. Support for Horizontal differencing 
049:         * predictor decoding is also included, when used with LZW compression. 
050:         * However, this support is limited to data with bitsPerSample value of 8. 
051:         * When reading in RGB images, support for alpha and extraSamples being
052:         * present has been added. Support for reading in images with 16 bit samples
053:         * has been added. Support for the SampleFormat tag (signed samples as well
054:         * as floating-point samples) has also been added. In all other cases, support
055:         * is limited to Baseline specifications.
056:         *
057:         * @since EA3
058:         *
059:         */
060:        public class TIFFImageDecoder extends ImageDecoderImpl {
061:
062:            // All the TIFF tags that we care about
063:            public static final int TIFF_IMAGE_WIDTH = 256;
064:            public static final int TIFF_IMAGE_LENGTH = 257;
065:            public static final int TIFF_BITS_PER_SAMPLE = 258;
066:            public static final int TIFF_COMPRESSION = 259;
067:            public static final int TIFF_PHOTOMETRIC_INTERPRETATION = 262;
068:            public static final int TIFF_FILL_ORDER = 266;
069:            public static final int TIFF_STRIP_OFFSETS = 273;
070:            public static final int TIFF_SAMPLES_PER_PIXEL = 277;
071:            public static final int TIFF_ROWS_PER_STRIP = 278;
072:            public static final int TIFF_STRIP_BYTE_COUNTS = 279;
073:            public static final int TIFF_X_RESOLUTION = 282;
074:            public static final int TIFF_Y_RESOLUTION = 283;
075:            public static final int TIFF_PLANAR_CONFIGURATION = 284;
076:            public static final int TIFF_T4_OPTIONS = 292;
077:            public static final int TIFF_T6_OPTIONS = 293;
078:            public static final int TIFF_RESOLUTION_UNIT = 296;
079:            public static final int TIFF_PREDICTOR = 317;
080:            public static final int TIFF_COLORMAP = 320;
081:            public static final int TIFF_TILE_WIDTH = 322;
082:            public static final int TIFF_TILE_LENGTH = 323;
083:            public static final int TIFF_TILE_OFFSETS = 324;
084:            public static final int TIFF_TILE_BYTE_COUNTS = 325;
085:            public static final int TIFF_EXTRA_SAMPLES = 338;
086:            public static final int TIFF_SAMPLE_FORMAT = 339;
087:            public static final int TIFF_S_MIN_SAMPLE_VALUE = 340;
088:            public static final int TIFF_S_MAX_SAMPLE_VALUE = 341;
089:
090:            public TIFFImageDecoder(SeekableStream input, ImageDecodeParam param) {
091:                super (input, param);
092:            }
093:
094:            public int getNumPages() throws IOException {
095:                try {
096:                    return TIFFDirectory.getNumDirectories(input);
097:                } catch (Exception e) {
098:                    throw CodecUtils.toIOException(e);
099:                }
100:            }
101:
102:            public RenderedImage decodeAsRenderedImage(int page)
103:                    throws IOException {
104:                if ((page < 0) || (page >= getNumPages())) {
105:                    throw new IOException(JaiI18N
106:                            .getString("TIFFImageDecoder0"));
107:                }
108:                try {
109:                    return new TIFFImage(input, (TIFFDecodeParam) param, page);
110:                } catch (Exception e) {
111:                    throw CodecUtils.toIOException(e);
112:                }
113:            }
114:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.