changed stream resolution list from ratio

- changed the resolution list to be the actual resolution instead of ratio 
- changed development port to be 5800
This commit is contained in:
ori agranat
2019-11-05 21:15:10 +02:00
parent ac7bd48d87
commit 0881880b86
4 changed files with 28 additions and 7 deletions

View File

@@ -9,6 +9,7 @@ import edu.wpi.first.networktables.NetworkTable;
import edu.wpi.first.networktables.NetworkTableInstance;
import org.opencv.core.Mat;
import java.lang.reflect.Array;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
@@ -304,9 +305,14 @@ public class Camera {
}
}
public List<String> getResolutionList() {
public List<HashMap> getResolutionList() {
return Arrays.stream(availableVideoModes)
.map(res -> String.format("%sx%s@%sFPS, %s", res.width, res.height, res.fps, res.pixelFormat.toString()))
.map(res -> new HashMap<String,Object>(){{
put("width", res.width);
put("height", res.height);
put("fps", res.fps);
put("pixelFormat", res.pixelFormat);
}})
.collect(Collectors.toList());
}

View File

@@ -4,7 +4,7 @@ public enum StreamDivisor {
none(1),
half(2),
quarter(4),
sixth(6);
eighth(8);
public final Integer value;