java.awt.image
Class CropImageFilter

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.image.ImageFilter sample code for java.awt.image.ImageFilter definition code for java.awt.image.ImageFilter 
      extended by java.awt.image.CropImageFilter
All Implemented Interfaces:
ImageConsumer sample code for java.awt.image.ImageConsumer definition code for java.awt.image.ImageConsumer , Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

public class CropImageFilter
extends ImageFilter sample code for java.awt.image.ImageFilter definition code for java.awt.image.ImageFilter

An ImageFilter class for cropping images. This class extends the basic ImageFilter Class to extract a given rectangular region of an existing Image and provide a source for a new image containing just the extracted region. It is meant to be used in conjunction with a FilteredImageSource object to produce cropped versions of existing images.

See Also:
FilteredImageSource sample code for java.awt.image.FilteredImageSource definition code for java.awt.image.FilteredImageSource , ImageFilter sample code for java.awt.image.ImageFilter definition code for java.awt.image.ImageFilter

Field Summary
 
Fields inherited from class java.awt.image.ImageFilter sample code for java.awt.image.ImageFilter definition code for java.awt.image.ImageFilter
consumer sample code for java.awt.image.ImageFilter.consumer definition code for java.awt.image.ImageFilter.consumer
 
Fields inherited from interface java.awt.image.ImageConsumer sample code for java.awt.image.ImageConsumer definition code for java.awt.image.ImageConsumer
COMPLETESCANLINES sample code for java.awt.image.ImageConsumer.COMPLETESCANLINES definition code for java.awt.image.ImageConsumer.COMPLETESCANLINES , IMAGEABORTED sample code for java.awt.image.ImageConsumer.IMAGEABORTED definition code for java.awt.image.ImageConsumer.IMAGEABORTED , IMAGEERROR sample code for java.awt.image.ImageConsumer.IMAGEERROR definition code for java.awt.image.ImageConsumer.IMAGEERROR , RANDOMPIXELORDER sample code for java.awt.image.ImageConsumer.RANDOMPIXELORDER definition code for java.awt.image.ImageConsumer.RANDOMPIXELORDER , SINGLEFRAME sample code for java.awt.image.ImageConsumer.SINGLEFRAME definition code for java.awt.image.ImageConsumer.SINGLEFRAME , SINGLEFRAMEDONE sample code for java.awt.image.ImageConsumer.SINGLEFRAMEDONE definition code for java.awt.image.ImageConsumer.SINGLEFRAMEDONE , SINGLEPASS sample code for java.awt.image.ImageConsumer.SINGLEPASS definition code for java.awt.image.ImageConsumer.SINGLEPASS , STATICIMAGEDONE sample code for java.awt.image.ImageConsumer.STATICIMAGEDONE definition code for java.awt.image.ImageConsumer.STATICIMAGEDONE , TOPDOWNLEFTRIGHT sample code for java.awt.image.ImageConsumer.TOPDOWNLEFTRIGHT definition code for java.awt.image.ImageConsumer.TOPDOWNLEFTRIGHT
 
Constructor Summary
CropImageFilter sample code for java.awt.image.CropImageFilter.CropImageFilter(int, int, int, int) definition code for java.awt.image.CropImageFilter.CropImageFilter(int, int, int, int) (int x, int y, int w, int h)
          Constructs a CropImageFilter that extracts the absolute rectangular region of pixels from its source Image as specified by the x, y, w, and h parameters.
 
Method Summary
 void setDimensions sample code for java.awt.image.CropImageFilter.setDimensions(int, int) definition code for java.awt.image.CropImageFilter.setDimensions(int, int) (int w, int h)
          Override the source image's dimensions and pass the dimensions of the rectangular cropped region to the ImageConsumer.
 void setPixels sample code for java.awt.image.CropImageFilter.setPixels(int, int, int, int, java.awt.image.ColorModel, byte[], int, int) definition code for java.awt.image.CropImageFilter.setPixels(int, int, int, int, java.awt.image.ColorModel, byte[], int, int) (int x, int y, int w, int h, ColorModel sample code for java.awt.image.ColorModel definition code for java.awt.image.ColorModel  model, byte[] pixels, int off, int scansize)
          Determine whether the delivered byte pixels intersect the region to be extracted and passes through only that subset of pixels that appear in the output region.
 void setPixels sample code for java.awt.image.CropImageFilter.setPixels(int, int, int, int, java.awt.image.ColorModel, int[], int, int) definition code for java.awt.image.CropImageFilter.setPixels(int, int, int, int, java.awt.image.ColorModel, int[], int, int) (int x, int y, int w, int h, ColorModel sample code for java.awt.image.ColorModel definition code for java.awt.image.ColorModel  model, int[] pixels, int off, int scansize)
          Determine if the delivered int pixels intersect the region to be extracted and pass through only that subset of pixels that appear in the output region.
 void setProperties sample code for java.awt.image.CropImageFilter.setProperties(java.util.Hashtable) definition code for java.awt.image.CropImageFilter.setProperties(java.util.Hashtable) (Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable <?,?> props)
          Passes along the properties from the source object after adding a property indicating the cropped region.
 
Methods inherited from class java.awt.image.ImageFilter sample code for java.awt.image.ImageFilter definition code for java.awt.image.ImageFilter
clone sample code for java.awt.image.ImageFilter.clone() definition code for java.awt.image.ImageFilter.clone() , getFilterInstance sample code for java.awt.image.ImageFilter.getFilterInstance(java.awt.image.ImageConsumer) definition code for java.awt.image.ImageFilter.getFilterInstance(java.awt.image.ImageConsumer) , imageComplete sample code for java.awt.image.ImageFilter.imageComplete(int) definition code for java.awt.image.ImageFilter.imageComplete(int) , resendTopDownLeftRight sample code for java.awt.image.ImageFilter.resendTopDownLeftRight(java.awt.image.ImageProducer) definition code for java.awt.image.ImageFilter.resendTopDownLeftRight(java.awt.image.ImageProducer) , setColorModel sample code for java.awt.image.ImageFilter.setColorModel(java.awt.image.ColorModel) definition code for java.awt.image.ImageFilter.setColorModel(java.awt.image.ColorModel) , setHints sample code for java.awt.image.ImageFilter.setHints(int) definition code for java.awt.image.ImageFilter.setHints(int)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

CropImageFilter sample code for java.awt.image.CropImageFilter(int, int, int, int) definition code for java.awt.image.CropImageFilter(int, int, int, int)

public CropImageFilter(int x,
                       int y,
                       int w,
                       int h)
Constructs a CropImageFilter that extracts the absolute rectangular region of pixels from its source Image as specified by the x, y, w, and h parameters.

Parameters:
x - the x location of the top of the rectangle to be extracted
y - the y location of the top of the rectangle to be extracted
w - the width of the rectangle to be extracted
h - the height of the rectangle to be extracted
Method Detail

setProperties sample code for java.awt.image.CropImageFilter.setProperties(java.util.Hashtable<?, ?>) definition code for java.awt.image.CropImageFilter.setProperties(java.util.Hashtable<?, ?>)

public void setProperties(Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable <?,?> props)
Passes along the properties from the source object after adding a property indicating the cropped region. This method invokes super.setProperties, which might result in additional properties being added.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being filtered. Developers using this class to filter pixels from an image should avoid calling this method directly since that operation could interfere with the filtering operation.

Specified by:
setProperties sample code for java.awt.image.ImageConsumer.setProperties(java.util.Hashtable) definition code for java.awt.image.ImageConsumer.setProperties(java.util.Hashtable) in interface ImageConsumer sample code for java.awt.image.ImageConsumer definition code for java.awt.image.ImageConsumer
Overrides:
setProperties sample code for java.awt.image.ImageFilter.setProperties(java.util.Hashtable) definition code for java.awt.image.ImageFilter.setProperties(java.util.Hashtable) in class ImageFilter sample code for java.awt.image.ImageFilter definition code for java.awt.image.ImageFilter
Parameters:
props - the properties from the source object

setDimensions sample code for java.awt.image.CropImageFilter.setDimensions(int, int) definition code for java.awt.image.CropImageFilter.setDimensions(int, int)

public void setDimensions(int w,
                          int h)
Override the source image's dimensions and pass the dimensions of the rectangular cropped region to the ImageConsumer.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being filtered. Developers using this class to filter pixels from an image should avoid calling this method directly since that operation could interfere with the filtering operation.

Specified by:
setDimensions sample code for java.awt.image.ImageConsumer.setDimensions(int, int) definition code for java.awt.image.ImageConsumer.setDimensions(int, int) in interface ImageConsumer sample code for java.awt.image.ImageConsumer definition code for java.awt.image.ImageConsumer
Overrides:
setDimensions sample code for java.awt.image.ImageFilter.setDimensions(int, int) definition code for java.awt.image.ImageFilter.setDimensions(int, int) in class ImageFilter sample code for java.awt.image.ImageFilter definition code for java.awt.image.ImageFilter
Parameters:
w - the width of the source image
h - the height of the source image
See Also:
ImageConsumer sample code for java.awt.image.ImageConsumer definition code for java.awt.image.ImageConsumer

setPixels sample code for java.awt.image.CropImageFilter.setPixels(int, int, int, int, java.awt.image.ColorModel, byte[], int, int) definition code for java.awt.image.CropImageFilter.setPixels(int, int, int, int, java.awt.image.ColorModel, byte[], int, int)

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      ColorModel sample code for java.awt.image.ColorModel definition code for java.awt.image.ColorModel  model,
                      byte[] pixels,
                      int off,
                      int scansize)
Determine whether the delivered byte pixels intersect the region to be extracted and passes through only that subset of pixels that appear in the output region.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being filtered. Developers using this class to filter pixels from an image should avoid calling this method directly since that operation could interfere with the filtering operation.

Specified by:
setPixels sample code for java.awt.image.ImageConsumer.setPixels(int, int, int, int, java.awt.image.ColorModel, byte[], int, int) definition code for java.awt.image.ImageConsumer.setPixels(int, int, int, int, java.awt.image.ColorModel, byte[], int, int) in interface ImageConsumer sample code for java.awt.image.ImageConsumer definition code for java.awt.image.ImageConsumer
Overrides:
setPixels sample code for java.awt.image.ImageFilter.setPixels(int, int, int, int, java.awt.image.ColorModel, byte[], int, int) definition code for java.awt.image.ImageFilter.setPixels(int, int, int, int, java.awt.image.ColorModel, byte[], int, int) in class ImageFilter sample code for java.awt.image.ImageFilter definition code for java.awt.image.ImageFilter
w - the width of the area of pixels
h - the height of the area of pixels
model - the specified ColorModel
pixels - the array of pixels
off - the offset into the pixels array
scansize - the distance from one row of pixels to the next in the pixels array
See Also:
ImageConsumer.setPixels(int, int, int, int, java.awt.image.ColorModel, byte[], int, int) sample code for java.awt.image.ImageConsumer.setPixels(int, int, int, int, java.awt.image.ColorModel, byte[], int, int) definition code for java.awt.image.ImageConsumer.setPixels(int, int, int, int, java.awt.image.ColorModel, byte[], int, int)

setPixels sample code for java.awt.image.CropImageFilter.setPixels(int, int, int, int, java.awt.image.ColorModel, int[], int, int) definition code for java.awt.image.CropImageFilter.setPixels(int, int, int, int, java.awt.image.ColorModel, int[], int, int)

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      ColorModel sample code for java.awt.image.ColorModel definition code for java.awt.image.ColorModel  model,
                      int[] pixels,
                      int off,
                      int scansize)
Determine if the delivered int pixels intersect the region to be extracted and pass through only that subset of pixels that appear in the output region.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being filtered. Developers using this class to filter pixels from an image should avoid calling this method directly since that operation could interfere with the filtering operation.

Specified by:
setPixels sample code for java.awt.image.ImageConsumer.setPixels(int, int, int, int, java.awt.image.ColorModel, int[], int, int) definition code for java.awt.image.ImageConsumer.setPixels(int, int, int, int, java.awt.image.ColorModel, int[], int, int) in interface ImageConsumer sample code for java.awt.image.ImageConsumer definition code for java.awt.image.ImageConsumer
Overrides:
setPixels sample code for java.awt.image.ImageFilter.setPixels(int, int, int, int, java.awt.image.ColorModel, int[], int, int) definition code for java.awt.image.ImageFilter.setPixels(int, int, int, int, java.awt.image.ColorModel, int[], int, int) in class ImageFilter sample code for java.awt.image.ImageFilter definition code for java.awt.image.ImageFilter
w - the width of the area of pixels
h - the height of the area of pixels
model - the specified ColorModel
pixels - the array of pixels
off - the offset into the pixels array
scansize - the distance from one row of pixels to the next in the pixels array
See Also:
ImageConsumer.setPixels(int, int, int, int, java.awt.image.ColorModel, byte[], int, int) sample code for java.awt.image.ImageConsumer.setPixels(int, int, int, int, java.awt.image.ColorModel, byte[], int, int) definition code for java.awt.image.ImageConsumer.setPixels(int, int, int, int, java.awt.image.ColorModel, byte[], int, int)