public class BooleanMask2D extends java.lang.Object implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
java.awt.Rectangle |
bounds
Region represented by the mask.
|
boolean[] |
mask
Boolean mask array.
|
Constructor and Description |
---|
BooleanMask2D()
Create an empty BooleanMask2D
|
BooleanMask2D(int[] points)
Build a new boolean mask from the specified array of integer representing points.
|
BooleanMask2D(java.awt.Point[] points)
Build a new boolean mask from the specified array of
Point . |
BooleanMask2D(java.awt.Rectangle bounds,
boolean[] mask) |
Modifier and Type | Method and Description |
---|---|
void |
add(BooleanMask2D booleanMask)
Add the specified mask into the current mask (bounds can be enlarged):
current mask + mask = result
################ ################ ################
############## ############## ################
############ ############ ################
########## ########## ################
######## ######## ################
###### ###### ###### ######
#### #### #### ####
## ## ## ##
|
void |
add(java.awt.Rectangle boundsToAdd,
boolean[] maskToAdd)
Add the specified mask into the current mask (bounds can be enlarged):
current mask + mask = result
################ ################ ################
############## ############## ################
############ ############ ################
########## ########## ################
######## ######## ################
###### ###### ###### ######
#### #### #### ####
## ## ## ##
|
java.lang.Object |
clone() |
boolean |
contains(BooleanMask2D booleanMask)
Return true if mask contains the specified 2D mask.
|
boolean |
contains(int x,
int y)
Return true if mask contains the specified point
|
boolean |
contains(java.awt.Rectangle rect,
boolean[] bmask)
Return true if mask contains the specified 2D mask.
|
BooleanMask2D |
downscale()
Fast 2x down scaling (each 2x2 block points become 1 point).
|
static BooleanMask2D |
downscale(BooleanMask2D mask)
Fast 2x down scaling (each 2x2 block points become 1 point).
|
static BooleanMask2D |
downscale(BooleanMask2D mask,
int nbPointForTrue)
Fast 2x down scaling (each 2x2 block points become 1 point).
|
BooleanMask2D |
downscale(int nbPointForTrue)
Fast 2x down scaling (each 2x2 block points become 1 point).
|
void |
exclusiveAdd(BooleanMask2D booleanMask)
Exclusively add the specified mask into the current mask (bounds can change):
mask1 xor mask2 = result
################ ################
############## ############## ## ##
############ ############ #### ####
########## ########## ###### ######
######## ######## ################
###### ###### ###### ######
#### #### #### ####
## ## ## ##
|
void |
exclusiveAdd(java.awt.Rectangle boundsToXAdd,
boolean[] maskToXAdd)
Exclusively add the specified mask into the current mask (bounds can change):
mask1 xor mask2 = result
################ ################
############## ############## ## ##
############ ############ #### ####
########## ########## ###### ######
######## ######## ################
###### ###### ###### ######
#### #### #### ####
## ## ## ##
|
void |
exclusiveUnion(BooleanMask2D booleanMask)
Deprecated.
Use
getExclusiveUnion(BooleanMask2D) instead. |
void |
exclusiveUnion(java.awt.Rectangle bounds,
boolean[] mask)
Deprecated.
Use
getExclusiveUnion(Rectangle, boolean[]) instead. |
BooleanMask2D[] |
getComponents()
Return an array of boolean mask representing each independent component of the current
mask.
|
java.awt.Point[][] |
getComponentsPoints(boolean sorted)
Compute and return a 2D array of
Point representing points of each component of the
current mask. |
int[][] |
getComponentsPointsAsIntArray()
Compute and return a 2D array of integer representing points of each component of the
current mask.
|
java.util.List<java.awt.Point> |
getConnectedContourPoints()
Returns a list of Point representing the contour points of the mask in connected order.
|
double |
getContourLength()
Computes and returns the length of the contour.
|
java.awt.Point[] |
getContourPoints()
Returns an array of
Point containing the contour points of the mask. |
static java.util.List<java.awt.Point> |
getContourPoints(java.awt.Rectangle bounds,
boolean[] mask)
Return a list of Point representing the contour points of the mask.
|
int[] |
getContourPointsAsIntArray()
Returns an array of integer containing the contour points of the mask.
|
static byte[] |
getDownscaleValues(BooleanMask2D mask)
Fast 2x down scaling (each 2x2 block points become 1 point value).
|
java.awt.Point[] |
getEdgePoints()
Deprecated.
Use
getContourPoints() instead. |
BooleanMask2D |
getExclusiveUnion(BooleanMask2D booleanMask)
Compute exclusive union operation with specified mask and return result in a new mask.
|
static BooleanMask2D |
getExclusiveUnion(BooleanMask2D mask1,
BooleanMask2D mask2)
Build resulting mask from exclusive union of the mask1 and mask2.
|
static BooleanMask2D |
getExclusiveUnion(java.util.List<BooleanMask2D> masks)
Build global boolean mask from exclusive union of all specified mask
|
BooleanMask2D |
getExclusiveUnion(java.awt.Rectangle bounds,
boolean[] mask)
Compute exclusive union operation with specified mask and return result in a new mask
|
static BooleanMask2D |
getExclusiveUnion(java.awt.Rectangle bounds1,
boolean[] mask1,
java.awt.Rectangle bounds2,
boolean[] mask2)
Build resulting mask from exclusive union of the mask1 and mask2:
mask1 xor mask2 = result
################ ################
############## ############## ## ##
############ ############ #### ####
########## ########## ###### ######
######## ######## ################
###### ###### ###### ######
#### #### #### ####
## ## ## ##
|
static BooleanMask2D |
getExclusiveUnionBooleanMask(java.util.ArrayList<ROI2D> rois)
Deprecated.
Use
ROIUtil.getExclusiveUnion(List) instead. |
static BooleanMask2D |
getExclusiveUnionBooleanMask(BooleanMask2D mask1,
BooleanMask2D mask2)
Deprecated.
Use
getExclusiveUnion(BooleanMask2D, BooleanMask2D) instead. |
static BooleanMask2D |
getExclusiveUnionBooleanMask(java.util.List<BooleanMask2D> masks)
Deprecated.
Use
getExclusiveUnion(List) instead. |
static BooleanMask2D |
getExclusiveUnionBooleanMask(java.awt.Rectangle bounds1,
boolean[] mask1,
java.awt.Rectangle bounds2,
boolean[] mask2)
Deprecated.
|
static BooleanMask2D |
getExclusiveUnionBooleanMask(ROI2D[] rois)
Deprecated.
Use
ROIUtil.getExclusiveUnion(List) instead. |
BooleanMask2D |
getIntersect(BooleanMask2D booleanMask)
Deprecated.
Use
getIntersection(BooleanMask2D) instead. |
BooleanMask2D |
getIntersect(java.awt.Rectangle bounds,
boolean[] mask)
Deprecated.
Use
getIntersection(Rectangle, boolean[]) instead. |
static BooleanMask2D |
getIntersectBooleanMask(java.util.ArrayList<ROI2D> rois)
Deprecated.
Use
ROIUtil.getIntersection(List) instead. |
static BooleanMask2D |
getIntersectBooleanMask(BooleanMask2D mask1,
BooleanMask2D mask2)
Deprecated.
|
static BooleanMask2D |
getIntersectBooleanMask(java.awt.Rectangle bounds1,
boolean[] mask1,
java.awt.Rectangle bounds2,
boolean[] mask2)
Deprecated.
|
static BooleanMask2D |
getIntersectBooleanMask(ROI2D[] rois)
Deprecated.
Use
ROIUtil.getIntersection(List) instead. |
BooleanMask2D |
getIntersection(BooleanMask2D booleanMask)
Compute intersection with specified mask and return result in a new mask.
|
static BooleanMask2D |
getIntersection(BooleanMask2D mask1,
BooleanMask2D mask2)
Build resulting mask from intersection of the mask1 and mask2.
|
static BooleanMask2D |
getIntersection(java.util.List<BooleanMask2D> masks)
Build global boolean mask from intersection of all specified mask
|
BooleanMask2D |
getIntersection(java.awt.Rectangle bounds,
boolean[] mask)
Compute intersection with specified mask and return result in a new mask.
|
static BooleanMask2D |
getIntersection(java.awt.Rectangle bounds1,
boolean[] mask1,
java.awt.Rectangle bounds2,
boolean[] mask2)
Build resulting mask from intersection of the mask1 and mask2:
mask1 intersect mask2 = result
################ ################ ################
############## ############## ############
############ ############ ########
########## ########## ####
######## ########
###### ######
#### ####
## ##
|
static BooleanMask2D |
getIntersectionBooleanMask(BooleanMask2D mask1,
BooleanMask2D mask2)
Deprecated.
Use
getIntersection(BooleanMask2D, BooleanMask2D) instead. |
static BooleanMask2D |
getIntersectionBooleanMask(java.util.List<BooleanMask2D> masks)
Deprecated.
Use
getIntersection(List) instead. |
static BooleanMask2D |
getIntersectionBooleanMask(java.awt.Rectangle bounds1,
boolean[] mask1,
java.awt.Rectangle bounds2,
boolean[] mask2)
Deprecated.
|
int |
getNumberOfPoints()
Return the number of points contained in this boolean mask.
|
java.awt.Rectangle |
getOptimizedBounds()
Get the smallest bounds which fit mask content.
|
java.awt.Point[] |
getPoints()
Return an array of
Point representing all points of the current mask. |
int[] |
getPointsAsIntArray()
Return an array of integer representing all points of the current mask.
|
BooleanMask2D |
getSubtraction(BooleanMask2D mask)
Subtract the specified mask from current and return result in a new mask.
|
static BooleanMask2D |
getSubtraction(BooleanMask2D mask1,
BooleanMask2D mask2)
Build resulting mask from the subtraction of mask2 from mask1.
|
BooleanMask2D |
getSubtraction(java.awt.Rectangle bounds,
boolean[] mask)
Subtract the specified mask from current and return result in a new mask.
|
static BooleanMask2D |
getSubtraction(java.awt.Rectangle bounds1,
boolean[] mask1,
java.awt.Rectangle bounds2,
boolean[] mask2)
Build resulting mask from the subtraction of mask2 from mask1:
mask1 - mask2 = result
################ ################
############## ############## ##
############ ############ ####
########## ########## ######
######## ######## ########
###### ###### ######
#### #### ####
## ## ##
|
BooleanMask2D |
getUnion(BooleanMask2D booleanMask)
Compute union with specified mask and return result in a new mask.
|
static BooleanMask2D |
getUnion(BooleanMask2D mask1,
BooleanMask2D mask2)
Build resulting mask from union of the mask1 and mask2.
|
static BooleanMask2D |
getUnion(java.util.List<BooleanMask2D> masks)
Build global boolean mask from union of all specified mask
|
BooleanMask2D |
getUnion(java.awt.Rectangle bounds,
boolean[] mask)
Compute union with specified mask and return result in a new mask.
|
static BooleanMask2D |
getUnion(java.awt.Rectangle bounds1,
boolean[] mask1,
java.awt.Rectangle bounds2,
boolean[] mask2)
Build resulting mask from union of the mask1 and mask2:
mask1 + mask2 = result
################ ################ ################
############## ############## ################
############ ############ ################
########## ########## ################
######## ######## ################
###### ###### ###### ######
#### #### #### ####
## ## ## ##
|
static BooleanMask2D |
getUnionBooleanMask(java.util.ArrayList<ROI2D> rois)
Deprecated.
Use
ROIUtil.getUnion(List) instead. |
static BooleanMask2D |
getUnionBooleanMask(BooleanMask2D mask1,
BooleanMask2D mask2)
Deprecated.
Use
getUnion(BooleanMask2D, BooleanMask2D) instead. |
static BooleanMask2D |
getUnionBooleanMask(java.util.List<BooleanMask2D> masks)
Deprecated.
Use
getUnion(List) instead. |
static BooleanMask2D |
getUnionBooleanMask(java.awt.Rectangle bounds1,
boolean[] mask1,
java.awt.Rectangle bounds2,
boolean[] mask2)
Deprecated.
Use
getUnion(Rectangle, boolean[], Rectangle, boolean[]) instead. |
static BooleanMask2D |
getUnionBooleanMask(ROI2D[] rois)
Deprecated.
Use
ROIUtil.getUnion(List) instead. |
BooleanMask2D |
getXor(BooleanMask2D booleanMask)
Deprecated.
Use
getExclusiveUnion(BooleanMask2D) instead. |
BooleanMask2D |
getXor(java.awt.Rectangle bounds,
boolean[] mask)
Deprecated.
Use
getExclusiveUnion(Rectangle, boolean[]) instead. |
static BooleanMask2D |
getXorBooleanMask(java.util.ArrayList<ROI2D> rois)
Deprecated.
Use
getExclusiveUnionBooleanMask(List) instead. |
static BooleanMask2D |
getXorBooleanMask(BooleanMask2D mask1,
BooleanMask2D mask2)
Deprecated.
|
static BooleanMask2D |
getXorBooleanMask(java.awt.Rectangle bounds1,
boolean[] mask1,
java.awt.Rectangle bounds2,
boolean[] mask2)
Deprecated.
|
static BooleanMask2D |
getXorBooleanMask(ROI2D[] rois)
Deprecated.
Use
getExclusiveUnionBooleanMask(ROI2D[]) instead. |
void |
intersect(BooleanMask2D booleanMask)
Set the content of current mask with the result of the intersection with the specified mask:
current mask intersect newMask = result
################ ################ ################
############## ############## ############
############ ############ ########
########## ########## ####
######## ########
###### ######
#### ####
## ##
|
void |
intersect(java.awt.Rectangle boundsToIntersect,
boolean[] maskToIntersect)
Set the content of current mask with the result of the intersection with the specified mask:
current mask intersect newMask = result
################ ################ ################
############## ############## ############
############ ############ ########
########## ########## ####
######## ########
###### ######
#### ####
## ##
|
boolean |
intersects(BooleanMask2D booleanMask)
Return true if mask intersects (contains at least one point) the specified 2D mask.
|
boolean |
intersects(java.awt.Rectangle rect,
boolean[] bmask)
Return true if mask intersects (contains at least one point) the specified 2D mask region.
|
boolean |
isEmpty()
Return true if boolean mask is empty
|
void |
moveBounds(java.awt.Rectangle value)
Change the bounds of BooleanMask.
|
void |
optimizeBounds()
Optimize mask bounds so it fit mask content.
|
void |
setBounds(java.awt.Rectangle value)
Deprecated.
Use
moveBounds(Rectangle) instead. |
void |
subtract(java.awt.Rectangle boundsToSubtract,
boolean[] maskToSubtract)
Subtract the specified mask from the current mask (bounds can change):
current mask - mask = result
################ ################
############## ############## ##
############ ############ ####
########## ########## ######
######## ######## ########
###### ###### ######
#### #### ####
## ## ##
|
void |
union(BooleanMask2D booleanMask)
Deprecated.
Use
add(BooleanMask2D) instead. |
void |
union(java.awt.Rectangle bounds,
boolean[] mask)
Deprecated.
Use
add(BooleanMask2D) instead. |
BooleanMask2D |
upscale()
Fast 2x up scaling (each point become 2x2 bloc point).
|
static BooleanMask2D |
upscale(BooleanMask2D mask)
Fast 2x up scaling (each point become 2x2 bloc points).
|
void |
xor(BooleanMask2D booleanMask)
Deprecated.
Use
exclusiveUnion(BooleanMask2D) instead |
void |
xor(java.awt.Rectangle bounds,
boolean[] mask)
Deprecated.
Use
exclusiveUnion(Rectangle, boolean[]) instead |
public java.awt.Rectangle bounds
public boolean[] mask
public BooleanMask2D()
public BooleanMask2D(java.awt.Rectangle bounds, boolean[] mask)
bounds
- mask
- public BooleanMask2D(java.awt.Point[] points)
Point
.public BooleanMask2D(int[] points)
result.length
= number of point * 2result[(pt * 2) + 0]
= X coordinate for point pt.result[(pt * 2) + 1]
= Y coordinate for point pt.public static java.util.List<java.awt.Point> getContourPoints(java.awt.Rectangle bounds, boolean[] mask)
1234 5 6 7 8 9
public static BooleanMask2D upscale(BooleanMask2D mask)
public static byte[] getDownscaleValues(BooleanMask2D mask)
true
point for each 2x2 block.mask
- the boolean mask to downloadpublic static BooleanMask2D downscale(BooleanMask2D mask, int nbPointForTrue)
mask
- the boolean mask to downloadnbPointForTrue
- the minimum number of true
points from a 2x2 block to give a true
resulting
point.public static BooleanMask2D downscale(BooleanMask2D mask)
public static BooleanMask2D getUnion(java.util.List<BooleanMask2D> masks)
public static BooleanMask2D getUnion(BooleanMask2D mask1, BooleanMask2D mask2)
mask1
is null
then a copy of mask2
is returned.mask2
is null
then a copy of mask1
is returned.mask1
and mask2
are null
.public static BooleanMask2D getUnion(java.awt.Rectangle bounds1, boolean[] mask1, java.awt.Rectangle bounds2, boolean[] mask2)
mask1 + mask2 = result ################ ################ ################ ############## ############## ################ ############ ############ ################ ########## ########## ################ ######## ######## ################ ###### ###### ###### ###### #### #### #### #### ## ## ## ##
public static BooleanMask2D getIntersection(java.util.List<BooleanMask2D> masks)
public static BooleanMask2D getIntersection(BooleanMask2D mask1, BooleanMask2D mask2)
mask1
or mask2
is null
.public static BooleanMask2D getIntersection(java.awt.Rectangle bounds1, boolean[] mask1, java.awt.Rectangle bounds2, boolean[] mask2)
mask1 intersect mask2 = result ################ ################ ################ ############## ############## ############ ############ ############ ######## ########## ########## #### ######## ######## ###### ###### #### #### ## ##
public static BooleanMask2D getExclusiveUnion(java.util.List<BooleanMask2D> masks)
public static BooleanMask2D getExclusiveUnion(BooleanMask2D mask1, BooleanMask2D mask2)
mask1
is null
then a copy of mask2
is returned.mask2
is null
then a copy of mask1
is returned.null
is returned if both mask1
and mask2
are null
.public static BooleanMask2D getExclusiveUnion(java.awt.Rectangle bounds1, boolean[] mask1, java.awt.Rectangle bounds2, boolean[] mask2)
mask1 xor mask2 = result ################ ################ ############## ############## ## ## ############ ############ #### #### ########## ########## ###### ###### ######## ######## ################ ###### ###### ###### ###### #### #### #### #### ## ## ## ##
public static BooleanMask2D getSubtraction(BooleanMask2D mask1, BooleanMask2D mask2)
mask2
is null
then a copy of mask1
is returned.mask1
is null
then a empty mask is returned.public static BooleanMask2D getSubtraction(java.awt.Rectangle bounds1, boolean[] mask1, java.awt.Rectangle bounds2, boolean[] mask2)
mask1 - mask2 = result ################ ################ ############## ############## ## ############ ############ #### ########## ########## ###### ######## ######## ######## ###### ###### ###### #### #### #### ## ## ##
@Deprecated public static BooleanMask2D getUnionBooleanMask(java.util.List<BooleanMask2D> masks)
getUnion(List)
instead.@Deprecated public static BooleanMask2D getUnionBooleanMask(ROI2D[] rois)
ROIUtil.getUnion(List)
instead.@Deprecated public static BooleanMask2D getUnionBooleanMask(java.util.ArrayList<ROI2D> rois)
ROIUtil.getUnion(List)
instead.@Deprecated public static BooleanMask2D getUnionBooleanMask(BooleanMask2D mask1, BooleanMask2D mask2)
getUnion(BooleanMask2D, BooleanMask2D)
instead.@Deprecated public static BooleanMask2D getUnionBooleanMask(java.awt.Rectangle bounds1, boolean[] mask1, java.awt.Rectangle bounds2, boolean[] mask2)
getUnion(Rectangle, boolean[], Rectangle, boolean[])
instead.@Deprecated public static BooleanMask2D getIntersectionBooleanMask(java.util.List<BooleanMask2D> masks)
getIntersection(List)
instead.@Deprecated public static BooleanMask2D getIntersectionBooleanMask(BooleanMask2D mask1, BooleanMask2D mask2)
getIntersection(BooleanMask2D, BooleanMask2D)
instead.@Deprecated public static BooleanMask2D getIntersectionBooleanMask(java.awt.Rectangle bounds1, boolean[] mask1, java.awt.Rectangle bounds2, boolean[] mask2)
getIntersection(Rectangle, boolean[], Rectangle, boolean[])
instead.@Deprecated public static BooleanMask2D getIntersectBooleanMask(ROI2D[] rois)
ROIUtil.getIntersection(List)
instead.@Deprecated public static BooleanMask2D getIntersectBooleanMask(java.util.ArrayList<ROI2D> rois)
ROIUtil.getIntersection(List)
instead.@Deprecated public static BooleanMask2D getIntersectBooleanMask(BooleanMask2D mask1, BooleanMask2D mask2)
getIntersectionBooleanMask(BooleanMask2D, BooleanMask2D)
instead.@Deprecated public static BooleanMask2D getIntersectBooleanMask(java.awt.Rectangle bounds1, boolean[] mask1, java.awt.Rectangle bounds2, boolean[] mask2)
getIntersectionBooleanMask(Rectangle, boolean[], Rectangle, boolean[])
instead.@Deprecated public static BooleanMask2D getExclusiveUnionBooleanMask(java.util.List<BooleanMask2D> masks)
getExclusiveUnion(List)
instead.@Deprecated public static BooleanMask2D getExclusiveUnionBooleanMask(ROI2D[] rois)
ROIUtil.getExclusiveUnion(List)
instead.@Deprecated public static BooleanMask2D getExclusiveUnionBooleanMask(java.util.ArrayList<ROI2D> rois)
ROIUtil.getExclusiveUnion(List)
instead.@Deprecated public static BooleanMask2D getExclusiveUnionBooleanMask(BooleanMask2D mask1, BooleanMask2D mask2)
getExclusiveUnion(BooleanMask2D, BooleanMask2D)
instead.@Deprecated public static BooleanMask2D getExclusiveUnionBooleanMask(java.awt.Rectangle bounds1, boolean[] mask1, java.awt.Rectangle bounds2, boolean[] mask2)
getExclusiveUnion(Rectangle, boolean[], Rectangle, boolean[])
instead.@Deprecated public static BooleanMask2D getXorBooleanMask(ROI2D[] rois)
getExclusiveUnionBooleanMask(ROI2D[])
instead.@Deprecated public static BooleanMask2D getXorBooleanMask(java.util.ArrayList<ROI2D> rois)
getExclusiveUnionBooleanMask(List)
instead.@Deprecated public static BooleanMask2D getXorBooleanMask(BooleanMask2D mask1, BooleanMask2D mask2)
getExclusiveUnionBooleanMask(BooleanMask2D, BooleanMask2D)
instead.@Deprecated public static BooleanMask2D getXorBooleanMask(java.awt.Rectangle bounds1, boolean[] mask1, java.awt.Rectangle bounds2, boolean[] mask2)
getExclusiveUnionBooleanMask(Rectangle, boolean[], Rectangle, boolean[])
instead.public boolean isEmpty()
public boolean contains(int x, int y)
public boolean contains(BooleanMask2D booleanMask)
public boolean contains(java.awt.Rectangle rect, boolean[] bmask)
public boolean intersects(BooleanMask2D booleanMask)
public boolean intersects(java.awt.Rectangle rect, boolean[] bmask)
public int getNumberOfPoints()
public java.awt.Point[] getPoints()
Point
representing all points of the current mask.Ymin 12 3456 78 Ymax 9
getPointsAsIntArray()
public int[] getPointsAsIntArray()
result.length
= number of point * 2result[(pt * 2) + 0]
= X coordinate for point pt.result[(pt * 2) + 1]
= Y coordinate for point pt.Ymin 12 3456 78 Ymax 9
public java.awt.Point[][] getComponentsPoints(boolean sorted)
Point
representing points of each component of the
current mask.result.lenght
= number of component.result[c].length
= number of point of component c.result[c][n]
= Point n of component c.sorted
- When true points are returned in ascending XY order :
Ymin 12 3456 78 Ymax 9
getComponentsPointsAsIntArray()
public int[][] getComponentsPointsAsIntArray()
result.lenght
= number of component.result[c].length
= number of point * 2 for component c.result[c][(pt * 2) + 0]
= X coordinate for point pt of component
c.result[c][(pt * 2) + 1]
= Y coordinate for point pt of component
c.getComponentsPoints(boolean)
public BooleanMask2D[] getComponents()
public java.util.List<java.awt.Point> getConnectedContourPoints()
getContourPoints()
public java.awt.Point[] getContourPoints()
Point
containing the contour points of the mask.123 4 5 6 7 89
getContourPointsAsIntArray()
public int[] getContourPointsAsIntArray()
result.length
= number of point * 2result[(pt * 2) + 0]
= X coordinate for point pt.result[(pt * 2) + 1]
= Y coordinate for point pt.123 4 5 6 7 89
getConnectedContourPoints()
@Deprecated public java.awt.Point[] getEdgePoints()
getContourPoints()
instead.public double getContourLength()
public BooleanMask2D getIntersection(BooleanMask2D booleanMask)
intersect(BooleanMask2D)
public BooleanMask2D getIntersection(java.awt.Rectangle bounds, boolean[] mask)
intersect(Rectangle, boolean[])
@Deprecated public BooleanMask2D getIntersect(BooleanMask2D booleanMask)
getIntersection(BooleanMask2D)
instead.@Deprecated public BooleanMask2D getIntersect(java.awt.Rectangle bounds, boolean[] mask)
getIntersection(Rectangle, boolean[])
instead.public BooleanMask2D getUnion(BooleanMask2D booleanMask)
add(BooleanMask2D)
public BooleanMask2D getUnion(java.awt.Rectangle bounds, boolean[] mask)
add(Rectangle, boolean[])
public BooleanMask2D getExclusiveUnion(BooleanMask2D booleanMask)
exclusiveAdd(BooleanMask2D)
public BooleanMask2D getExclusiveUnion(java.awt.Rectangle bounds, boolean[] mask)
exclusiveAdd(Rectangle, boolean[])
public BooleanMask2D getSubtraction(BooleanMask2D mask)
public BooleanMask2D getSubtraction(java.awt.Rectangle bounds, boolean[] mask)
@Deprecated public BooleanMask2D getXor(BooleanMask2D booleanMask)
getExclusiveUnion(BooleanMask2D)
instead.@Deprecated public BooleanMask2D getXor(java.awt.Rectangle bounds, boolean[] mask)
getExclusiveUnion(Rectangle, boolean[])
instead.public void add(BooleanMask2D booleanMask)
current mask + mask = result ################ ################ ################ ############## ############## ################ ############ ############ ################ ########## ########## ################ ######## ######## ################ ###### ###### ###### ###### #### #### #### #### ## ## ## ##
public void add(java.awt.Rectangle boundsToAdd, boolean[] maskToAdd)
current mask + mask = result ################ ################ ################ ############## ############## ################ ############ ############ ################ ########## ########## ################ ######## ######## ################ ###### ###### ###### ###### #### #### #### #### ## ## ## ##
public void intersect(BooleanMask2D booleanMask)
current mask intersect newMask = result ################ ################ ################ ############## ############## ############ ############ ############ ######## ########## ########## #### ######## ######## ###### ###### #### #### ## ##
public void intersect(java.awt.Rectangle boundsToIntersect, boolean[] maskToIntersect)
current mask intersect newMask = result ################ ################ ################ ############## ############## ############ ############ ############ ######## ########## ########## #### ######## ######## ###### ###### #### #### ## ##
public void exclusiveAdd(BooleanMask2D booleanMask)
mask1 xor mask2 = result ################ ################ ############## ############## ## ## ############ ############ #### #### ########## ########## ###### ###### ######## ######## ################ ###### ###### ###### ###### #### #### #### #### ## ## ## ##
public void exclusiveAdd(java.awt.Rectangle boundsToXAdd, boolean[] maskToXAdd)
mask1 xor mask2 = result ################ ################ ############## ############## ## ## ############ ############ #### #### ########## ########## ###### ###### ######## ######## ################ ###### ###### ###### ###### #### #### #### #### ## ## ## ##
public void subtract(java.awt.Rectangle boundsToSubtract, boolean[] maskToSubtract)
current mask - mask = result ################ ################ ############## ############## ## ############ ############ #### ########## ########## ###### ######## ######## ######## ###### ###### ###### #### #### #### ## ## ##
@Deprecated public void union(BooleanMask2D booleanMask)
add(BooleanMask2D)
instead.@Deprecated public void union(java.awt.Rectangle bounds, boolean[] mask)
add(BooleanMask2D)
instead.@Deprecated public void exclusiveUnion(BooleanMask2D booleanMask)
getExclusiveUnion(BooleanMask2D)
instead.@Deprecated public void exclusiveUnion(java.awt.Rectangle bounds, boolean[] mask)
getExclusiveUnion(Rectangle, boolean[])
instead.@Deprecated public void xor(BooleanMask2D booleanMask)
exclusiveUnion(BooleanMask2D)
instead@Deprecated public void xor(java.awt.Rectangle bounds, boolean[] mask)
exclusiveUnion(Rectangle, boolean[])
insteadpublic java.awt.Rectangle getOptimizedBounds()
public void optimizeBounds()
@Deprecated public void setBounds(java.awt.Rectangle value)
moveBounds(Rectangle)
instead.public void moveBounds(java.awt.Rectangle value)
public BooleanMask2D upscale()
public BooleanMask2D downscale(int nbPointForTrue)
nbPointForTrue
- the minimum number of true
points from a 2x2 block to give a true
resulting
point.public BooleanMask2D downscale()
public java.lang.Object clone()
clone
in class java.lang.Object