public class OffscreenCanvas extends Object implements ICanvas
ICanvas implementation able to render the chart in an offscreen canvas,
meaning no frame or GUI is needed to get a chart.
Subsequently, one will wish to generate chart images by calling:
chart.screenshot();
Note that the GLCapabilities are modified while an instance of OffscreenCanvas
is modified.| Modifier and Type | Field and Description |
|---|---|
protected com.jogamp.opengl.GLCapabilities |
capabilities |
protected com.jogamp.opengl.GLOffscreenAutoDrawable |
glpBuffer |
protected Renderer3d |
renderer |
protected View |
view |
| Constructor and Description |
|---|
OffscreenCanvas(IChartComponentFactory factory,
Scene scene,
Quality quality,
com.jogamp.opengl.GLCapabilities capabilities,
int width,
int height) |
OffscreenCanvas(IChartComponentFactory factory,
Scene scene,
Quality quality,
com.jogamp.opengl.GLCapabilities capabilities,
int width,
int height,
boolean traceGL,
boolean debugGL) |
| Modifier and Type | Method and Description |
|---|---|
void |
addKeyController(Object o)
A generic interface for mouse listener to remain Windowing toolkit
independant. * Implementation of this method should simply cast the input
assuming it will correspond to canvas-compatible mouse listener.
|
void |
addMouseController(Object o)
A generic interface for mouse listener to remain Windowing toolkit
independant. * Implementation of this method should simply cast the input
assuming it will correspond to canvas-compatible mouse listener.
|
void |
dispose()
Performs all required cleanup when destroying a Canvas.
|
void |
forceRepaint()
Invoked when a user requires the Canvas to be repainted (e.g. a non 3d
layer has changed).
|
com.jogamp.opengl.GLCapabilities |
getCapabilities() |
String |
getDebugInfo() |
com.jogamp.opengl.GLOffscreenAutoDrawable |
getDrawable()
Returns the GLDrawable associated with the canvas
|
com.jogamp.opengl.GLOffscreenAutoDrawable |
getGlpBuffer()
Deprecated.
|
Renderer3d |
getRenderer() |
int |
getRendererHeight()
Returns the renderer's height, i.e. the display height.
|
int |
getRendererWidth()
Returns the renderer's width, i.e. the display width.
|
View |
getView()
Provide a reference to the View that renders into this canvas.
|
void |
initBuffer(com.jogamp.opengl.GLCapabilities capabilities,
int width,
int height)
Initialize a GLPBuffer with desired capabilities.
|
void |
removeKeyController(Object o)
A generic interface for key listener to remain Windowing toolkit
independant. * Implementation of this method should simply cast the input
assuming it will correspond to canvas-compatible key listener.
|
void |
removeMouseController(Object o)
A generic interface for key listener to remain Windowing toolkit
independant. * Implementation of this method should simply cast the input
assuming it will correspond to canvas-compatible key listener.
|
com.jogamp.opengl.util.texture.TextureData |
screenshot()
Returns an image with the current renderer's size
|
com.jogamp.opengl.util.texture.TextureData |
screenshot(File file) |
void |
setPixelScale(float[] scale)
Defines pixel scale.
|
protected View view
protected Renderer3d renderer
protected com.jogamp.opengl.GLOffscreenAutoDrawable glpBuffer
protected com.jogamp.opengl.GLCapabilities capabilities
public OffscreenCanvas(IChartComponentFactory factory, Scene scene, Quality quality, com.jogamp.opengl.GLCapabilities capabilities, int width, int height)
public OffscreenCanvas(IChartComponentFactory factory, Scene scene, Quality quality, com.jogamp.opengl.GLCapabilities capabilities, int width, int height, boolean traceGL, boolean debugGL)
public void initBuffer(com.jogamp.opengl.GLCapabilities capabilities,
int width,
int height)
capabilities - width - height - public void setPixelScale(float[] scale)
ICanvasCamera.screenToModel(com.jogamp.opengl.GL, com.jogamp.opengl.glu.GLU, org.jzy3d.maths.Coord3d)
output wrong result.
When running on Retina display, those two options fixed buggy mouse
selections on Retina:
setPixelScale in interface ICanvasScalableSurface#setSurfaceScale(float[])} in JOGL javadoc for
more informations@Deprecated public com.jogamp.opengl.GLOffscreenAutoDrawable getGlpBuffer()
public com.jogamp.opengl.GLOffscreenAutoDrawable getDrawable()
ICanvasgetDrawable in interface ICanvaspublic void dispose()
ICanvaspublic void forceRepaint()
ICanvasforceRepaint in interface ICanvaspublic com.jogamp.opengl.util.texture.TextureData screenshot()
ICanvasscreenshot in interface ICanvaspublic com.jogamp.opengl.util.texture.TextureData screenshot(File file) throws IOException
screenshot in interface ICanvasIOExceptionpublic View getView()
public int getRendererWidth()
ICanvasgetRendererWidth in interface ICanvaspublic int getRendererHeight()
ICanvasgetRendererHeight in interface ICanvaspublic Renderer3d getRenderer()
getRenderer in interface ICanvaspublic String getDebugInfo()
getDebugInfo in interface ICanvaspublic void addMouseController(Object o)
ICanvasaddMouseController in interface ICanvaspublic void addKeyController(Object o)
ICanvasaddKeyController in interface ICanvaspublic void removeMouseController(Object o)
ICanvasremoveMouseController in interface ICanvaspublic void removeKeyController(Object o)
ICanvasremoveKeyController in interface ICanvaspublic com.jogamp.opengl.GLCapabilities getCapabilities()
Copyright © 2016. All rights reserved.