Class ALcdImagingEngine

java.lang.Object
com.luciad.imaging.ALcdImagingEngine
All Implemented Interfaces:
ILcdDisposable, AutoCloseable

public abstract class ALcdImagingEngine extends Object implements ILcdDisposable
Provides methods for reading pixel values out of an ALcdBasicImage.

Engine creation

This class should not be implemented by the user; implementations can be instantiated using the provided factory methods.

An imaging engine should be considered a heavy-weight object. It can hold system resources that are expensive to initialize or of which there are only a limited amount available. So an application should typically re-use a single engine multiple times. It should not create a engine for each individual processing request. Note that care should also be taken to dispose the engine when it is no longer needed.

Usage example

The following code snippet adds two images and then reads pixel values for the first tile out of the result:

 ALcdImagingEngine engine = ALcdImagingEngine.createEngine();
 try {
   ALcdBasicImage input1 = ...;
   ALcdBasicImage input2 = ...;
   ALcdBasicImage output = (ALcdBasicImage) TLcdBinaryOp.binaryOp(input1, input2, ADD);
   Rectangle region = output.getConfiguration().getTilePixelBounds(0, 0);
   Raster outputData = engine.getImageDataReadOnly(output, region);
   float[] pixel = new float[1]; // Assuming a single band image with float pixel data
   for (int y=0; y < region.height; y++) {
     for (int x=0; x < region.width; x++) {
       outputData.getPixel(outputData.getMinX() + x, outputData.getMinY() + y, pixel);
       System.out.println("Pixel at " + x + "," + y + ":" + pixel[0]);
     }
   }
 }
 finally {
   engine.dispose();
 }
 
Instances of this class are thread-safe.
Since:
2014.0