Package org.robwork.sdurw_simulation
Class GLFrameGrabber
- java.lang.Object
-
- org.robwork.sdurw_simulation.FrameGrabber
-
- org.robwork.sdurw_simulation.GLFrameGrabber
-
public class GLFrameGrabber extends FrameGrabber
An implementation of the FrameGrabber interface. The GLFrameGrabber
grabs images from a OpenGL scene using a simple pinhole camera model.
a framethe opengl rendering to
take pictures of the scene.
The most basic parameter of a camera is its Field of view. This
can be used as an initial camera model. Field of view can be
calculated from the focal length and the size of the CCD
typically (1/2, 1/3, 1/4) inch.
If a more realistic camera model is
required the perspective transform of a specific camera can be added
-
-
Constructor Summary
Constructors Constructor Description GLFrameGrabber(int width, int height, double fov)
constructorGLFrameGrabber(int width, int height, double fov, double near)
constructorGLFrameGrabber(int width, int height, double fov, double near, double far)
constructorGLFrameGrabber(long cPtr, boolean cMemoryOwn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
static long
getCPtr(GLFrameGrabber obj)
void
grab(FramePtr frame, State state)
this function grabs a image from the specialized source and
copies it to the FrameGrabber image.boolean
init(SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer_t drawer)
initialize the grabber with a scene viewer.void
resize(int width, int height)
resizes the image that this frameGrabber use.void
resize(int width, int height, Image.ColorCode colorCode)
resizes the image that this frameGrabber use.-
Methods inherited from class org.robwork.sdurw_simulation.FrameGrabber
getCPtr, getHeight, getImage, getWidth
-
-
-
-
Constructor Detail
-
GLFrameGrabber
public GLFrameGrabber(long cPtr, boolean cMemoryOwn)
-
GLFrameGrabber
public GLFrameGrabber(int width, int height, double fov, double near, double far)
constructor- Parameters:
width
- [in] width of imageheight
- [in] height of imagefov
- [in] the vertical field of view angle in degreenear
- [in] the minimum depth of camera.far
- [in] the maximum depth of camera.
-
GLFrameGrabber
public GLFrameGrabber(int width, int height, double fov, double near)
constructor- Parameters:
width
- [in] width of imageheight
- [in] height of imagefov
- [in] the vertical field of view angle in degreenear
- [in] the minimum depth of camera.
-
GLFrameGrabber
public GLFrameGrabber(int width, int height, double fov)
constructor- Parameters:
width
- [in] width of imageheight
- [in] height of imagefov
- [in] the vertical field of view angle in degree
-
-
Method Detail
-
getCPtr
public static long getCPtr(GLFrameGrabber obj)
-
delete
public void delete()
- Overrides:
delete
in classFrameGrabber
-
resize
public void resize(int width, int height)
Description copied from class:FrameGrabber
resizes the image that this frameGrabber use. The colorcode will
default to the one that FrameGrabber was initialized with.- Overrides:
resize
in classFrameGrabber
- Parameters:
width
- [in] width of imageheight
- [in] height of image
-
resize
public void resize(int width, int height, Image.ColorCode colorCode)
Description copied from class:FrameGrabber
resizes the image that this frameGrabber use.- Overrides:
resize
in classFrameGrabber
- Parameters:
width
- [in] width of image.height
- [in] height of image.colorCode
- [in] Color encoding of the image.
-
init
public boolean init(SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer_t drawer)
initialize the grabber with a scene viewer. This registers the grabber
as a camera in the scene and enables rendering.- Parameters:
drawer
- [in] the scene viewer- Returns:
- true if initialization succeeded, false otherwise (depends on the capabilities of
the SceneViewer).
-
grab
public void grab(FramePtr frame, State state)
Description copied from class:FrameGrabber
this function grabs a image from the specialized source and
copies it to the FrameGrabber image.- Overrides:
grab
in classFrameGrabber
-
-