public abstract class Lens extends Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
Lens() |
Modifier and Type | Method and Description |
---|---|
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
|
double[] |
getVisibleRegion(Camera c,
double[] 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
|
public static float MM_FLOOR
protected ViewPanel owningView
public int w
public int h
public int sw
public int sh
public int mbw
public int mbh
public int lx
public int ly
public int lensWidth
public int lensHeight
public BufferedImage mbi
public Graphics2D magnifiedGraphics
public volatile float MM
protected float mSwitchThreshold
public abstract void setLensBuffer(ViewPanel p)
public abstract void gf(float x, float y, float[] g)
public void setMaximumMagnification(float mm)
mm
- maximum magnification factor, mm in [0,+inf[public void setMaximumMagnification(float mm, boolean forceRaster)
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)public float getMaximumMagnification()
public float getActualMaximumMagnification()
public void setBufferThreshold(float t)
public float getBufferThreshold()
public boolean isInitialized()
public void transform(BufferedImage sbi)
sbi
- Buffered image to be transformedpublic abstract void setAbsolutePosition(int ax, int ay)
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)public abstract int getRadius()
public void setMagRasterDimensions(int size)
size
- public void setMagRasterDimensions(int w, int h)
w
- width of the magnification buffer (in pixels)h
- height of the magnification buffer (in pixels)public void resetMagnificationBuffer()
public Graphics2D getMagnificationGraphics()
public void dispose()
public View getOwningView()
public double[] getVisibleRegion(Camera c, double[] res)
c
- camerares
- array which will contain the resultpublic void drawBoundary(Graphics2D g2d)
public void setXfocusOffset(int x)
public void setYfocusOffset(int y)
public int getXfocusOffset()
public int getYfocusOffset()
public abstract void setFocusControlled(boolean isFocusControlled, short speedBehavior)
public abstract void setFocusControlled(boolean isFocusControlled)
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-2015 INRIA. All Rights Reserved
Licensed under the GNU LGPL. For full terms see the file COPYING.