Quickstart
Using jrawio in an application
You have to download the binary distribution, take jar file (jrawio-x.x.x.jar) and put it in the classpath. If you need to use jrawio for a NetBeans Platform application, the binary distribution contains a .nbm file ready to be used.
Using jrawio in a Maven application
Use these declarations in your pom:
<repositories>
<repository>
<id>maven2-release.tidalwave.it</id>
<name>Tidalwave Maven Release Repository</name>
<url>http://services.tidalwave.it/nexus/content/repositories/releases</url>
</repository>
</repositories>
...
<dependencies>
<dependency>
<groupId>it.tidalwave.imageio</groupId>
<artifactId>it.tidalwave.imageio.raw</artifactId>
<version>1.6.0</version>
</dependency>
</dependencies>
For the NetBeans Platform, use this variant:
<repositories>
<repository>
<id>maven2-release.tidalwave.it</id>
<name>Tidalwave Maven Release Repository</name>
<url>http://services.tidalwave.it/nexus/content/repositories/releases</url>
</repository>
</repositories>
...
<dependencies>
<dependency>
<groupId>it.tidalwave.imageio</groupId>
<artifactId>it-tidalwave-imageio-raw</artifactId>
<type>nbm</type>
<version>1.6.0</version>
</dependency>
</dependencies>
Accessing raster data
Once you've read a BufferedImage, you can manipulate it with the usual Java 2D API. For instance:
WritableRaster raster = image.getRaster() int sample = raster.getSample(x, y, band);
This is easy, but very slow if you have to read large amount of data. Another option is:
WritableRaster raster = image.getRaster() DataBufferUShort buffer = (DataBufferUShort)raster.getData(); final short[] data = buffer.getData();
In this way, the whole raster is available to you as an array of shorts. This is guaranteed for every camera model, since there are no models with more than 16 bits per sample. If reajent is disabled, samples are not normalized; that is, a saturated primary color is represented by 1 << number-of-bits-per-sample. For instance, a saturated primary color is 4095 for cameras with 12 bits per sample or 16383 for cameras with 14 bits per sample. Reajent, of course, normalizes values, so a saturated primary color is always 65535 (remember that short in Java is always signed, so you need to manipulate it properly).
There are also other ways to access data - please see the javadocs for Raster and WritableRaster.