|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object maslab.camera.Camera
public class Camera
Field Summary | |
---|---|
static int |
WB_AUTO
|
static int |
WB_FLOURESCENT
|
static int |
WB_INDOOR
|
static int |
WB_MANUAL
|
static int |
WB_OUTDOOR
|
Constructor Summary | |
---|---|
Camera()
Open a camera, searching /dev/videoX and /dev/video. |
|
Camera(java.lang.String devname)
Open a camera. |
Method Summary | |
---|---|
java.awt.image.BufferedImage |
capture()
Capture a single frame, allocating a new buffer. |
java.awt.image.BufferedImage |
capture(java.awt.image.BufferedImage image)
Capture a single frame. |
static java.awt.image.BufferedImage |
channelSelect(java.awt.image.BufferedImage image,
int channel)
|
void |
close()
Close the camera. |
java.awt.image.BufferedImage |
createImage()
Create a BufferedImage with the correct format/bitdepth for future capture operations. |
boolean |
getBacklightCompensation()
Get BacklightCompensation mode. |
int |
getContour()
Get contour filter value. |
boolean |
getFlicker()
Get Flicker Compensation mode. |
int |
getFps()
The current target fps setting of the camera. |
int |
getGain()
Get gain value. |
int |
getHeight()
The current height setting of the camera. |
int |
getLedOff()
|
int |
getLedOn()
|
int |
getNoiseReduction()
Get Noise Reduction mode. |
int |
getQuality()
Get the current quality level. |
int |
getWhiteBalanceBlue()
If white balance mode is manual, returns the blue gain. |
int |
getWhiteBalanceMode()
Determine the current white balance mode (e.g., WB_INDOOR). |
int |
getWhiteBalanceRed()
If white balance mode is manual, returns the red gain. |
int |
getWidth()
The current width setting of the camera. |
static java.awt.image.BufferedImage |
rgbToHsv(java.awt.image.BufferedImage image)
Converts the image into RGB. |
static java.awt.image.BufferedImage |
rgbToRgv(java.awt.image.BufferedImage image)
Converts the image into RGV. |
void |
setBacklightCompensation(boolean value)
Set Backlight Compensation mode. |
void |
setCaptureSettings(int width,
int height,
int fps)
Request a new size from the camera. |
void |
setContour(int value)
Set Contour filter. |
void |
setFlicker(boolean value)
Set Flicker Compensation mode. |
void |
setGain(int value)
Set gain control. |
void |
setLed(int onTime,
int offTime)
Set the LED's blinking rate. |
void |
setNoiseReduction(int value)
Set Noise Reduction mode. |
void |
setQuality(int value)
Set quality (compression) level. |
void |
setShutter(int value)
Set shutter speed. |
void |
setWhiteBalanceManual(int red,
int blue)
Sets the camera to manual white balance, using the provided red and blue gains. |
void |
setWhiteBalanceMode(int mode)
Set the current white balance mode, e.g., WB_INDOOR. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int WB_INDOOR
public static final int WB_OUTDOOR
public static final int WB_FLOURESCENT
public static final int WB_MANUAL
public static final int WB_AUTO
Constructor Detail |
---|
public Camera() throws java.io.IOException
java.io.IOException
public Camera(java.lang.String devname) throws java.io.IOException
devname
- The path to the device to open.
java.io.IOException
Method Detail |
---|
public void close()
public java.awt.image.BufferedImage createImage()
public java.awt.image.BufferedImage capture()
public java.awt.image.BufferedImage capture(java.awt.image.BufferedImage image)
image
- The image to be overwritten with the current
camera frame.public void setCaptureSettings(int width, int height, int fps)
width
- Width, in pixelsheight
- Height, in pixels.public int getWidth()
public int getHeight()
public int getFps()
public void setWhiteBalanceMode(int mode)
public int getWhiteBalanceMode()
public int getWhiteBalanceRed()
public int getWhiteBalanceBlue()
public void setWhiteBalanceManual(int red, int blue)
red
- [0,65535] Red channel gainblue
- [0,65535] Blue channel gain.public void setLed(int onTime, int offTime)
onTime
- [0-25000] (ms)offTime
- [range unknown] (ms)public int getLedOn()
public int getLedOff()
public void setQuality(int value)
value
- [0-3]. 0=no compression, 3=high compression.public int getQuality()
public void setContour(int value)
value
- [0-65535]. 0=blur, 65535=sharpen. -1 means auto.public int getContour()
public void setBacklightCompensation(boolean value)
value
- Enabled if true.public boolean getBacklightCompensation()
public void setFlicker(boolean value)
value
- Enabled if true.public boolean getFlicker()
public void setNoiseReduction(int value)
value
- [0,3]. 0=off, 3=lots of filtering.public int getNoiseReduction()
public void setGain(int value)
value
- [0,65535]. 0=low gain, 65535=max gain. gain<0 means auto.public int getGain()
public void setShutter(int value)
public static java.awt.image.BufferedImage rgbToHsv(java.awt.image.BufferedImage image)
public static java.awt.image.BufferedImage rgbToRgv(java.awt.image.BufferedImage image)
public static java.awt.image.BufferedImage channelSelect(java.awt.image.BufferedImage image, int channel)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |