Package org.robwork.sdurw_sensor
Class CameraFirewirePtr
- java.lang.Object
-
- org.robwork.sdurw_sensor.CameraFirewirePtr
-
public class CameraFirewirePtr extends java.lang.Object
Ptr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description CameraFirewirePtr()
Default constructor yielding a NULL-pointer.CameraFirewirePtr(long cPtr, boolean cMemoryOwn)
CameraFirewirePtr(CameraFirewire ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CameraFirewire
__ref__()
Dereferencing operator.void
acquire()
aquires an image from the camera.boolean
addListener(CameraListener listener)
adds a CameraListener to this cameraCameraFirewireCPtr
cptr()
void
delete()
CameraFirewire
deref()
The pointer stored in the object.boolean
equals(CameraFirewire p)
CameraFirewire.CaptureMode
getCaptureMode()
returns the CaptureMode of this cameraCameraFirewire.CapturePolicy
getCapturePolicy()
returns the capture policy of this camera.CameraFirewire.ColorCode
getColorMode()
returns the CaptureMode of this camerastatic long
getCPtr(CameraFirewirePtr obj)
CameraFirewire
getDeref()
Member access operator.java.lang.String
getDescription()
returns a description of this sensorCameraFirewire.ErrorCode
getError()
returns the errorcode of the latest error.double
getFeature(CameraFirewire.CameraFeature setting)
returns the value of the specified camera setting.double
getFrameRate()
returns the framerate that this camera is setup withdouble
getGain()
Get actual gain value.
Note: If gain is not available then a dummy implementation
returning -1 is used and an error message is produced.long
getHeight()
get width of the captured imagesImage
getImage()
returns the last image acquired from the camera.java.lang.String
getModelInfo()
returns the camera model information (version, type, size, etc.)java.lang.String
getName()
returns the name of this sensorPropertyMap
getPropertyMap()
gets the propertymap of this sensorSensorModelPtr
getSensorModel()
The frame to which the sensor is attached.
The frame can be NULL.double
getShutter()
Get actual shutter value.
Note: If shutter is not available then a dummy implementation
will throw an error message.pair_d_d
getShutterBounds()
gets the shutter bounds.
Note: If shutter is not available then a dummy implementation
will throw an error message.long
getWidth()
get width of the captured imagesboolean
initialize()
initializes the camera to the current settings
(CaptureMode,ColorMode,etc.)boolean
isError()
tests whether this camera is in an error state.boolean
isFeatureAvailable(CameraFirewire.CameraFeature option)
returns whether the specified camera option is supported
by the camera.boolean
isGainAvailable()
Check if gain is available.boolean
isImageReady()
tests whether a image has been acquiredboolean
isInitialized()
returns whether this camera is initialized or not.boolean
isNull()
checks if the pointer is nullboolean
isShared()
check if this Ptr has shared ownership or none
ownershipboolean
isShutterAvailable()
Check if shutter is available.boolean
isStarted()
returns whether this camera is started or not.boolean
removeListener(CameraListener listener)
removes a CameraListener from this cameras listener list.boolean
setCaptureMode(CameraFirewire.CaptureMode mode)
sets the CaptureMode of this camera.boolean
setCapturePolicy(CameraFirewire.CapturePolicy policy)
sets the capture policy of this cameraboolean
setColorMode(CameraFirewire.ColorCode mode)
sets the CaptureMode of this camera.boolean
setFeature(CameraFirewire.CameraFeature setting, double value)
sets the value of the specified camera setting.void
setFrameRate(double framerate)
sets the framerate of this camera.double
setGain(double Value)
Set gain value.void
setSensorModel(SensorModelPtr smodel)
Sets the frame to which the sensor should be attached
void
setShutter(double Value)
Set shutter value.boolean
start()
starts this camera, if the camera has not been
initialized the initialize function will be called.void
stop()
stops this camera.
-
-
-
Constructor Detail
-
CameraFirewirePtr
public CameraFirewirePtr(long cPtr, boolean cMemoryOwn)
-
CameraFirewirePtr
public CameraFirewirePtr()
Default constructor yielding a NULL-pointer.
-
CameraFirewirePtr
public CameraFirewirePtr(CameraFirewire ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(CameraFirewirePtr obj)
-
delete
public void delete()
-
deref
public CameraFirewire deref()
The pointer stored in the object.
-
__ref__
public CameraFirewire __ref__()
Dereferencing operator.
-
getDeref
public CameraFirewire getDeref()
Member access operator.
-
equals
public boolean equals(CameraFirewire p)
-
isShared
public boolean isShared()
check if this Ptr has shared ownership or none
ownership- Returns:
- true if Ptr has shared ownership, false if it has no ownership.
-
isNull
public boolean isNull()
checks if the pointer is null- Returns:
- Returns true if the pointer is null
-
cptr
public CameraFirewireCPtr cptr()
-
getCaptureMode
public CameraFirewire.CaptureMode getCaptureMode()
returns the CaptureMode of this camera- Returns:
- the camera capturemode
-
setCaptureMode
public boolean setCaptureMode(CameraFirewire.CaptureMode mode)
sets the CaptureMode of this camera.- Parameters:
mode
- [in] the wanted capture mode- Returns:
- true if CaptureMode was set successfully, false otherwise
-
getColorMode
public CameraFirewire.ColorCode getColorMode()
returns the CaptureMode of this camera- Returns:
- the camera capturemode
-
setColorMode
public boolean setColorMode(CameraFirewire.ColorCode mode)
sets the CaptureMode of this camera.- Parameters:
mode
- [in] the wanted capture mode- Returns:
- true if CaptureMode was set successfully, false otherwise
-
getError
public CameraFirewire.ErrorCode getError()
returns the errorcode of the latest error. If no error has occured
then SUCCES is returned.- Returns:
- the error code
-
isError
public boolean isError()
tests whether this camera is in an error state.- Returns:
- true if camera is in error state, false otherwise
-
getCapturePolicy
public CameraFirewire.CapturePolicy getCapturePolicy()
returns the capture policy of this camera.- Returns:
- capture policy of the camera
-
setCapturePolicy
public boolean setCapturePolicy(CameraFirewire.CapturePolicy policy)
sets the capture policy of this camera- Parameters:
policy
- [in] the capture policy- Returns:
- true if capture policy was set succesfully, false otherwise
-
isFeatureAvailable
public boolean isFeatureAvailable(CameraFirewire.CameraFeature option)
returns whether the specified camera option is supported
by the camera.- Parameters:
option
- [in] the specific CameraOption- Returns:
- true if the option is available, false otherwise.
-
getFeature
public double getFeature(CameraFirewire.CameraFeature setting)
returns the value of the specified camera setting. If the
camera is not initialized or the setting is unsupported -1 is returned.- Parameters:
setting
- [in] the CameraFeature- Returns:
- value of the setting if setting is supported and camera is
initilized, else -1 is returned.
-
setFeature
public boolean setFeature(CameraFirewire.CameraFeature setting, double value)
sets the value of the specified camera setting. If the
camera is not initialized or the setting is unsupported false is returned.- Parameters:
setting
- [in] the CameraFeaturevalue
- [in] the value of the feature- Returns:
- true if the setting was succesfully changed, false otherwise.
-
getModelInfo
public java.lang.String getModelInfo()
returns the camera model information (version, type, size, etc.)- Returns:
- camera model information
-
initialize
public boolean initialize()
initializes the camera to the current settings
(CaptureMode,ColorMode,etc.)- Returns:
- true if initialization is succesfully, false otherwise.
-
isInitialized
public boolean isInitialized()
returns whether this camera is initialized or not.- Returns:
- true if intialized, false otherwise
-
start
public boolean start()
starts this camera, if the camera has not been
initialized the initialize function will be called.- Returns:
- true if camera was successfully started, false
otherwise
-
isStarted
public boolean isStarted()
returns whether this camera is started or not.- Returns:
- true if started, false otherwise
-
stop
public void stop()
stops this camera. When the camera is stopped it can be
reinitialized using initialize()
-
acquire
public void acquire()
aquires an image from the camera. This method is not blocking.
Use isImageReady to poll for completion of acquire.
-
isImageReady
public boolean isImageReady()
tests whether a image has been acquired- Returns:
- true if an image has been acquired, false otherwise.
-
getImage
public Image getImage()
returns the last image acquired from the camera. This method
is not blocking, if no image has been acquired yet an empty image
is returned. The image returned can for some specific drivers be read
only.- Returns:
- last image captured from camera.
-
getFrameRate
public double getFrameRate()
returns the framerate that this camera is setup with- Returns:
- the framerate in frames per second
-
setFrameRate
public void setFrameRate(double framerate)
sets the framerate of this camera. If the framerate is not
supported the closest supported framerate is choosen.- Parameters:
framerate
- [in] the framerate
-
getWidth
public long getWidth()
get width of the captured images- Returns:
- width
-
getHeight
public long getHeight()
get width of the captured images- Returns:
- width
-
addListener
public boolean addListener(CameraListener listener)
adds a CameraListener to this camera- Parameters:
listener
- [in] the CameraListener that is to be added- Returns:
- true if listener was added succesfully, false otherwise
-
removeListener
public boolean removeListener(CameraListener listener)
removes a CameraListener from this cameras listener list.- Parameters:
listener
- [in] the listener that is to be removed- Returns:
- true if listener was removed succesfully, false otherwise.
-
isShutterAvailable
public boolean isShutterAvailable()
Check if shutter is available.- Returns:
- True if shutter is available
-
getShutter
public double getShutter()
Get actual shutter value.
Note: If shutter is not available then a dummy implementation
will throw an error message.- Returns:
- shutter value in micro-seconds.
-
setShutter
public void setShutter(double Value)
Set shutter value. If the given value is not possible the nearest
value are choosen.
Note: If shutter is not available then a dummy implementation
will throw an error message.- Parameters:
Value
- New shutter value.
-
getShutterBounds
public pair_d_d getShutterBounds()
gets the shutter bounds.
Note: If shutter is not available then a dummy implementation
will throw an error message.- Returns:
- first value is the min bound and second value is the max bound
-
isGainAvailable
public boolean isGainAvailable()
Check if gain is available.- Returns:
- True if zoom is available
-
getGain
public double getGain()
Get actual gain value.
Note: If gain is not available then a dummy implementation
returning -1 is used and an error message is produced.- Returns:
- Gain value.
-
setGain
public double setGain(double Value)
Set gain value. If the given value is not possible the nearest
value are choosen.
Note: If gain is not available then a dummy implementation
returning -1 is used and an error message is produced.- Parameters:
Value
- New gain value.- Returns:
- New nearest gain value.
-
getName
public java.lang.String getName()
returns the name of this sensor- Returns:
- name of sensor
-
getDescription
public java.lang.String getDescription()
returns a description of this sensor- Returns:
- reference to this sensors description
-
getSensorModel
public SensorModelPtr getSensorModel()
The frame to which the sensor is attached.
The frame can be NULL.
-
setSensorModel
public void setSensorModel(SensorModelPtr smodel)
Sets the frame to which the sensor should be attached
- Parameters:
smodel
-
-
getPropertyMap
public PropertyMap getPropertyMap()
gets the propertymap of this sensor
-
-