de.grogra.imp3d.shading
Class Filter

java.lang.Object
  extended by de.grogra.graph.impl.Edge
      extended by de.grogra.graph.impl.Node
          extended by de.grogra.imp3d.shading.ChannelMapNode
              extended by de.grogra.imp3d.shading.Filter
All Implemented Interfaces:
ChannelMap, Manageable, PersistenceCapable, Shareable, UserFields, XObject, Map, java.io.Serializable
Direct Known Subclasses:
Laplace3D, Smooth3D

public abstract class Filter
extends ChannelMapNode

A Filter is the base for 3D image filtering operations. Subclasses provide a 3D filter coefficient matrix (which is queried by the getCoefficient* functions). The filter is applied to the requested channel by sampling values for each coefficient in the matrix and then calculating the weigthed sum. The size of the sampling cube can be adjusted by the fields sx, sy and sy (in x/y/z and u/v directions).

Author:
nmi
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class de.grogra.graph.impl.Node
Node.AccessorBridge, Node.FieldAttributeAccessor, Node.NType
 
Nested classes/interfaces inherited from interface de.grogra.util.Map
Map.Chain
 
Field Summary
static Node.NType $TYPE
           
static Node.NType.Field sx$FIELD
           
static Node.NType.Field sy$FIELD
           
static Node.NType.Field sz$FIELD
           
 
Fields inherited from class de.grogra.imp3d.shading.ChannelMapNode
AMBIENT, COLOR, COLOR_2, DIFFUSE_TRANSPARENCY, DISPLACEMENT, EMISSIVE, FIRST_OP, INPUT, input$FIELD, MIN_UNUSED_SPECIAL_OF_TARGET, SECOND_OP, SHININESS, SPECULAR, TRANSPARENCY, TRANSPARENCY_SHININESS
 
Fields inherited from class de.grogra.graph.impl.Node
ADDITIONAL_FIELDS, bits, DELETED, EXTENT_BIT, EXTENT_MASK, extentIndex$FIELD, extentTail$FIELD, HAS_OBSERVERS, IS_INTERPRETIVE, isInterpretive$FIELD, LAST_EXTENT_INDEX, layer$FIELD, MARK, mark$FIELD, MIME_TYPE, MIN_UNUSED_SPECIAL_OF_SOURCE, name$FIELD, USED_BITS
 
Fields inherited from interface de.grogra.util.Map
DEFAULT_VALUE, EMPTY_MAP
 
Constructor Summary
Filter()
           
 
Method Summary
 void accept(ChannelMapNodeVisitor visitor)
           
protected abstract  float getCoefficient(int gx, int gy, int gz)
          Get the coefficient at position (gx/gy/gz) in the filter matrix.
 float getFloatValue(ChannelData data, int channel)
           
 float getSx()
           
 float getSy()
           
 float getSz()
           
 void setSx(float value)
           
 void setSy(float value)
           
 void setSz(float value)
           
 
Methods inherited from class de.grogra.imp3d.shading.ChannelMapNode
accept, getInput, getObjectValue, setInput
 
Methods inherited from class de.grogra.graph.impl.Node
addEdgeBitsTo, addReference, appendBranchNode, appendBranchNode, appendReferencesTo, clone, clone, cloneGraph, dump, dumpTree, dup, dupUnmanagedFields, edgeChanged, fieldModified, findAdjacent, get, getAccessor, getAccessor, getAttributes, getAxisParent, getBoolean, getBranch, getBranchLength, getBranchNode, getBranchTail, getByte, getChar, getCommonAncestor, getCurrentGraphState, getDirectChildCount, getDouble, getEdgeAttributeAccessor, getEdgeAttributes, getEdgeBitsTo, getEdgeTo, getExtentIndex, getFirst, getFirstEdge, getFloat, getGraph, getId, getIndex, getInstantiator, getInt, getLayer, getLong, getManageableType, getName, getNeighbor, getNext, getNType, getNTypeImpl, getObject, getOrCreateEdgeTo, getOrNull, getPersistenceManager, getPredecessor, getProvider, getShort, getSource, getStamp, getSuccessor, getSymbol, getSymbolColor, getTarget, getTransaction, getUserField, getUserFieldCount, getXClass, getXData, hasName, initProvider, initXClass, insertBranchNode, insertBranchNode, instantiateGraph, isAncestorOf, isDirection, isManagingInstance, isMarked, isRoot, isSource, isTarget, manageableReadResolve, manageableWriteReplace, newInstance, paramString, removeAll, removeEdgeBitsTo, removeFromChain, removeFromChain, removeReference, setBranch, setBranch, setExtentIndex, setGraphForDeserialization, setLayer, setMark, setName, setSuccessor, setSuccessor, specialEdgeAdded, specialEdgeRefModified, specialEdgeRemoved, toString, writeReplace
 
Methods inherited from class de.grogra.graph.impl.Edge
addEdgeBits, getBitMark, getEdgeBits, getObjectMark, getSpecialEdgeDescriptor, parseEdgeKeys, remove, removeEdgeBits, setBitMark, setEdgeBits, setObjectMark, testEdgeBits
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.grogra.math.ChannelMap
getStamp
 
Methods inherited from interface de.grogra.persistence.PersistenceCapable
getBitMark, getObjectMark, setBitMark, setObjectMark
 

Field Detail

$TYPE

public static final Node.NType $TYPE

sx$FIELD

public static final Node.NType.Field sx$FIELD

sy$FIELD

public static final Node.NType.Field sy$FIELD

sz$FIELD

public static final Node.NType.Field sz$FIELD
Constructor Detail

Filter

public Filter()
Method Detail

accept

public void accept(ChannelMapNodeVisitor visitor)
Overrides:
accept in class ChannelMapNode

getCoefficient

protected abstract float getCoefficient(int gx,
                                        int gy,
                                        int gz)
Get the coefficient at position (gx/gy/gz) in the filter matrix. The functions getCoefficientMaskSize* are used to obtain the indexable range (i.e. sx, sy and sz), so 0 <= gx <= sx. Derived classes implement this function to provide filter coefficients. The Filter class will perform the filtering by applying those coefficients as weigths to the sampled values from the input channel.

Parameters:
gx -
gy -
gz -
Returns:

getFloatValue

public float getFloatValue(ChannelData data,
                           int channel)
Specified by:
getFloatValue in interface ChannelMap
Overrides:
getFloatValue in class ChannelMapNode

getSx

public float getSx()

getSy

public float getSy()

getSz

public float getSz()

setSx

public void setSx(float value)

setSy

public void setSy(float value)

setSz

public void setSz(float value)