Class Pixy2Video
- java.lang.Object
-
- io.github.pseudoresonance.pixy2api.Pixy2Video
-
public class Pixy2Video extends java.lang.ObjectJava Port of Pixy2 Arduino Library Defines video getter for Pixy2 https://github.com/PseudoResonance/Pixy2JavaAPI
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPixy2Video.RGB
-
Field Summary
Fields Modifier and Type Field Description static byteVIDEO_REQUEST_GET_RGB
-
Constructor Summary
Constructors Modifier Constructor Description protectedPixy2Video(Pixy2 pixy)Constructs Pixy2 video getter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetRGB(int x, int y, Pixy2Video.RGB rgb)Gets average RGB value at 5x5 area around specified coordinates in the imageintgetRGB(int x, int y, Pixy2Video.RGB rgb, boolean saturate)Gets average RGB value at 5x5 area around specified coordinates in the image
-
-
-
Field Detail
-
VIDEO_REQUEST_GET_RGB
public static final byte VIDEO_REQUEST_GET_RGB
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Pixy2Video
protected Pixy2Video(Pixy2 pixy)
Constructs Pixy2 video getter- Parameters:
pixy- Pixy2 instance
-
-
Method Detail
-
getRGB
public int getRGB(int x, int y, Pixy2Video.RGB rgb)Gets average RGB value at 5x5 area around specified coordinates in the imageDefaults to saturating response color
- Parameters:
x- X valuey- Y valuergb- RGB container to return values in- Returns:
- Pixy2 error code
-
getRGB
public int getRGB(int x, int y, Pixy2Video.RGB rgb, boolean saturate)Gets average RGB value at 5x5 area around specified coordinates in the image- Parameters:
x- X valuey- Y valuergb- RGB container to return values insaturate- Whether or not to scale all RGB values to maximize the greatest value at 255- Returns:
- Pixy2 error code
-
-