Packages

 

com.aspose.imaging

Interfaces

Classes

Exceptions

com.aspose.imaging

Class ImageAttributes



  • public final class ImageAttributes
    extends Object

    An com.aspose.imaging.ImageAttributes object contains information about how bitmap and metafile colors are manipulated during rendering. An com.aspose.imaging.ImageAttributes object maintains several color-adjustment settings, including color-adjustment matrices, grayscale-adjustment matrices, gamma-correction values, color-map tables, and color-threshold values. During rendering, colors can be corrected, darkened, lightened, and removed. To apply such manipulations, initialize an com.aspose.imaging.ImageAttributes object and pass the path of that com.aspose.imaging.ImageAttributes object (along with the path of an Aspose.Imaging.Image) to the DrawImage method.

    • Constructor Summary

      Constructors 
      Constructor and Description
      ImageAttributes()
      Initializes a new instance of the com.aspose.imaging.ImageAttributes class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void clearBrushRemapTable()
      Clears the brush color-remap table of this com.aspose.imaging.ImageAttributes object.
      void clearColorKey()
      Clears the color key (transparency range) for the default category.
      void clearColorKey(int type)
      Clears the color key (transparency range) for a specified category.
      void clearColorMatrix()
      Clears the color-adjustment matrix for the default category.
      void clearColorMatrix(int type)
      Clears the color-adjustment matrix for a specified category.
      void clearGamma()
      Disables gamma correction for the default category.
      void clearGamma(int type)
      Disables gamma correction for a specified category.
      void clearNoOp()
      Clears the NoOp setting for the default category.
      void clearNoOp(int type)
      Clears the NoOp setting for a specified category.
      void clearOutputChannel()
      Clears the CMYK (cyan-magenta-yellow-black) output channel setting for the default category.
      void clearOutputChannel(int type)
      Clears the (cyan-magenta-yellow-black) output channel setting for a specified category.
      void clearOutputChannelColorProfile()
      Clears the output channel color profile setting for the default category.
      void clearOutputChannelColorProfile(int type)
      Clears the output channel color profile setting for a specified category.
      void clearRemapTable()
      Clears the color-remap table for the default category.
      void clearRemapTable(int type)
      Clears the color-remap table for a specified category.
      void clearThreshold()
      Clears the threshold value for the default category.
      void clearThreshold(int type)
      Clears the threshold value for a specified category.
      void setBrushRemapTable(ColorMap[] map)
      Sets the color-remap table for the brush category.
      void setColorKey(Color colorLow, Color colorHigh)
      Sets the color key for the default category.
      void setColorKey(Color colorLow, Color colorHigh, int type)
      Sets the color key (transparency range) for a specified category.
      void setColorMatrices(ColorMatrix newColorMatrix, ColorMatrix grayMatrix)
      Sets the color-adjustment matrix and the grayscale-adjustment matrix for the default category.
      void setColorMatrices(ColorMatrix newColorMatrix, ColorMatrix grayMatrix, int flags)
      Sets the color-adjustment matrix and the grayscale-adjustment matrix for the default category.
      void setColorMatrices(ColorMatrix newColorMatrix, ColorMatrix grayMatrix, int mode, int type)
      Sets the color-adjustment matrix and the grayscale-adjustment matrix for a specified category.
      void setColorMatrix(ColorMatrix newColorMatrix)
      Sets the color-adjustment matrix for the default category.
      void setColorMatrix(ColorMatrix newColorMatrix, int flags)
      Sets the color-adjustment matrix for the default category.
      void setColorMatrix(ColorMatrix newColorMatrix, int mode, int type)
      Sets the color-adjustment matrix for a specified category.
      void setGamma(float gamma)
      Sets the gamma value for the default category.
      void setGamma(float gamma, int type)
      Sets the gamma value for a specified category.
      void setNoOp()
      Turns off color adjustment for the default category.
      void setNoOp(int type)
      Turns off color adjustment for a specified category.
      void setOutputChannel(int flags)
      Sets the CMYK (cyan-magenta-yellow-black) output channel for the default category.
      void setOutputChannel(int flags, int type)
      Sets the CMYK (cyan-magenta-yellow-black) output channel for a specified category.
      void setOutputChannelColorProfile(String colorProfileFilename)
      Sets the output channel color-profile file for the default category.
      void setOutputChannelColorProfile(String colorProfileFilename, int type)
      Sets the output channel color-profile file for a specified category.
      void setRemapTable(ColorMap[] map)
      Sets the color-remap table for the default category.
      void setRemapTable(ColorMap[] map, int type)
      Sets the color-remap table for a specified category.
      void setThreshold(float threshold)
      Sets the threshold (transparency range) for the default category.
      void setThreshold(float threshold, int type)
      Sets the threshold (transparency range) for a specified category.
      void setWrapMode(int mode)
      Sets the wrap mode that is used to decide how to tile a texture across a shape, or at shape boundaries.
      void setWrapMode(int mode, Color color)
      Sets the wrap mode and color used to decide how to tile a texture across a shape, or at shape boundaries.
      void setWrapMode(int mode, Color color, boolean clamp)
      Sets the wrap mode and color used to decide how to tile a texture across a shape, or at shape boundaries.
    • Constructor Detail

      • ImageAttributes

        public ImageAttributes()

        Initializes a new instance of the com.aspose.imaging.ImageAttributes class.

    • Method Detail

      • setColorMatrix

        public void setColorMatrix(ColorMatrix newColorMatrix)

        Sets the color-adjustment matrix for the default category.

        Parameters:
        newColorMatrix - The color-adjustment matrix.
      • setColorMatrix

        public void setColorMatrix(ColorMatrix newColorMatrix,
                                   int flags)

        Sets the color-adjustment matrix for the default category.

        Parameters:
        newColorMatrix - The color-adjustment matrix.
        flags - An element of Aspose.Imaging.ColorMatrixFlag that specifies the type of image and color that will be affected by the color-adjustment matrix.
      • setColorMatrix

        public void setColorMatrix(ColorMatrix newColorMatrix,
                                   int mode,
                                   int type)

        Sets the color-adjustment matrix for a specified category.

        Parameters:
        newColorMatrix - The color-adjustment matrix.
        mode - An element of Aspose.Imaging.ColorMatrixFlag that specifies the type of image and color that will be affected by the color-adjustment matrix.
        type - An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the color-adjustment matrix is set.
      • clearColorMatrix

        public void clearColorMatrix()

        Clears the color-adjustment matrix for the default category.

      • clearColorMatrix

        public void clearColorMatrix(int type)

        Clears the color-adjustment matrix for a specified category.

        Parameters:
        type - An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the color-adjustment matrix is cleared.
      • setColorMatrices

        public void setColorMatrices(ColorMatrix newColorMatrix,
                                     ColorMatrix grayMatrix)

        Sets the color-adjustment matrix and the grayscale-adjustment matrix for the default category.

        Parameters:
        newColorMatrix - The color-adjustment matrix.
        grayMatrix - The grayscale-adjustment matrix.
      • setColorMatrices

        public void setColorMatrices(ColorMatrix newColorMatrix,
                                     ColorMatrix grayMatrix,
                                     int flags)

        Sets the color-adjustment matrix and the grayscale-adjustment matrix for the default category.

        Parameters:
        newColorMatrix - The color-adjustment matrix.
        grayMatrix - The grayscale-adjustment matrix.
        flags - An element of Aspose.Imaging.ColorMatrixFlag that specifies the type of image and color that will be affected by the color-adjustment and grayscale-adjustment matrices.
      • setColorMatrices

        public void setColorMatrices(ColorMatrix newColorMatrix,
                                     ColorMatrix grayMatrix,
                                     int mode,
                                     int type)

        Sets the color-adjustment matrix and the grayscale-adjustment matrix for a specified category.

        Parameters:
        newColorMatrix - The color-adjustment matrix.
        grayMatrix - The grayscale-adjustment matrix.
        mode - An element of Aspose.Imaging.ColorMatrixFlag that specifies the type of image and color that will be affected by the color-adjustment and grayscale-adjustment matrices.
        type - An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the color-adjustment and grayscale-adjustment matrices are set.
      • setThreshold

        public void setThreshold(float threshold)

        Sets the threshold (transparency range) for the default category.

        Parameters:
        threshold - A real number that specifies the threshold value.
      • setThreshold

        public void setThreshold(float threshold,
                                 int type)

        Sets the threshold (transparency range) for a specified category.

        Parameters:
        threshold - A threshold value from 0.0 to 1.0 that is used as a breakpoint to sort colors that will be mapped to either a maximum or a minimum value.
        type - An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the color threshold is set.
      • clearThreshold

        public void clearThreshold()

        Clears the threshold value for the default category.

      • clearThreshold

        public void clearThreshold(int type)

        Clears the threshold value for a specified category.

        Parameters:
        type - An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the threshold is cleared.
      • setGamma

        public void setGamma(float gamma)

        Sets the gamma value for the default category.

        Parameters:
        gamma - The gamma correction value.
      • setGamma

        public void setGamma(float gamma,
                             int type)

        Sets the gamma value for a specified category.

        Parameters:
        gamma - The gamma correction value.
        type - An element of the Aspose.Imaging.ColorAdjustType enumeration that specifies the category for which the gamma value is set.
      • clearGamma

        public void clearGamma()

        Disables gamma correction for the default category.

      • clearGamma

        public void clearGamma(int type)

        Disables gamma correction for a specified category.

        Parameters:
        type - An element of Aspose.Imaging.ColorAdjustType that specifies the category for which gamma correction is disabled.
      • setNoOp

        public void setNoOp()

        Turns off color adjustment for the default category.

      • setNoOp

        public void setNoOp(int type)

        Turns off color adjustment for a specified category.

        Parameters:
        type - An element of Aspose.Imaging.ColorAdjustType that specifies the category for which color correction is turned off.
      • clearNoOp

        public void clearNoOp()

        Clears the NoOp setting for the default category.

      • clearNoOp

        public void clearNoOp(int type)

        Clears the NoOp setting for a specified category.

        Parameters:
        type - An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the NoOp setting is cleared.
      • setColorKey

        public void setColorKey(Color colorLow,
                                Color colorHigh)

        Sets the color key for the default category.

        Parameters:
        colorLow - The low color-key value.
        colorHigh - The high color-key value.
      • setColorKey

        public void setColorKey(Color colorLow,
                                Color colorHigh,
                                int type)

        Sets the color key (transparency range) for a specified category.

        Parameters:
        colorLow - The low color-key value.
        colorHigh - The high color-key value.
        type - An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the color key is set.
      • clearColorKey

        public void clearColorKey()

        Clears the color key (transparency range) for the default category.

      • clearColorKey

        public void clearColorKey(int type)

        Clears the color key (transparency range) for a specified category.

        Parameters:
        type - An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the color key is cleared.
      • setOutputChannel

        public void setOutputChannel(int flags)

        Sets the CMYK (cyan-magenta-yellow-black) output channel for the default category.

        Parameters:
        flags - An element of Aspose.Imaging.ColorChannelFlag that specifies the output channel.
      • setOutputChannel

        public void setOutputChannel(int flags,
                                     int type)

        Sets the CMYK (cyan-magenta-yellow-black) output channel for a specified category.

        Parameters:
        flags - An element of Aspose.Imaging.ColorChannelFlag that specifies the output channel.
        type - An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the output channel is set.
      • clearOutputChannel

        public void clearOutputChannel()

        Clears the CMYK (cyan-magenta-yellow-black) output channel setting for the default category.

      • clearOutputChannel

        public void clearOutputChannel(int type)

        Clears the (cyan-magenta-yellow-black) output channel setting for a specified category.

        Parameters:
        type - An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the output channel setting is cleared.
      • setOutputChannelColorProfile

        public void setOutputChannelColorProfile(String colorProfileFilename)

        Sets the output channel color-profile file for the default category.

        Parameters:
        colorProfileFilename - The path name of a color-profile file. If the color-profile file is in the %SystemRoot%\System32\Spool\Drivers\Color directory, this parameter can be the file name. Otherwise, this parameter must be the fully qualified path name.
      • setOutputChannelColorProfile

        public void setOutputChannelColorProfile(String colorProfileFilename,
                                                 int type)

        Sets the output channel color-profile file for a specified category.

        Parameters:
        colorProfileFilename - The path name of a color-profile file. If the color-profile file is in the %SystemRoot%\System32\Spool\Drivers\Color directory, this parameter can be the file name. Otherwise, this parameter must be the fully qualified path name.
        type - An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the output channel color-profile file is set.
      • clearOutputChannelColorProfile

        public void clearOutputChannelColorProfile()

        Clears the output channel color profile setting for the default category.

      • clearOutputChannelColorProfile

        public void clearOutputChannelColorProfile(int type)

        Clears the output channel color profile setting for a specified category.

        Parameters:
        type - An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the output channel profile setting is cleared.
      • setRemapTable

        public void setRemapTable(ColorMap[] map)

        Sets the color-remap table for the default category.

        Parameters:
        map - An array of color pairs of type com.aspose.imaging.ColorMap. Each color pair contains an existing color (the first value) and the color that it will be mapped to (the second value).
      • setRemapTable

        public void setRemapTable(ColorMap[] map,
                                  int type)

        Sets the color-remap table for a specified category.

        Parameters:
        map - An array of color pairs of type com.aspose.imaging.ColorMap. Each color pair contains an existing color (the first value) and the color that it will be mapped to (the second value).
        type - An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the color-remap table is set.
      • clearRemapTable

        public void clearRemapTable()

        Clears the color-remap table for the default category.

      • clearRemapTable

        public void clearRemapTable(int type)

        Clears the color-remap table for a specified category.

        Parameters:
        type - An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the remap table is cleared.
      • setBrushRemapTable

        public void setBrushRemapTable(ColorMap[] map)

        Sets the color-remap table for the brush category.

        Parameters:
        map - An array of com.aspose.imaging.ColorMap objects.
      • clearBrushRemapTable

        public void clearBrushRemapTable()

        Clears the brush color-remap table of this com.aspose.imaging.ImageAttributes object.

      • setWrapMode

        public void setWrapMode(int mode)

        Sets the wrap mode that is used to decide how to tile a texture across a shape, or at shape boundaries. A texture is tiled across a shape to fill it in when the texture is smaller than the shape it is filling.

        Parameters:
        mode - An element of Aspose.Imaging.WrapMode that specifies how repeated copies of an image are used to tile an area.
      • setWrapMode

        public void setWrapMode(int mode,
                                Color color)

        Sets the wrap mode and color used to decide how to tile a texture across a shape, or at shape boundaries. A texture is tiled across a shape to fill it in when the texture is smaller than the shape it is filling.

        Parameters:
        mode - An element of Aspose.Imaging.WrapMode that specifies how repeated copies of an image are used to tile an area.
        color - An com.aspose.imaging.ImageAttributes object that specifies the color of pixels outside of a rendered image. This color is visible if the mode parameter is set to WrapMode.Clamp and the source rectangle passed to DrawImage is larger than the image itself.
      • setWrapMode

        public void setWrapMode(int mode,
                                Color color,
                                boolean clamp)

        Sets the wrap mode and color used to decide how to tile a texture across a shape, or at shape boundaries. A texture is tiled across a shape to fill it in when the texture is smaller than the shape it is filling.

        Parameters:
        mode - An element of Aspose.Imaging.WrapMode that specifies how repeated copies of an image are used to tile an area.
        color - A color object that specifies the color of pixels outside of a rendered image. This color is visible if the mode parameter is set to WrapMode.Clamp and the source rectangle passed to DrawImage is larger than the image itself.
        clamp - This parameter has no effect. Set it to false.