Package org.jzy3d.plot3d.rendering.view
Class AWTImageViewport
- java.lang.Object
-
- org.jzy3d.plot3d.rendering.view.AbstractViewportManager
-
- org.jzy3d.plot3d.rendering.view.AWTImageViewport
-
- All Implemented Interfaces:
IImageViewport
- Direct Known Subclasses:
AWTLegend
public class AWTImageViewport extends AbstractViewportManager implements IImageViewport
AAWTImageViewport
allows displaying a 2dImage
within an OpenGL viewport.- Author:
- Martin Pernollet
-
-
Field Summary
Fields Modifier and Type Field Description protected Image
image
protected static float
IMAGE_Z
protected ByteBuffer
imageData
protected int
imageHeight
protected int
imageWidth
protected Dimension
margin
protected Coord2d
pixelScale
-
Fields inherited from class org.jzy3d.plot3d.rendering.view.AbstractViewportManager
apply_WindowsHiDPI_Workaround, lastViewPort, mode, ratioHeight, ratioWidth, screenBottom, screenGridDisplayed, screenHeight, screenLeft, screenSquaredDim, screenWidth, screenXOffset, screenYOffset
-
-
Constructor Summary
Constructors Constructor Description AWTImageViewport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Image
getImage()
Return the image rendered by theAWTImageViewport
Dimension
getMargin()
Dimension
getMinimumDimension()
Return the minimum size for this graphic.void
render(IPainter painter)
Renders the picture into the window, according to the viewport settings.protected void
renderImage(IPainter painter, ByteBuffer imageBuffer, int imageWidth, int imageHeight, int screenWidth, int screenHeight, float z)
void
setImage(Image image)
void
setImage(Image image, int width, int height)
Set theImage
that will be displayed by the layer.void
setImage(Image image, int width, int height, ByteBuffer buffer)
void
setMargin(Dimension margin)
protected void
updatePixelScale(Coord2d pixelScale)
Update internal pixel scale knowledge.-
Methods inherited from class org.jzy3d.plot3d.rendering.view.AbstractViewportManager
applyViewport, getLastViewPort, getRectangle, getScreenBottom, getScreenHeight, getScreenLeft, getScreenWidth, getScreenXOffset, getScreenYOffset, getSliceWidth, getViewportMode, isScreenGridDisplayed, renderSubScreenGrid, setScreenGridDisplayed, setViewPort, setViewPort, setViewPort, setViewportMode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jzy3d.plot3d.rendering.view.IImageViewport
getLastViewPort, getSliceWidth, getViewportMode, setViewPort, setViewPort, setViewPort, setViewportMode
-
-
-
-
Field Detail
-
IMAGE_Z
protected static final float IMAGE_Z
- See Also:
- Constant Field Values
-
imageData
protected ByteBuffer imageData
-
image
protected Image image
-
imageHeight
protected int imageHeight
-
imageWidth
protected int imageWidth
-
margin
protected Dimension margin
-
pixelScale
protected Coord2d pixelScale
-
-
Method Detail
-
render
public void render(IPainter painter)
Description copied from interface:IImageViewport
Renders the picture into the window, according to the viewport settings. If the picture is bigger than the viewport, it is simply centered in it, otherwise, it is scaled in order to fit into the viewport.- Specified by:
render
in interfaceIImageViewport
-
renderImage
protected void renderImage(IPainter painter, ByteBuffer imageBuffer, int imageWidth, int imageHeight, int screenWidth, int screenHeight, float z)
-
updatePixelScale
protected void updatePixelScale(Coord2d pixelScale)
Update internal pixel scale knowledge. Called by render loop and provided by painter's view. May be overrided to update the image.
-
setImage
public void setImage(Image image, int width, int height)
Set theImage
that will be displayed by the layer.- Parameters:
image
-
-
setImage
public void setImage(Image image, int width, int height, ByteBuffer buffer)
-
setImage
public void setImage(Image image)
-
getImage
public Image getImage()
Return the image rendered by theAWTImageViewport
-
getMinimumDimension
public Dimension getMinimumDimension()
Return the minimum size for this graphic.- Specified by:
getMinimumDimension
in interfaceIImageViewport
-
getMargin
public Dimension getMargin()
-
setMargin
public void setMargin(Dimension margin)
-
-