|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.media.jai.OperationDescriptorImpl
javax.media.jai.operator.CropDescriptor
An OperationDescriptor describing the "Crop" operation.
The Crop operation takes one rendered or renderable image and crops the image to a specified rectangular area. The rectangular area must not be empty, and must be fully contained with the source image bounds.
For rendered images the supplied origin and dimensions are used to determine the smallest rectangle with integral origin and dimensions which encloses the rectangular area requested.
For renderable images the rectangular area is specified in rendering-independent coordinates. When the image is rendered this area will be mapped to rendered image coordinates using the affine transform supplied for the rendering. The crop bounds in rendered coordinates are defined to be the minimum bounding box of the rectangular area mapped to rendered image coordinates.
| Name | Value |
|---|---|
| GlobalName | Crop |
| LocalName | Crop |
| Vendor | com.sun.media.jai |
| Description | Crops the pixel values of a rendered image to a specified rectangle. |
| DocURL | http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/CropDescriptor.html |
| Version | 1.0 |
| arg0Desc | The x origin for each band. |
| arg1Desc | The y origin for each band. |
| arg2Desc | The width for each band. |
| arg3Desc | The height for each band. |
| Name | Class Type | Default Value |
|---|---|---|
| x | Float | NO_PARAMETER_DEFAULT |
| y | Float | NO_PARAMETER_DEFAULT |
| width | Float | NO_PARAMETER_DEFAULT |
| height | Float | NO_PARAMETER_DEFAULT |
OperationDescriptor,
Serialized Form| Field Summary |
| Fields inherited from class javax.media.jai.OperationDescriptorImpl |
sourceNames |
| Fields inherited from interface javax.media.jai.OperationDescriptor |
NO_PARAMETER_DEFAULT |
| Constructor Summary | |
CropDescriptor()
Constructor. |
|
| Method Summary | |
static RenderedOp |
create(RenderedImage source0,
Float x,
Float y,
Float width,
Float height,
RenderingHints hints)
Performs cropping to a specified bounding box. |
static RenderableOp |
createRenderable(RenderableImage source0,
Float x,
Float y,
Float width,
Float height,
RenderingHints hints)
Performs cropping to a specified bounding box. |
boolean |
validateArguments(String modeName,
ParameterBlock args,
StringBuffer msg)
Validates the input source and parameters. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CropDescriptor()
| Method Detail |
public boolean validateArguments(String modeName,
ParameterBlock args,
StringBuffer msg)
In addition to the standard checks performed by the superclass method, this method checks that "x", "y", "width", and "height" form a rectangle that is not empty and that is fully contained within the bounds of the source image.
validateArguments in interface OperationDescriptorvalidateArguments in class OperationDescriptorImplmodeName - the operation mode nameargs - Input arguments, including source(s) and/or parameter(s).msg - A string that may contain error messages.OperationDescriptorImpl.validateSources(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer),
OperationDescriptorImpl.validateParameters(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)
public static RenderedOp create(RenderedImage source0,
Float x,
Float y,
Float width,
Float height,
RenderingHints hints)
Creates a ParameterBlockJAI from all
supplied arguments except hints and invokes
JAI.create(String,ParameterBlock,RenderingHints).
source0 - RenderedImage source 0.x - The x origin of the cropping operation.y - The y origin of the cropping operation.width - The width of the cropping operation.height - The height of the cropping operation.hints - The RenderingHints to use.
May be null.
RenderedOp destination.
IllegalArgumentException - if source0 is null.
IllegalArgumentException - if x is null.
IllegalArgumentException - if y is null.
IllegalArgumentException - if width is null.
IllegalArgumentException - if height is null.JAI,
ParameterBlockJAI,
RenderedOp
public static RenderableOp createRenderable(RenderableImage source0,
Float x,
Float y,
Float width,
Float height,
RenderingHints hints)
Creates a ParameterBlockJAI from all
supplied arguments except hints and invokes
JAI.createRenderable(String,ParameterBlock,RenderingHints).
source0 - RenderableImage source 0.x - The x origin of the cropping operation.y - The y origin of the cropping operation.width - The width of the cropping operation.height - The height of the cropping operation.hints - The RenderingHints to use.
May be null.
RenderableOp destination.
IllegalArgumentException - if source0 is null.
IllegalArgumentException - if x is null.
IllegalArgumentException - if y is null.
IllegalArgumentException - if width is null.
IllegalArgumentException - if height is null.JAI,
ParameterBlockJAI,
RenderableOp
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||