ptolemy.domains.sdf.lib.vq
Class ImagePartition

java.lang.Object
  extended byptolemy.kernel.util.NamedObj
      extended byptolemy.kernel.InstantiableNamedObj
          extended byptolemy.kernel.Entity
              extended byptolemy.kernel.ComponentEntity
                  extended byptolemy.actor.AtomicActor
                      extended byptolemy.actor.TypedAtomicActor
                          extended byptolemy.actor.lib.Transformer
                              extended byptolemy.domains.sdf.lib.vq.ImagePartition
All Implemented Interfaces:
ptolemy.actor.Actor, ptolemy.kernel.util.Changeable, java.lang.Cloneable, ptolemy.kernel.util.Debuggable, ptolemy.kernel.util.DebugListener, ptolemy.kernel.util.Derivable, ptolemy.actor.Executable, ptolemy.kernel.util.Instantiable, ptolemy.kernel.util.ModelErrorHandler, ptolemy.kernel.util.MoMLExportable, ptolemy.kernel.util.Nameable, java.io.Serializable, ptolemy.actor.TypedActor

public class ImagePartition
extends Transformer

Partition an image into smaller subimages. Each input image should have dimensions imageColumns by imageRows, and each output image will have dimensions partitionColumns by partitionRows. The output matrices are row scanned from the top of input image.

Since:
Ptolemy II 0.2
Version:
$Id: ImagePartition.java,v 1.41 2004/04/13 03:36:09 cxh Exp $
Author:
Steve Neuendorffer
See Also:
Serialized Form
Accepted Rating:
Red (neuendor)
Proposed Rating:
Green (neuendor)

Nested Class Summary
 
Nested classes inherited from class ptolemy.kernel.Entity
ptolemy.kernel.Entity.ContainedObjectsIterator
 
Field Summary
 ptolemy.data.expr.Parameter imageColumns
          The width of the input matrices
 ptolemy.data.expr.Parameter imageRows
          The height of the input matrices
 ptolemy.data.expr.Parameter output_tokenProductionRate
          The output rate
 ptolemy.data.expr.Parameter partitionColumns
          The width of the input partitions
 ptolemy.data.expr.Parameter partitionRows
          The height of the input partitions
 
Fields inherited from class ptolemy.actor.lib.Transformer
input, output
 
Fields inherited from class ptolemy.actor.AtomicActor
_stopRequested
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
 
Constructor Summary
ImagePartition(ptolemy.kernel.CompositeEntity container, java.lang.String name)
          Construct an actor in the specified container with the specified name.
 
Method Summary
 void fire()
          Fire this actor.
 void initialize()
          Initialize this actor
 
Methods inherited from class ptolemy.actor.TypedAtomicActor
_addPort, attributeTypeChanged, clone, newPort, typeConstraintList
 
Methods inherited from class ptolemy.actor.AtomicActor
_createReceivers, clone, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, pruneDependencies, removeDependency, setContainer, stop, stopFire, terminate, wrapup
 
Methods inherited from class ptolemy.kernel.ComponentEntity
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, propagateExistence, setName
 
Methods inherited from class ptolemy.kernel.Entity
_description, _exportMoMLContents, _removePort, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName, validateSettables
 
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ptolemy.actor.Actor
getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, newReceiver, outputPortList
 
Methods inherited from interface ptolemy.actor.Executable
iterate, postfire, prefire, preinitialize, stop, stopFire, terminate, wrapup
 
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getFullName, getName, getName
 

Field Detail

imageColumns

public ptolemy.data.expr.Parameter imageColumns
The width of the input matrices


imageRows

public ptolemy.data.expr.Parameter imageRows
The height of the input matrices


partitionColumns

public ptolemy.data.expr.Parameter partitionColumns
The width of the input partitions


partitionRows

public ptolemy.data.expr.Parameter partitionRows
The height of the input partitions


output_tokenProductionRate

public ptolemy.data.expr.Parameter output_tokenProductionRate
The output rate

Constructor Detail

ImagePartition

public ImagePartition(ptolemy.kernel.CompositeEntity container,
                      java.lang.String name)
               throws ptolemy.kernel.util.IllegalActionException,
                      ptolemy.kernel.util.NameDuplicationException
Construct an actor in the specified container with the specified name.

Parameters:
container - The container.
name - The name of this adder within the container.
Throws:
ptolemy.kernel.util.IllegalActionException - If the actor cannot be contained by the proposed container.
ptolemy.kernel.util.NameDuplicationException - If the name coincides with an actor already in the container.
Method Detail

initialize

public void initialize()
                throws ptolemy.kernel.util.IllegalActionException
Initialize this actor

Throws:
ptolemy.kernel.util.IllegalActionException - If a parameter does not contain a legal value, or partitionColumns does not equally divide imageColumns, or partitionRows does not equally divide imageRows.

fire

public void fire()
          throws ptolemy.kernel.util.IllegalActionException
Fire this actor. Consume a single IntMatrixToken on the input. Produce IntMatrixTokens on the output port by partitioning the input image.

Throws:
ptolemy.kernel.util.IllegalActionException - If the input size is not imageRows by imageColumns.