ImageBitMask
Inheritance: java.lang.Object, com.aspose.imaging.magicwand.imagemasks.ImageMask
public class ImageBitMask extends ImageMask
Describes a binary image mask.
Constructors
| Constructor | Description | 
|---|---|
| ImageBitMask(int width, int height) | Initializes a new instance of the ImageBitMask class with the specified width and height. | 
| ImageBitMask(RasterImage image) | Initializes a new instance of the ImageBitMask class with the size of the specified existing RasterImage. | 
Methods
| Method | Description | 
|---|---|
| getSelectionBounds() | Gets the bounds of the selected part of the mask, in pixels. | 
| get_Item(int x, int y) | Gets the opacity of the specified pixel. | 
| inflate(int size) | Inflates this mask by the specified amount. | 
| crop(Rectangle rectangle) | Crops mask with the specified rectangle. | 
| deepClone() | Creates a new object that is a copy of the current instance. | 
| setMaskPixel(int x, int y, boolean value) | Sets the opacity to the specified pixel. | 
| op_LogicalNot(ImageBitMask a) | Inverts mask. | 
| op_Addition(ImageBitMask a, ImageBitMask b) | Union of two masks. | 
| op_Subtraction(ImageBitMask a, ImageBitMask b) | Subtract second mask from first. | 
| op_Multiply(ImageBitMask a, ImageBitMask b) | Intersection of two masks. | 
| op_ExclusiveOr(ImageBitMask a, ImageBitMask b) | Exclusive disjunction of two masks. | 
ImageBitMask(int width, int height)
public ImageBitMask(int width, int height)
Initializes a new instance of the ImageBitMask class with the specified width and height.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| width | int | Width of the mask. | 
| height | int | Height of the mask. | 
ImageBitMask(RasterImage image)
public ImageBitMask(RasterImage image)
Initializes a new instance of the ImageBitMask class with the size of the specified existing RasterImage. Specified RasterImage will be stored as source image.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| image | RasterImage | Source image. | 
getSelectionBounds()
public Rectangle getSelectionBounds()
Gets the bounds of the selected part of the mask, in pixels.
Returns: Rectangle - the bounds of the selected part of the mask, in pixels.
get_Item(int x, int y)
public boolean get_Item(int x, int y)
Gets the opacity of the specified pixel.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| x | int | The x-coordinate of the pixel. | 
| y | int | The y-coordinate of the pixel. Value: true if the specified pixel is opaque; otherwise, false. | 
Returns: boolean
inflate(int size)
public ImageMask inflate(int size)
Inflates this mask by the specified amount.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| size | int | The amount to inflate this mask. | 
Returns: ImageMask - An inflated ImageBitMask as ImageMask.
crop(Rectangle rectangle)
public ImageMask crop(Rectangle rectangle)
Crops mask with the specified rectangle.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| rectangle | Rectangle | The specified rectangle. | 
Returns: ImageMask - A cropped ImageBitMask as ImageMask.
deepClone()
public Object deepClone()
Creates a new object that is a copy of the current instance.
Returns: java.lang.Object - A new object that is a copy of this instance.
setMaskPixel(int x, int y, boolean value)
public final void setMaskPixel(int x, int y, boolean value)
Sets the opacity to the specified pixel.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| x | int | The x-coordinate of the pixel. | 
| y | int | The y-coordinate of the pixel. | 
| value | boolean | true if the specified pixel is opaque; otherwise, false. | 
op_LogicalNot(ImageBitMask a)
public static ImageBitMask op_LogicalNot(ImageBitMask a)
Inverts mask.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| a | ImageBitMask | The mask to be inverted. | 
Returns: ImageBitMask - New ImageBitMask.
op_Addition(ImageBitMask a, ImageBitMask b)
public static ImageBitMask op_Addition(ImageBitMask a, ImageBitMask b)
Union of two masks.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| a | ImageBitMask | The first mask. | 
| b | ImageBitMask | The second mask. | 
Returns: ImageBitMask - New ImageBitMask.
op_Subtraction(ImageBitMask a, ImageBitMask b)
public static ImageBitMask op_Subtraction(ImageBitMask a, ImageBitMask b)
Subtract second mask from first.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| a | ImageBitMask | The first mask. | 
| b | ImageBitMask | The second mask. | 
Returns: ImageBitMask - New ImageBitMask.
op_Multiply(ImageBitMask a, ImageBitMask b)
public static ImageBitMask op_Multiply(ImageBitMask a, ImageBitMask b)
Intersection of two masks.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| a | ImageBitMask | The first mask. | 
| b | ImageBitMask | The second mask. | 
Returns: ImageBitMask - New ImageBitMask.
op_ExclusiveOr(ImageBitMask a, ImageBitMask b)
public static ImageBitMask op_ExclusiveOr(ImageBitMask a, ImageBitMask b)
Exclusive disjunction of two masks.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| a | ImageBitMask | The first mask. | 
| b | ImageBitMask | The second mask. | 
Returns: ImageBitMask - New ImageBitMask.