fr.inria.zvtm.lens
Class Lens

java.lang.Object
  extended by fr.inria.zvtm.lens.Lens
Direct Known Subclasses:
FixedSizeLens

public abstract class Lens
extends Object

Parent class of all lenses


Field Summary
 int h
          view height
 int lensHeight
           
 int lensWidth
           
 int lx
          Lens' center horizontal coordinate within View.
 int ly
          Lens' center vertical coordinate within View.
 Graphics2D magnifiedGraphics
           
 int mbh
          Magnified buffer height.
 BufferedImage mbi
           
 int mbw
          Magnified buffer width.
 float MM
           
static float MM_FLOOR
           
protected  float mSwitchThreshold
           
protected  ViewPanel owningView
           
 int sh
          view half height
 int sw
          view half width
 int w
          view width
 
Constructor Summary
Lens()
           
 
Method Summary
 void dispose()
           
 void drawBoundary(Graphics2D g2d)
           
 float getActualMaximumMagnification()
           
 float getBufferThreshold()
          get the lens' buffer threshold, beyond which magnification should pixels be taken from the magnified buffer rather than from the source buffer
 Graphics2D getMagnificationGraphics()
           
 float getMaximumMagnification()
          get the lens' maximum magnification
 View getOwningView()
           
abstract  int getRadius()
          outer radius
 long[] getVisibleRegion(Camera c, long[] res)
          returns bounds of rectangle representing virtual space's region seen through camera c [west,north,east,south]
 int getXfocusOffset()
           
 int getYfocusOffset()
           
abstract  void gf(float x, float y, float[] g)
          gain factor function
 boolean isInitialized()
           
abstract  void moveLensBy(int dx, int dy, long currentTime)
           
 void resetMagnificationBuffer()
           
abstract  void setAbsolutePosition(int ax, int ay)
          Set the position of the lens inside the view.
 void setBufferThreshold(float t)
          set the lens' buffer threshold, beyond which magnification should pixels be taken from the magnified buffer rather than from the source buffer
abstract  void setFocusControlled(boolean isFocusControlled)
           
abstract  void setFocusControlled(boolean isFocusControlled, short speedBehavior)
           
abstract  void setLensBuffer(ViewPanel p)
          Should not be called directly ; used by viewpanel to update image data buffer caracteristics when original view panel changes
 void setMagRasterDimensions(int size)
          Force the magnification buffer to a new width and height.
 void setMagRasterDimensions(int w, int h)
          Force the magnification buffer to a new width and height.
 void setMaximumMagnification(float mm)
          set the lens' maximum magnification
 void setMaximumMagnification(float mm, boolean forceRaster)
          set the lens' maximum magnification
 void setXfocusOffset(int x)
           
 void setYfocusOffset(int y)
           
 void transform(BufferedImage sbi)
          Actual code that transforms incoming sbi Buffered image
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MM_FLOOR

public static float MM_FLOOR

owningView

protected ViewPanel owningView

w

public int w
view width


h

public int h
view height


sw

public int sw
view half width


sh

public int sh
view half height


mbw

public int mbw
Magnified buffer width. Reflects the region of the magnification buffer that is actually in use, not necessarily the buffer's actual width (might be bigger during an animation)


mbh

public int mbh
Magnified buffer height. Reflects the region of the magnification buffer that is actually in use, not necessarily the buffer's actual height (might be bigger during an animation)


lx

public int lx
Lens' center horizontal coordinate within View. Expressed as an offset w.r.t the View's center, in JPanel coordinates.


ly

public int ly
Lens' center vertical coordinate within View. Expressed as an offset w.r.t the View's center, in JPanel coordinates.


lensWidth

public int lensWidth

lensHeight

public int lensHeight

mbi

public BufferedImage mbi

magnifiedGraphics

public Graphics2D magnifiedGraphics

MM

public volatile float MM

mSwitchThreshold

protected float mSwitchThreshold
Constructor Detail

Lens

public Lens()
Method Detail

setLensBuffer

public abstract void setLensBuffer(ViewPanel p)
Should not be called directly ; used by viewpanel to update image data buffer caracteristics when original view panel changes


gf

public abstract void gf(float x,
                        float y,
                        float[] g)
gain factor function


setMaximumMagnification

public void setMaximumMagnification(float mm)
set the lens' maximum magnification

Parameters:
mm - maximum magnification factor, mm in [0,+inf[

setMaximumMagnification

public void setMaximumMagnification(float mm,
                                    boolean forceRaster)
set the lens' maximum magnification

Parameters:
mm - maximum magnification factor, mm in [0,+inf[
forceRaster - true if the magnification raster size should be updated according to the new maximum magnification factor (default is true)

getMaximumMagnification

public float getMaximumMagnification()
get the lens' maximum magnification


getActualMaximumMagnification

public float getActualMaximumMagnification()

setBufferThreshold

public void setBufferThreshold(float t)
set the lens' buffer threshold, beyond which magnification should pixels be taken from the magnified buffer rather than from the source buffer


getBufferThreshold

public float getBufferThreshold()
get the lens' buffer threshold, beyond which magnification should pixels be taken from the magnified buffer rather than from the source buffer


isInitialized

public boolean isInitialized()

transform

public void transform(BufferedImage sbi)
Actual code that transforms incoming sbi Buffered image

Parameters:
sbi - Buffered image to be transformed

setAbsolutePosition

public abstract void setAbsolutePosition(int ax,
                                         int ay)
Set the position of the lens inside the view.

Parameters:
ax - lens's center horizontal coordinate expressed as an absolute position within the view (JPanel coordinate system)
ay - lens's center vertical coordinate expressed as an absolute position within the view (JPanel coordinate system)

getRadius

public abstract int getRadius()
outer radius


setMagRasterDimensions

public void setMagRasterDimensions(int size)
Force the magnification buffer to a new width and height. The buffered image raster as well as the 1D array used for the transformation get new values corresponding to the provided size

Parameters:
size -

setMagRasterDimensions

public void setMagRasterDimensions(int w,
                                   int h)
Force the magnification buffer to a new width and height. The buffered image raster as well as the 1D array used for the transformation get new values from w and h that should be equal to or larger than the region of the miagnification buffer actually used for the transformation.

Parameters:
w - width of the magnification buffer (in pixels)
h - height of the magnification buffer (in pixels)

resetMagnificationBuffer

public void resetMagnificationBuffer()

getMagnificationGraphics

public Graphics2D getMagnificationGraphics()

dispose

public void dispose()

getOwningView

public View getOwningView()

getVisibleRegion

public long[] getVisibleRegion(Camera c,
                               long[] res)
returns bounds of rectangle representing virtual space's region seen through camera c [west,north,east,south]

Parameters:
c - camera
res - array which will contain the result

drawBoundary

public void drawBoundary(Graphics2D g2d)

setXfocusOffset

public void setXfocusOffset(int x)

setYfocusOffset

public void setYfocusOffset(int y)

getXfocusOffset

public int getXfocusOffset()

getYfocusOffset

public int getYfocusOffset()

setFocusControlled

public abstract void setFocusControlled(boolean isFocusControlled,
                                        short speedBehavior)

setFocusControlled

public abstract void setFocusControlled(boolean isFocusControlled)

moveLensBy

public abstract void moveLensBy(int dx,
                                int dy,
                                long currentTime)


Copyright © 2000-2002 Xerox Corporation. All Rights Reserved
Copyright © 2003 World Wide Web Consortium. All Rights Reserved
Copyright © 2004-2011 INRIA. All Rights Reserved
Licensed under the GNU LGPL. For full terms see the file COPYING.