imager
Interface Application


public interface Application

Interface implemented by Applications like JPhotoBrush. Other classes can access some functionality through this interface. This interface is used by plugins to communicate with the Application


Method Summary
 void executeFilter(java.awt.image.ImageFilter imageFilter)
          requests the Application to execute a filter operation on the current image or on the selected region in the current image.
 int[] getImagePixels()
          Get the 1D int array of pixels of the current image.
 java.awt.Rectangle getSelectedImageBounds()
          returns the bounds of the selected image region in the image
 java.awt.Image getSelectedImagePortion()
          Get the selected image region (If no region is selected, it returns the complete current image).
 void imageLoaded(java.io.File imageFile, java.awt.Image image)
          Inform the image has been loaded
 void imageNotLoaded(java.lang.Exception e)
          Inform the image that exception occured while loading image
 void setProgress(int progress)
          informs the Application of the progress of the operation in terms of percentage.
 void setSelectedImagePortion(java.awt.Image image)
          Sets the image portion in the selected region to this image.
 

Method Detail

imageLoaded

public void imageLoaded(java.io.File imageFile,
                        java.awt.Image image)
Inform the image has been loaded

Parameters:
imageFile - java.io.File object of the image file
image - the java.awt.Image object

imageNotLoaded

public void imageNotLoaded(java.lang.Exception e)
Inform the image that exception occured while loading image


getSelectedImagePortion

public java.awt.Image getSelectedImagePortion()
Get the selected image region (If no region is selected, it returns the complete current image).

Returns:
java.awt.Image

getSelectedImageBounds

public java.awt.Rectangle getSelectedImageBounds()
returns the bounds of the selected image region in the image

Returns:
java.awt.Rectangle

setSelectedImagePortion

public void setSelectedImagePortion(java.awt.Image image)
Sets the image portion in the selected region to this image. if no selection is present, the whole image to replaced by this image portion

Parameters:
image - the image to be set in the selected region of the current image. If no region was selected, the whole image is replaced by the Image passed as the sole parameter.

getImagePixels

public int[] getImagePixels()
Get the 1D int array of pixels of the current image. If a region is selected it returns the 1D int array of pixels in the selected region.

Returns:
the 1D array of pixels

setProgress

public void setProgress(int progress)
informs the Application of the progress of the operation in terms of percentage.

Parameters:
progress - int value in percentage

executeFilter

public void executeFilter(java.awt.image.ImageFilter imageFilter)
requests the Application to execute a filter operation on the current image or on the selected region in the current image.

Parameters:
imageFilter - ImageFilter implemented by you. the Application will modify the current image or selected region in the current image and display it. This is the most widely used method of the Application. All you have to do is write a ImageFilter and then invoke this method to enable the Application to modify the image