## Java Class Library

Under the directory Classes you will find a library of over 80 Java classes providing a basic image processing API. These classes are used extensively by the example applications found under the Apps directory; you can also use them to develop your own image processing software in Java. Full documentation for the classes, generated automatically from the source code, can be found in the Javadoc directory.

#### Structure

The library consists of four packages:

- `com.pearsoneduc.ip.gui`, providing classes for GUI building
- `com.pearsoneduc.ip.io`, providing classes for image input/output
- `com.pearsoneduc.ip.op`, providing image processing operators
- `com.pearsoneduc.ip.util`, providing various utility classes

The classes themselves exist in three forms:

- As `.java` files in a directory tree rooted under the Sources subdirectory
- As `.class` files in a directory tree rooted here in the Classes directory
- In a single JAR (Java Archive) file, `ip.jar`, here in the Classes directory

For example, consider the class `ImageFFT`. This is part of the `com.pearsoneduc.ip.op` package, so source code for the class is the file `ImageFFT.java` in the directory `Sources/com/pearsoneduc/ip/op` (relative to this, the Classes directory). The bytecode for this class is in `ImageFFT.class`, in the directory `com/pearsoneduc/ip/op` (relative to this directory). A copy of `ImageFFT.class` can also be found inside `ip.jar`.

#### Installation and Configuration

You could leave the class files on the CD and simply configure Java to search the CD for them. We do not recommend you do this, as it would be very slow. Fortunately, installing the class library on your hard disk is easy; simply choose a destination directory and copy the files `ip.jar` and `PNG.jar` to it. (The latter provides support for the handling of images in the PNG file format.)

You will then need to modify your classpath so that Java can find classes in the library. Suppose, for example, that you are installing on an MS-Windows system and that you have placed the two JAR files in the directory `C:\Java\IPBook`. To make the class library permanently accessible, add the following line to your `AUTOEXEC.BAT` file:

      set CLASSPATH=.;C:\Java\IPBook\ip.jar;C:\Java\IPBook\PNG.jar

(If you are already setting the classpath so that Java can access other classes, you will need to modify this command accordingly.)

On a UNIX machine, similar steps must be taken. If, for example, the two JAR files have been installed in a directory `/home/nick/java`, then the following bash shell commands will make the classes accessible:

      CLASSPATH=.:/home/nick/java/ip.jar:/home/nick/java/PNG.jar
      export CLASSPATH