javax.media.jai.operator
Class BorderDescriptor

java.lang.Object
  |
  +--javax.media.jai.OperationDescriptorImpl
        |
        +--javax.media.jai.operator.BorderDescriptor
All Implemented Interfaces:
OperationDescriptor, RegistryElementDescriptor, Serializable

public class BorderDescriptor
extends OperationDescriptorImpl

An OperationDescriptor describing the "Border" operation.

The Border operation adds a border around a rendered image. The size of the border is specified in pixels by the left, right, top, and bottom padding parameters, corresponding to the four sides of the source image. These paddings may not be less than 0.

The pixel values of the added border area will be set according to the algorithm of the BorderExtender passed as a parameter. The BorderExtenders provide the ability to extend the border by:

Resource List
Name Value
GlobalName Border
LocalName Border
Vendor com.sun.media.jai
Description Adds a border around an image.
DocURL http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/BorderDescriptor.html
Version 1.0
arg0Desc The image's left padding.
arg1Desc The image's right padding.
arg2Desc The image's top padding.
arg3Desc The image's bottom padding.
arg4Desc The border extender.

Parameter List
Name Class Type Default Value
leftPad java.lang.Integer 0
rightPad java.lang.Integer 0
topPad java.lang.Integer 0
bottomPad java.lang.Integer 0
type javax.media.jai.BorderExtender javax.media.jai.BorderExtenderZero

See Also:
OperationDescriptor, Serialized Form

Fields inherited from class javax.media.jai.OperationDescriptorImpl
resources, sourceNames, supportedModes
 
Fields inherited from interface javax.media.jai.OperationDescriptor
NO_PARAMETER_DEFAULT
 
Constructor Summary
BorderDescriptor()
          Constructor.
 
Method Summary
static RenderedOp create(RenderedImage source0, Integer leftPad, Integer rightPad, Integer topPad, Integer bottomPad, BorderExtender type, RenderingHints hints)
          Adds a border around an image.
 Object getInvalidRegion(String modeName, ParameterBlock oldParamBlock, RenderingHints oldHints, ParameterBlock newParamBlock, RenderingHints newHints, OperationNode node)
          Calculates the region over which two distinct renderings of the "Border" operation may be expected to differ.
 
Methods inherited from class javax.media.jai.OperationDescriptorImpl
arePropertiesSupported, getDefaultSourceClass, getDestClass, getDestClass, getName, getNumParameters, getNumSources, getParamClasses, getParamDefaults, getParamDefaultValue, getParameterListDescriptor, getParamMaxValue, getParamMinValue, getParamNames, getPropertyGenerators, getPropertyGenerators, getRenderableDestClass, getRenderableSourceClasses, getResourceBundle, getResources, getSourceClasses, getSourceClasses, getSourceNames, getSupportedModes, isImmediate, isModeSupported, isRenderableSupported, isRenderedSupported, makeDefaultSourceClassList, validateArguments, validateArguments, validateParameters, validateParameters, validateRenderableArguments, validateRenderableSources, validateSources, validateSources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BorderDescriptor

public BorderDescriptor()
Constructor.
Method Detail

getInvalidRegion

public Object getInvalidRegion(String modeName,
                               ParameterBlock oldParamBlock,
                               RenderingHints oldHints,
                               ParameterBlock newParamBlock,
                               RenderingHints newHints,
                               OperationNode node)
Calculates the region over which two distinct renderings of the "Border" operation may be expected to differ.

The operation returns a Shape or null in the rendered mode and null in all other modes.

Overrides:
getInvalidRegion in class OperationDescriptorImpl
Parameters:
modeName - The name of the mode.
oldParamBlock - The previous sources and parameters.
oldHints - The previous hints.
newParamBlock - The current sources and parameters.
newHints - The current hints.
node - The affected node in the processing chain (ignored).
Returns:
The region over which the data of two renderings of this operation may be expected to be invalid or null if there is no common region of validity. A non-null empty region indicates that the operation would produce identical data over the bounds of the old rendering although perhaps not over the area occupied by the tiles of the old rendering.
Throws:
IllegalArgumentException - if modeName is null or if the operation requires either sources or parameters and either oldParamBlock or newParamBlock is null.
IllegalArgumentException - if oldParamBlock or newParamBlock do not contain sufficient sources or parameters for the operation in question.

create

public static RenderedOp create(RenderedImage source0,
                                Integer leftPad,
                                Integer rightPad,
                                Integer topPad,
                                Integer bottomPad,
                                BorderExtender type,
                                RenderingHints hints)
Adds a border around an image.

Creates a ParameterBlockJAI from all supplied arguments except hints and invokes JAI.create(String,ParameterBlock,RenderingHints).

Parameters:
source0 - RenderedImage source 0.
leftPad - The image's left padding. May be null.
rightPad - The image's right padding. May be null.
topPad - The image's top padding. May be null.
bottomPad - The image's bottom padding. May be null.
type - The border type. May be null.
hints - The RenderingHints to use. May be null.
Returns:
The RenderedOp destination.
Throws:
IllegalArgumentException - if source0 is null.
See Also:
JAI, ParameterBlockJAI, RenderedOp