An image processing pipeline is a system in which each image “stage” performs one specific operation on an image or a piece of an image, and then passes the resulting image data on to the next stage. The MrSID SDK uses this model to provide the ability to construct workflows that read, write, and manipulate images in a variety of ways.
There are three basic types of image stages:
The simplest pipeline consists trivially of just a single image reader. The reader may or may not be connected to one or more filter stages. (As we will see later, a writer may not be required for all workflows.)
In Figure 1 an image pipeline is shown consisting of a MrSID image reader connected to a filter that changes the image’s colorspace. Given a filename, the MrSID reader will pass pixel data to the filter, which will transform the (presumably RGB) pixel data to grayscale pixel data.
Figure 1: Simple pipeline with MrSID image reader and color space filter
Figure 2 shows a pipeline that reads raw image data (in BIP/BIL/BSQ form), performs some dynamic range adjustments on the data in a filter stage, and writes the image out again as a raw file. Such a pipeline might be used to massage 12-bit image data to more easily displayed 8-bit data.
Figure 2: Pipeline that reads and writes raw image data
Figure 3 shows a pipeline with two GeoTIFF image readers that are connected to a mosaicking stage, which is in turn connected to a JPEG 2000 writer. (The GeoTIFF images are presumed to be “compatible” in a geospatial sense.)
Figure 3: Pipeline with two image readers, a mosaicking filter and a JP2 writer
Finally, Figure 4 shows a watermarking pipeline: a JPEG watermark is inserted onto the base TIFF image, and the result is written to a MrSID file. Note how this pipeline diagram is structurally similar to Figure 3.
Figure 4: Watermarking pipeline
Several abstract classes are used to construct the pipeline system.
Figure 5 shows the inheritance diagram for these classes. These classes, and classes derived from them, are described in subsequent sections.
Figure 5: Inheritance
Another class, LTIImageStageManager, is a base class for managing a set of LTIImageStage objects – it can be thought of as an array of such objects. It used for passing a set of image stages to certain types of mosaic filters to reduce their resource usage. The LTIImageStageManager is also used for “wrapping” file formats that can hold multiple images.