Class Pixy2CCC
- java.lang.Object
-
- io.github.pseudoresonance.pixy2api.Pixy2CCC
-
public class Pixy2CCC extends java.lang.Object
Java Port of Pixy2 Arduino Library Defines Color Connected Components tracker for Pixy2 https://github.com/PseudoResonance/Pixy2JavaAPI
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Pixy2CCC.Block
-
Field Summary
Fields Modifier and Type Field Description static byte
CCC_COLOR_CODES
static int
CCC_MAX_SIGNATURE
static byte
CCC_REQUEST_BLOCKS
static byte
CCC_RESPONSE_BLOCKS
static byte
CCC_SIG_ALL
static byte
CCC_SIG1
static byte
CCC_SIG2
static byte
CCC_SIG3
static byte
CCC_SIG4
static byte
CCC_SIG5
static byte
CCC_SIG6
static byte
CCC_SIG7
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.ArrayList<Pixy2CCC.Block>
getBlockCache()
Gets ArrayList of signature blocks from cacheint
getBlocks()
Gets signaturePixy2CCC.Block
s from Pixy2int
getBlocks(boolean wait)
Gets signaturePixy2CCC.Block
s from Pixy2int
getBlocks(boolean wait, int sigmap)
Gets signaturePixy2CCC.Block
s from Pixy2int
getBlocks(boolean wait, int sigmap, int maxBlocks)
Gets signaturePixy2CCC.Block
s from Pixy2
-
-
-
Field Detail
-
CCC_MAX_SIGNATURE
public static final int CCC_MAX_SIGNATURE
- See Also:
- Constant Field Values
-
CCC_RESPONSE_BLOCKS
public static final byte CCC_RESPONSE_BLOCKS
- See Also:
- Constant Field Values
-
CCC_REQUEST_BLOCKS
public static final byte CCC_REQUEST_BLOCKS
- See Also:
- Constant Field Values
-
CCC_SIG1
public static final byte CCC_SIG1
- See Also:
- Constant Field Values
-
CCC_SIG2
public static final byte CCC_SIG2
- See Also:
- Constant Field Values
-
CCC_SIG3
public static final byte CCC_SIG3
- See Also:
- Constant Field Values
-
CCC_SIG4
public static final byte CCC_SIG4
- See Also:
- Constant Field Values
-
CCC_SIG5
public static final byte CCC_SIG5
- See Also:
- Constant Field Values
-
CCC_SIG6
public static final byte CCC_SIG6
- See Also:
- Constant Field Values
-
CCC_SIG7
public static final byte CCC_SIG7
- See Also:
- Constant Field Values
-
CCC_COLOR_CODES
public static final byte CCC_COLOR_CODES
- See Also:
- Constant Field Values
-
CCC_SIG_ALL
public static final byte CCC_SIG_ALL
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Pixy2CCC
protected Pixy2CCC(Pixy2 pixy)
Constructs Pixy2 Color Connected Components tracker- Parameters:
pixy
- Pixy2 instance
-
-
Method Detail
-
getBlocks
public int getBlocks()
Gets signature
Pixy2CCC.Block
s from Pixy2Defaults to waiting for a response, getting blocks from all signatures and a maximum of all 256 blocks
Returned data should be retrieved from the cache with
getBlockCache()
- Returns:
- Pixy2 error code
-
getBlocks
public int getBlocks(boolean wait)
Gets signature
Pixy2CCC.Block
s from Pixy2Defaults to getting blocks from all signatures and a maximum of all 256 blocks
Returned data should be retrieved from the cache with
getBlockCache()
- Parameters:
wait
- Whether to wait for Pixy2 if data is not available- Returns:
- Pixy2 error code
-
getBlocks
public int getBlocks(boolean wait, int sigmap)
Gets signature
Pixy2CCC.Block
s from Pixy2Defaults to getting a maximum of all 256 blocks
Returned data should be retrieved from the cache with
getBlockCache()
- Parameters:
wait
- Whether to wait for Pixy2 if data is not availablesigmap
- Sigmap to look for- Returns:
- Pixy2 error code
-
getBlocks
public int getBlocks(boolean wait, int sigmap, int maxBlocks)
Gets signature
Pixy2CCC.Block
s from Pixy2Returned data should be retrieved from the cache with
getBlockCache()
- Parameters:
wait
- Whether to wait for Pixy2 if data is not availablesigmap
- Sigmap to look formaxBlocks
- Maximum blocks to look for- Returns:
- Pixy2 error code
-
getBlockCache
public java.util.ArrayList<Pixy2CCC.Block> getBlockCache()
Gets ArrayList of signature blocks from cache
getBlocks(boolean, int, int)
must be executed first to get the data actual from Pixy2- Returns:
- Pixy2 signature Blocks
-
-