Package com.metsci.glimpse.core.canvas
Class FBOGlimpseCanvas
- java.lang.Object
-
- com.metsci.glimpse.core.canvas.AbstractGlimpseCanvas
-
- com.metsci.glimpse.core.canvas.FBOGlimpseCanvas
-
- All Implemented Interfaces:
GlimpseCanvas,GlimpseTarget
public class FBOGlimpseCanvas extends AbstractGlimpseCanvas
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_TEXTURE_UNIT
-
Constructor Summary
Constructors Constructor Description FBOGlimpseCanvas(com.jogamp.opengl.GLContext glContext, int width, int height)FBOGlimpseCanvas(com.jogamp.opengl.GLContext glContext, int width, int height, boolean isBackgroundOpaque)FBOGlimpseCanvas(com.jogamp.opengl.GLProfile glProfile, int width, int height)FBOGlimpseCanvas(com.jogamp.opengl.GLProfile glProfile, com.jogamp.opengl.GLContext glContext, int width, int height)Deprecated.UseFBOGlimpseCanvas(GLContext,int,int)instead.FBOGlimpseCanvas(String glProfileName, com.jogamp.opengl.GLContext glContext, int width, int height)Deprecated.UseFBOGlimpseCanvas(GLContext,int,int)instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Destroys the native surface which this canvas draws to.com.jogamp.opengl.GLContextgetGLContext()com.jogamp.opengl.GLOffscreenAutoDrawable.FBOgetGLDrawable()com.jogamp.opengl.GLProfilegetGLProfile()TextureProjected2DgetProjectedTexture()float[]getSurfaceScale()Returns the scale factors needed to convert the _native_ pixel coordinates to the _window_ pixel coordinates.GlimpseBoundsgetTargetBounds()GlimpseBoundsgetTargetBounds(GlimpseTargetStack stack)Returns the cached or calculated bounds of this GlimpseTarget for a particular context.com.jogamp.opengl.util.texture.TexturegetTexture()intgetTextureName()booleanisDestroyed()booleanisVisible()If true, the GlimpseTarget should be drawn on the screen and mouse events should be dispatched for it.voidpaint()Lays out anyGlimpseLayoutinstances attached to the GlimpseCanvas and paints allGlimpsePainterinstances attached to the GlimpseLayouts.voidresize(int width, int height)BufferedImagetoBufferedImage()-
Methods inherited from class com.metsci.glimpse.core.canvas.AbstractGlimpseCanvas
addDisposeListener, addLayout, addLayout, dispose, disposeAttached, disposePainter, getGlimpseContext, getTargetChildren, isEventConsumer, isEventGenerator, removeAllLayouts, removeLayout, setEventConsumer, setEventGenerator, setLookAndFeel, setZOrder
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.metsci.glimpse.core.canvas.GlimpseCanvas
getDpi
-
-
-
-
Field Detail
-
DEFAULT_TEXTURE_UNIT
public static final int DEFAULT_TEXTURE_UNIT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FBOGlimpseCanvas
public FBOGlimpseCanvas(com.jogamp.opengl.GLProfile glProfile, int width, int height)
-
FBOGlimpseCanvas
public FBOGlimpseCanvas(com.jogamp.opengl.GLContext glContext, int width, int height)
-
FBOGlimpseCanvas
public FBOGlimpseCanvas(com.jogamp.opengl.GLContext glContext, int width, int height, boolean isBackgroundOpaque)
-
FBOGlimpseCanvas
@Deprecated public FBOGlimpseCanvas(String glProfileName, com.jogamp.opengl.GLContext glContext, int width, int height)
Deprecated.UseFBOGlimpseCanvas(GLContext,int,int)instead. The context implicitly provides a GLProfile.
-
FBOGlimpseCanvas
@Deprecated public FBOGlimpseCanvas(com.jogamp.opengl.GLProfile glProfile, com.jogamp.opengl.GLContext glContext, int width, int height)
Deprecated.UseFBOGlimpseCanvas(GLContext,int,int)instead. The context implicitly provides a GLProfile.
-
-
Method Detail
-
resize
public void resize(int width, int height)
-
toBufferedImage
public BufferedImage toBufferedImage()
-
getTextureName
public int getTextureName()
-
getProjectedTexture
public TextureProjected2D getProjectedTexture()
-
getTexture
public com.jogamp.opengl.util.texture.Texture getTexture()
-
getGLProfile
public com.jogamp.opengl.GLProfile getGLProfile()
-
getGLDrawable
public com.jogamp.opengl.GLOffscreenAutoDrawable.FBO getGLDrawable()
-
getGLContext
public com.jogamp.opengl.GLContext getGLContext()
-
paint
public void paint()
Description copied from interface:GlimpseCanvasLays out anyGlimpseLayoutinstances attached to the GlimpseCanvas and paints allGlimpsePainterinstances attached to the GlimpseLayouts.
-
getTargetBounds
public GlimpseBounds getTargetBounds()
-
getTargetBounds
public GlimpseBounds getTargetBounds(GlimpseTargetStack stack)
Description copied from interface:GlimpseTargetReturns the cached or calculated bounds of this GlimpseTarget for a particular context.- Returns:
- the bounds for the given stack
-
destroy
public void destroy()
Description copied from interface:GlimpseCanvasDestroys the native surface which this canvas draws to. Does not dispose of GL resources associated with GlimpsePainters and GlimpseLayouts attached to the GlimpseCanvas (as these may be attached to other GlimpseCanvases as well). Disposing of Glimpse resources can be done via#disposeAttached().- See Also:
GlimpseCanvas.disposeAttached()
-
isDestroyed
public boolean isDestroyed()
- Returns:
- whether or not
#dispose()has been successfully called. Once true, this GlimpseCanvas is no longer valid for rendering.
-
isVisible
public boolean isVisible()
Description copied from interface:GlimpseTargetIf true, the GlimpseTarget should be drawn on the screen and mouse events should be dispatched for it. Otherwise it is invisible and mouse events should not fire for the GlimpseTarget or its children.
-
getSurfaceScale
public float[] getSurfaceScale()
Description copied from interface:GlimpseCanvasReturns the scale factors needed to convert the _native_ pixel coordinates to the _window_ pixel coordinates. This only really matters on displays like like Macbook Retina.- Returns:
- the scale factors as {scaleX, scaleY}
-
-