org.geotools.image.io

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 » GIS » GeoTools 2.4.1 » org.geotools.image.io 
org.geotools.image.io
package org.geotools.image.io Extensions to {@link javax.imageio.ImageReader} for binary and ASCII files.

{@link org.geotools.image.io.StreamImageReader} is the base class for image decoders reading stream with few (if any) meta-data. Examples of such streams are matrix containing the pixels values in a binary form (RAW images), or ASCII files containing values written as decimal numbers. Such files contain often geophysical values (e.g. temperature in Celsius degrees, elevation in metres, etc.) better represented as floating point numbers than integers.

By default, {@link org.geotools.image.io.StreamImageReader} stores decoded image using data type {@link java.awt.image.DataBuffer#TYPE_FLOAT} and a grayscale color space. This politic produce images matching closely the original data, i.e. it involves as few transformations as possible. But displaying floating-point images is usually very slow. Users are strongly encouraged to use Java Advanced Imaging's operations after reading in order to scale data as they see fit. The example below reformats the {@link java.awt.image.DataBuffer#TYPE_FLOAT} data into {@link java.awt.image.DataBuffer#TYPE_BYTE} and changes the grayscale colors to an indexed color model.

 


import {@link javax.media.jai.JAI javax.media.jai.JAI};
import {@link javax.media.jai.ImageLayout javax.media.jai.ImageLayout};
import {@link java.awt.RenderingHints java.awt.RenderingHints};
import {@link java.awt.image.DataBuffer java.awt.image.DataBuffer};
import {@link java.awt.image.IndexColorModel java.awt.image.IndexColorModel};
import {@link java.awt.image.renderable.ParameterBlock java.awt.image.renderable.ParameterBlock};

// Omitting class and method declaration...


/*
 * Prepare the indexed color model. Arrays
 * R, G and B should contains 256 RGB values.
 */
final byte[] R=...
final byte[] G=...
final byte[] B=...
final IndexColorModel colors = new IndexColorModel(8, 256, R,G,B);
final ImageLayout     layout = new ImageLayout().setColorModel(colorModel);
final RenderingHints   hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout);

/*
 * Rescale the image.   First, all pixels values are transformed using
 * the equation pi=CO+C1*p. Then, type float is clamp to type byte and
 * the new index color model is set.   Displaying such an image should
 * be much faster.
 */
final double C0 = ...
final double C1 = ...
image = JAI.create("Rescale", new ParameterBlock().addSource(image).add(new double[]{C1}).add(new double[]{C0}));
image = JAI.create("Format",  new ParameterBlock().addSource(image).add(DataBuffer.TYPE_BYTE), hints);
Java Source File NameTypeComment
ContinuousPalette.javaClass A factory for building suitable for DataBuffer.TYPE_FLOAT .
FileImageReader.javaClass Base class for image readers that require File input source.
GeographicImageReader.javaClass Base class for readers of geographic images.
GeographicImageReaderTest.javaClass Tests GeographicImageReader .
GeographicImageReadParam.javaClass Default parameters for GeographicImageReader .
GeographicImageWriter.javaClass Base class for writers of geographic images.
GeographicImageWriterTest.javaClass Tests GeographicImageWriter , especially the RectIter creation.
IIOListeners.javaClass A container of image I/O listeners.
IIOReadProgressAdapter.javaClass An abstract adapter class for receiving image progress events. The methods in this class are empty.
IndexedPalette.javaClass A set of RGB colors created by a from a name. A palette can creates an or an from the RGB colors.
InputStreamAdapter.javaClass Wraps an ImageInputStream into a standard InputStream .
NullImageReader.javaClass A null implementation of GeographicImageReader for testing purpose.
OutputStreamAdapter.javaClass Wraps an ImageOutputStream into a standard OutputStream .
Palette.javaClass A set of RGB colors created by a from a .
PaletteDisposer.javaClass Allows garbage-collection of Palette after their index color model has been garbage collected.
PaletteFactory.javaClass A factory for created from RGB values listed in files.
PaletteTest.javaClass Tests Palette and PaletteFactory .
RawBinaryImageReadParam.javaClass A class describing how a raw binary stream is to be decoded.
SampleConverter.javaClass Converts samples from the values stored in the image file to the values stored in the .
ScaledColorSpace.javaClass Color space for images storing pixels as real numbers.
SimpleImageReader.javaClass Base class for simple image decoders.
StreamImageReader.javaClass Base class for simple image decoders.
StreamImageWriter.javaClass Base class for simple image encoders.
SubsampledRectIter.javaClass A RectIter with subsampling.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.