mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-21 01:01:41 +00:00
More UI fixes, add videomode and StreamDivisor to config
This commit is contained in:
@@ -6,7 +6,7 @@ import edu.wpi.cscore.VideoMode;
|
||||
public interface CameraCapture extends ImageCapture {
|
||||
USBCameraProperties getProperties();
|
||||
|
||||
public VideoMode getCurrentVideoMode();
|
||||
VideoMode getCurrentVideoMode();
|
||||
|
||||
/**
|
||||
* Set the exposure of the camera
|
||||
@@ -22,10 +22,16 @@ public interface CameraCapture extends ImageCapture {
|
||||
|
||||
/**
|
||||
* Set the video mode (fps and resolution) of the camera
|
||||
* @param mode the wanted mode
|
||||
* @param mode the desired mode
|
||||
*/
|
||||
void setVideoMode(VideoMode mode);
|
||||
|
||||
/**
|
||||
* Set the video mode (fps and resolution) of the camera
|
||||
* @param index the index of the desired mode
|
||||
*/
|
||||
void setVideoMode(int index);
|
||||
|
||||
/**
|
||||
* Set the gain of the camera
|
||||
* NOTE - Not all cameras support this.
|
||||
|
||||
@@ -68,14 +68,11 @@ public class USBCameraCapture implements CameraCapture {
|
||||
System.err.println("Failed to change camera video mode!");
|
||||
}
|
||||
}
|
||||
|
||||
public void setVideoMode(int index){
|
||||
VideoMode mode = properties.getVideoModes().get(index);
|
||||
setVideoMode(mode);
|
||||
}
|
||||
public int getVideoModeIndex(){
|
||||
return properties.getVideoModes().indexOf(properties.getStaticProperties().mode);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setGain(int gain) {
|
||||
|
||||
@@ -68,8 +68,10 @@ public class USBCameraProperties extends CaptureProperties {
|
||||
}
|
||||
|
||||
public void setFOV(double FOV) {
|
||||
this.FOV = FOV;
|
||||
staticProperties = new CaptureStaticProperties(staticProperties.mode, staticProperties.imageWidth, staticProperties.imageHeight, FOV);
|
||||
if (this.FOV != FOV) {
|
||||
this.FOV = FOV;
|
||||
staticProperties = new CaptureStaticProperties(staticProperties.mode, staticProperties.imageWidth, staticProperties.imageHeight, FOV);
|
||||
}
|
||||
}
|
||||
|
||||
public double getFOV() {
|
||||
@@ -97,4 +99,11 @@ public class USBCameraProperties extends CaptureProperties {
|
||||
public List<VideoMode> getVideoModes() {
|
||||
return videoModes;
|
||||
}
|
||||
|
||||
public VideoMode getCurrentVideoMode() { return staticProperties.mode; }
|
||||
|
||||
public int getCurrentVideoModeIndex(){
|
||||
return getVideoModes().indexOf(getCurrentVideoMode());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user