jvx.imageDisplay
Class PiImageSource
- java.lang.Object
-
- jv.object.PsObject
-
- jvx.imageDisplay.PiImageSource
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf
public abstract class PiImageSource extends PsObject
Abstract class for images computed from a function over the xy-plane. The image should be considered as lying above a rectangular region of the xy-plane. The pixel images are assigned by subclasses based on the function values.- See Also:
- Serialized Form
- Author:
- Konrad Polthier
- Version:
- 09.06.13, 1.50 revised (kp) Code completed.
24.03.11, 1.00 created (kp)
-
-
Field Summary
-
Fields inherited from class jv.object.PsObject
HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS
-
-
Constructor Summary
Constructors Constructor and Description PiImageSource()Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract voidcompute()Compute an image in the complex plane and update the corresponding images.voidcomputeColors()Compute colors based on a previously computed function values.java.awt.ImagecreateImage(java.awt.Component comp, int width, int height)Set size of image and, if changed, create an new image.intgetBlockSize()Get block size of image which determines a square block of equally rendered pixels.PdVectorgetDomainBounds()Set the domain of the image in the Euclidean plane.PdVectorgetDomainPosition(java.awt.Point loc)Converts a point (u,v) in the complex plane to its position in the image.java.awt.ImagegetImage()Get image of this object, will automatically be updated whenever computeColors() is called.intgetImagePosition(double u, double v)Converts a point (u,v) in the plane to its position in the image.voidinit()Initialization.voidsetBlockSize(int blockSize)Set block size of image which determines a square block of equally rendered pixels.voidsetDomainBounds(double[] bounds)Set the domain of the image in the Euclidean plane.voidsetDomainBounds(double xMin, double yMin, double xMax, double yMax)Set the domain of the image in the Euclidean plane.voidsetDomainBounds(PdVector bounds)Set the domain of the image in the Euclidean plane.booleanupdate(java.lang.Object event)Update the class whenever a child has changed.-
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, updatePanels
-
-
-
-
Method Detail
-
update
public boolean update(java.lang.Object event)
Update the class whenever a child has changed. Method is usually invoked from the children.- Specified by:
updatein interfacePsUpdateIf- Overrides:
updatein classPsObject- Parameters:
event- carries a lot of information- Returns:
- true if event has been handled, otherwise false
- See Also:
PsObject.setParent(PsUpdateIf),PsObject.getFather(),PsObject.addUpdateListener(PsUpdateIf)
-
getImage
public java.awt.Image getImage()
Get image of this object, will automatically be updated whenever computeColors() is called.
-
createImage
public java.awt.Image createImage(java.awt.Component comp, int width, int height)Set size of image and, if changed, create an new image.
-
compute
public abstract void compute()
Compute an image in the complex plane and update the corresponding images.
-
computeColors
public void computeColors()
Compute colors based on a previously computed function values.
-
getImagePosition
public int getImagePosition(double u, double v)Converts a point (u,v) in the plane to its position in the image.- Parameters:
u- real value of complex positionv- imaginary value of complex position- Returns:
- index in the pixel array
-
getDomainPosition
public PdVector getDomainPosition(java.awt.Point loc)
Converts a point (u,v) in the complex plane to its position in the image.- Parameters:
loc- Integer location in image- Returns:
- 2d double coordinates of location in domain of image.
-
getDomainBounds
public PdVector getDomainBounds()
Set the domain of the image in the Euclidean plane.Parameters determine a rectangle in the complex plane in which the Mandelbrot set is computed.
-
setDomainBounds
public void setDomainBounds(PdVector bounds)
Set the domain of the image in the Euclidean plane.Parameters determine a rectangle in the complex plane in which the Mandelbrot set is computed.
-
setDomainBounds
public void setDomainBounds(double[] bounds)
Set the domain of the image in the Euclidean plane.Parameters determine a rectangle in the complex plane in which the Mandelbrot set is computed.
-
setDomainBounds
public void setDomainBounds(double xMin, double yMin, double xMax, double yMax)Set the domain of the image in the Euclidean plane.Parameters determine a rectangle in the complex plane in which the Mandelbrot set is computed.
-
getBlockSize
public int getBlockSize()
Get block size of image which determines a square block of equally rendered pixels. Block size 1 means every pixel is computed (default), which larger values will lead to pixelization effects while speeding up calculations.
-
setBlockSize
public void setBlockSize(int blockSize)
Set block size of image which determines a square block of equally rendered pixels. Block size 1 means every pixel is computed (default), which larger values will lead to pixelization effects while speeding up calculations.
-
-
"