public abstract class LayerMaskData extends Object
Defines base LayerMaskData class which contains information about the layer mask data in the PSD file.
It can help to modify Adobe� Photoshop� files programmatically and automate PSD format editing.
If the layer has only a raster mask the ImageData contains the raster mask data bytes.
If the layer has only a vector mask the ImageData contains the vector mask rasterized (cached) data bytes.
If the layer has both layer and vector masks the ImageData contains the raster mask and the rasterized vector mask combined.
The ImageData
(LayerMaskData.getImageData()
/LayerMaskData.setImageData(byte[])
)
bytes length should be equal Width * Height of MaskRectangle
(LayerMaskData.getMaskRectangle()
/LayerMaskData.setMaskRectangle(Rectangle)
) properties.
Notice, that just removing / adding / updating the LayerMaskData is not enough for correct saving
because channels are not updated; though it may provide correct rendering.
The Layer.addLayerMask(LayerMaskData)
method should be used for that.
Modifier and Type | Method and Description |
---|---|
int |
getBottom()
Gets or sets the bottom layer mask position.
|
int |
getDataSize()
Gets the size of the layer mask mask data.
|
byte |
getDefaultColor()
Gets or sets the default color.
|
byte |
getFlags()
Gets or sets the layer mask flags.
|
byte[] |
getImageData()
Gets or sets the layer mask data (or combined / final mask if there is a vector mask) in the PSD file.
|
int |
getLeft()
Gets or sets the left layer mask position.
|
Rectangle |
getMaskRectangle()
Gets or sets the mask
Rectangle of the layer mask in the PSD file. |
int |
getRight()
Gets or sets the right layer mask position.
|
int |
getTop()
Gets or sets the top layer mask position.
|
void |
setBottom(int value)
Gets or sets the bottom layer mask position.
|
void |
setDefaultColor(byte value)
Gets or sets the default color.
|
void |
setFlags(byte value)
Gets or sets the layer mask flags.
|
void |
setImageData(byte[] value)
Gets or sets the layer mask data (or combined / final mask if there is a vector mask) in the PSD file.
|
void |
setLeft(int value)
Gets or sets the left layer mask position.
|
void |
setMaskRectangle(Rectangle value)
Gets or sets the mask
Rectangle of the layer mask in the PSD file. |
void |
setRight(int value)
Gets or sets the right layer mask position.
|
void |
setTop(int value)
Gets or sets the top layer mask position.
|
public final int getDataSize()
Gets the size of the layer mask mask data.
Value: The size of the layer mask mask data.public final int getTop()
Gets or sets the top layer mask position.
Value: The top layer mask position.public final void setTop(int value)
Gets or sets the top layer mask position.
Value: The top layer mask position.public final int getLeft()
Gets or sets the left layer mask position.
Value: The left layer mask position.public final void setLeft(int value)
Gets or sets the left layer mask position.
Value: The left layer mask position.public final int getBottom()
Gets or sets the bottom layer mask position.
Value: The bottom layer mask position.public final void setBottom(int value)
Gets or sets the bottom layer mask position.
Value: The bottom layer mask position.public final int getRight()
Gets or sets the right layer mask position.
Value: The right layer mask position.public final void setRight(int value)
Gets or sets the right layer mask position.
Value: The right layer mask position.public final byte getDefaultColor()
Gets or sets the default color.
Value: The default color.public final void setDefaultColor(byte value)
Gets or sets the default color.
Value: The default color.public final byte getFlags()
Gets or sets the layer mask flags.
Value: The layer mask flags.public final void setFlags(byte value)
Gets or sets the layer mask flags.
Value: The layer mask flags.public final byte[] getImageData()
Gets or sets the layer mask data (or combined / final mask if there is a vector mask) in the PSD file.
Value: The image data.public final void setImageData(byte[] value)
Gets or sets the layer mask data (or combined / final mask if there is a vector mask) in the PSD file.
Value: The image data.public final Rectangle getMaskRectangle()
Gets or sets the mask Rectangle
of the layer mask in the PSD file.
It takes left, right, top and bottom properties and creates Rectangle
public final void setMaskRectangle(Rectangle value)
Gets or sets the mask Rectangle
of the layer mask in the PSD file.
It takes left, right, top and bottom properties and creates Rectangle