public class CameraServer extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
protected void |
capture() |
static CameraServer |
getInstance() |
int |
getQuality()
Get the quality of the compressed image sent to the dashboard
|
boolean |
isAutoCaptureStarted()
check if auto capture is started
|
protected void |
serve()
Run the M-JPEG server.
|
void |
setImage(NIVision.Image image)
Manually change the image that is served by the MJPEG stream.
|
void |
setQuality(int quality)
Set the quality of the compressed image sent to the dashboard
|
void |
setSize(int size)
Sets the size of the image to use.
|
void |
startAutomaticCapture()
Start automatically capturing images to send to the dashboard.
|
void |
startAutomaticCapture(java.lang.String cameraName)
Start automatically capturing images to send to the dashboard.
|
void |
startAutomaticCapture(USBCamera camera) |
public static CameraServer getInstance()
public void setImage(NIVision.Image image)
startAutomaticCapture()
is called.image
- The IMAQ image to show on the dashboardpublic void startAutomaticCapture()
setImage(com.ni.vision.NIVision.Image)
shouldn't be called after this is called.
This overload calles startAutomaticCapture(String)
with the
default camera namepublic void startAutomaticCapture(java.lang.String cameraName)
setImage(com.ni.vision.NIVision.Image)
shouldn't be called after this is called.cameraName
- The name of the camera interface (e.g. "cam1")public void startAutomaticCapture(USBCamera camera)
protected void capture()
public boolean isAutoCaptureStarted()
public void setSize(int size)
size
- The size to usepublic void setQuality(int quality)
quality
- The quality of the JPEG image, from 0 to 100public int getQuality()
protected void serve() throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
- if the Socket connection failsjava.lang.InterruptedException
- if the sleep is interrupted