Packages

 

com.aspose.psd.fileformats.psd.layers

Class LayerMaskData

  • Direct Known Subclasses:
    LayerMaskDataFull, LayerMaskDataShort


    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.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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.
    • Method Detail

      • getDataSize

        public final int getDataSize()

        Gets the size of the layer mask mask data.

        Value: The size of the layer mask mask data.
      • getTop

        public final int getTop()

        Gets or sets the top layer mask position.

        Value: The top layer mask position.
      • setTop

        public final void setTop(int value)

        Gets or sets the top layer mask position.

        Value: The top layer mask position.
      • getLeft

        public final int getLeft()

        Gets or sets the left layer mask position.

        Value: The left layer mask position.
      • setLeft

        public final void setLeft(int value)

        Gets or sets the left layer mask position.

        Value: The left layer mask position.
      • getBottom

        public final int getBottom()

        Gets or sets the bottom layer mask position.

        Value: The bottom layer mask position.
      • setBottom

        public final void setBottom(int value)

        Gets or sets the bottom layer mask position.

        Value: The bottom layer mask position.
      • getRight

        public final int getRight()

        Gets or sets the right layer mask position.

        Value: The right layer mask position.
      • setRight

        public final void setRight(int value)

        Gets or sets the right layer mask position.

        Value: The right layer mask position.
      • getDefaultColor

        public final byte getDefaultColor()

        Gets or sets the default color.

        Value: The default color.
      • setDefaultColor

        public final void setDefaultColor(byte value)

        Gets or sets the default color.

        Value: The default color.
      • getFlags

        public final byte getFlags()

        Gets or sets the layer mask flags.

        Value: The layer mask flags.
      • setFlags

        public final void setFlags(byte value)

        Gets or sets the layer mask flags.

        Value: The layer mask flags.
      • getImageData

        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.
      • setImageData

        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.
      • getMaskRectangle

        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

        Value: The mask rectangle.
      • setMaskRectangle

        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

        Value: The mask rectangle.