ImageAttributes

Inheritance: java.lang.Object

public final class ImageAttributes

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 Image) to the drawImage method.

Constructors

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

Methods

MethodDescription
setColorMatrix(ColorMatrix newColorMatrix)Sets the color-adjustment matrix for the default category.
setColorMatrix(ColorMatrix newColorMatrix, int flags)Sets the color-adjustment matrix for the default category.
setColorMatrix(ColorMatrix newColorMatrix, int mode, int type)Sets the color-adjustment matrix for a specified category.
clearColorMatrix()Clears the color-adjustment matrix for the default category.
clearColorMatrix(int type)Clears the color-adjustment matrix for a specified category.
setColorMatrices(ColorMatrix newColorMatrix, ColorMatrix grayMatrix)Sets the color-adjustment matrix and the grayscale-adjustment matrix for the default category.
setColorMatrices(ColorMatrix newColorMatrix, ColorMatrix grayMatrix, int flags)Sets the color-adjustment matrix and the grayscale-adjustment matrix for the default category.
setColorMatrices(ColorMatrix newColorMatrix, ColorMatrix grayMatrix, int mode, int type)Sets the color-adjustment matrix and the grayscale-adjustment matrix for a specified category.
setThreshold(float threshold)Sets the threshold (transparency range) for the default category.
setThreshold(float threshold, int type)Sets the threshold (transparency range) for a specified category.
clearThreshold()Clears the threshold value for the default category.
clearThreshold(int type)Clears the threshold value for a specified category.
setGamma(float gamma)Sets the gamma value for the default category.
setGamma(float gamma, int type)Sets the gamma value for a specified category.
clearGamma()Disables gamma correction for the default category.
clearGamma(int type)Disables gamma correction for a specified category.
setNoOp()Turns off color adjustment for the default category.
setNoOp(int type)Turns off color adjustment for a specified category.
clearNoOp()Clears the NoOp setting for the default category.
clearNoOp(int type)Clears the NoOp setting for a specified category.
setColorKey(Color colorLow, Color colorHigh)Sets the color key for the default category.
setColorKey(Color colorLow, Color colorHigh, int type)Sets the color key (transparency range) for a specified category.
clearColorKey()Clears the color key (transparency range) for the default category.
clearColorKey(int type)Clears the color key (transparency range) for a specified category.
setOutputChannel(int flags)Sets the CMYK (cyan-magenta-yellow-black) output channel for the default category.
setOutputChannel(int flags, int type)Sets the CMYK (cyan-magenta-yellow-black) output channel for a specified category.
clearOutputChannel()Clears the CMYK (cyan-magenta-yellow-black) output channel setting for the default category.
clearOutputChannel(int type)Clears the (cyan-magenta-yellow-black) output channel setting for a specified category.
setOutputChannelColorProfile(String colorProfileFilename)Sets the output channel color-profile file for the default category.
setOutputChannelColorProfile(String colorProfileFilename, int type)Sets the output channel color-profile file for a specified category.
clearOutputChannelColorProfile()Clears the output channel color profile setting for the default category.
clearOutputChannelColorProfile(int type)Clears the output channel color profile setting for a specified category.
setRemapTable(ColorMap[] map)Sets the color-remap table for the default category.
setRemapTable(ColorMap[] map, int type)Sets the color-remap table for a specified category.
clearRemapTable()Clears the color-remap table for the default category.
clearRemapTable(int type)Clears the color-remap table for a specified category.
setBrushRemapTable(ColorMap[] map)Sets the color-remap table for the brush category.
clearBrushRemapTable()Clears the brush color-remap table of this com.aspose.imaging.ImageAttributes object.
setWrapMode(int mode)Sets the wrap mode that is used to decide how to tile a texture across a shape, or at shape boundaries.
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.
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.
equals(Object o)
hashCode()

ImageAttributes()

public ImageAttributes()

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

setColorMatrix(ColorMatrix newColorMatrix)

public void setColorMatrix(ColorMatrix newColorMatrix)

Sets the color-adjustment matrix for the default category.

Parameters:

ParameterTypeDescription
newColorMatrixColorMatrixThe color-adjustment matrix.

setColorMatrix(ColorMatrix newColorMatrix, int flags)

public void setColorMatrix(ColorMatrix newColorMatrix, int flags)

Sets the color-adjustment matrix for the default category.

Parameters:

ParameterTypeDescription
newColorMatrixColorMatrixThe color-adjustment matrix.
flagsintAn element of Aspose.Imaging.ColorMatrixFlag that specifies the type of image and color that will be affected by the color-adjustment matrix.

setColorMatrix(ColorMatrix newColorMatrix, int mode, int type)

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

Sets the color-adjustment matrix for a specified category.

Parameters:

ParameterTypeDescription
newColorMatrixColorMatrixThe color-adjustment matrix.
modeintAn element of Aspose.Imaging.ColorMatrixFlag that specifies the type of image and color that will be affected by the color-adjustment matrix.
typeintAn 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(int type)

public void clearColorMatrix(int type)

Clears the color-adjustment matrix for a specified category.

Parameters:

ParameterTypeDescription
typeintAn element of Aspose.Imaging.ColorAdjustType that specifies the category for which the color-adjustment matrix is cleared.

setColorMatrices(ColorMatrix newColorMatrix, ColorMatrix grayMatrix)

public void setColorMatrices(ColorMatrix newColorMatrix, ColorMatrix grayMatrix)

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

Parameters:

ParameterTypeDescription
newColorMatrixColorMatrixThe color-adjustment matrix.
grayMatrixColorMatrixThe grayscale-adjustment matrix.

setColorMatrices(ColorMatrix newColorMatrix, ColorMatrix grayMatrix, int flags)

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

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

Parameters:

ParameterTypeDescription
newColorMatrixColorMatrixThe color-adjustment matrix.
grayMatrixColorMatrixThe grayscale-adjustment matrix.
flagsintAn 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(ColorMatrix newColorMatrix, ColorMatrix grayMatrix, int mode, int type)

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:

ParameterTypeDescription
newColorMatrixColorMatrixThe color-adjustment matrix.
grayMatrixColorMatrixThe grayscale-adjustment matrix.
modeintAn 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.
typeintAn element of Aspose.Imaging.ColorAdjustType that specifies the category for which the color-adjustment and grayscale-adjustment matrices are set.

setThreshold(float threshold)

public void setThreshold(float threshold)

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

Parameters:

ParameterTypeDescription
thresholdfloatA real number that specifies the threshold value.

setThreshold(float threshold, int type)

public void setThreshold(float threshold, int type)

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

Parameters:

ParameterTypeDescription
thresholdfloatA 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.
typeintAn 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(int type)

public void clearThreshold(int type)

Clears the threshold value for a specified category.

Parameters:

ParameterTypeDescription
typeintAn element of Aspose.Imaging.ColorAdjustType that specifies the category for which the threshold is cleared.

setGamma(float gamma)

public void setGamma(float gamma)

Sets the gamma value for the default category.

Parameters:

ParameterTypeDescription
gammafloatThe gamma correction value.

setGamma(float gamma, int type)

public void setGamma(float gamma, int type)

Sets the gamma value for a specified category.

Parameters:

ParameterTypeDescription
gammafloatThe gamma correction value.
typeintAn 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(int type)

public void clearGamma(int type)

Disables gamma correction for a specified category.

Parameters:

ParameterTypeDescription
typeintAn 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(int type)

public void setNoOp(int type)

Turns off color adjustment for a specified category.

Parameters:

ParameterTypeDescription
typeintAn 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(int type)

public void clearNoOp(int type)

Clears the NoOp setting for a specified category.

Parameters:

ParameterTypeDescription
typeintAn element of Aspose.Imaging.ColorAdjustType that specifies the category for which the NoOp setting is cleared.

setColorKey(Color colorLow, Color colorHigh)

public void setColorKey(Color colorLow, Color colorHigh)

Sets the color key for the default category.

Parameters:

ParameterTypeDescription
colorLowColorThe low color-key value.
colorHighColorThe high color-key value.

setColorKey(Color colorLow, Color colorHigh, int type)

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

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

Parameters:

ParameterTypeDescription
colorLowColorThe low color-key value.
colorHighColorThe high color-key value.
typeintAn 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(int type)

public void clearColorKey(int type)

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

Parameters:

ParameterTypeDescription
typeintAn element of Aspose.Imaging.ColorAdjustType that specifies the category for which the color key is cleared.

setOutputChannel(int flags)

public void setOutputChannel(int flags)

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

Parameters:

ParameterTypeDescription
flagsintAn element of Aspose.Imaging.ColorChannelFlag that specifies the output channel.

setOutputChannel(int flags, int type)

public void setOutputChannel(int flags, int type)

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

Parameters:

ParameterTypeDescription
flagsintAn element of Aspose.Imaging.ColorChannelFlag that specifies the output channel.
typeintAn 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(int type)

public void clearOutputChannel(int type)

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

Parameters:

ParameterTypeDescription
typeintAn element of Aspose.Imaging.ColorAdjustType that specifies the category for which the output channel setting is cleared.

setOutputChannelColorProfile(String colorProfileFilename)

public void setOutputChannelColorProfile(String colorProfileFilename)

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

Parameters:

ParameterTypeDescription
colorProfileFilenamejava.lang.StringThe 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(String colorProfileFilename, int type)

public void setOutputChannelColorProfile(String colorProfileFilename, int type)

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

Parameters:

ParameterTypeDescription
colorProfileFilenamejava.lang.StringThe 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.
typeintAn 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(int type)

public void clearOutputChannelColorProfile(int type)

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

Parameters:

ParameterTypeDescription
typeintAn element of Aspose.Imaging.ColorAdjustType that specifies the category for which the output channel profile setting is cleared.

setRemapTable(ColorMap[] map)

public void setRemapTable(ColorMap[] map)

Sets the color-remap table for the default category.

Parameters:

ParameterTypeDescription
mapColorMap[]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(ColorMap[] map, int type)

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

Sets the color-remap table for a specified category.

Parameters:

ParameterTypeDescription
mapColorMap[]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).
typeintAn 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(int type)

public void clearRemapTable(int type)

Clears the color-remap table for a specified category.

Parameters:

ParameterTypeDescription
typeintAn element of Aspose.Imaging.ColorAdjustType that specifies the category for which the remap table is cleared.

setBrushRemapTable(ColorMap[] map)

public void setBrushRemapTable(ColorMap[] map)

Sets the color-remap table for the brush category.

Parameters:

ParameterTypeDescription
mapColorMap[]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(int mode)

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:

ParameterTypeDescription
modeintAn element of Aspose.Imaging.WrapMode that specifies how repeated copies of an image are used to tile an area.

setWrapMode(int mode, Color color)

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:

ParameterTypeDescription
modeintAn element of Aspose.Imaging.WrapMode that specifies how repeated copies of an image are used to tile an area.
colorColorAn com.aspose.imaging.ImageAttributes object that specifies the color of pixels outside 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(int mode, Color color, boolean clamp)

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:

ParameterTypeDescription
modeintAn element of Aspose.Imaging.WrapMode that specifies how repeated copies of an image are used to tile an area.
colorColorA color object that specifies the color of pixels outside 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.
clampbooleanThis parameter has no effect. Set it to false.

equals(Object o)

public boolean equals(Object o)

Parameters:

ParameterTypeDescription
ojava.lang.Object

Returns: boolean

hashCode()

public int hashCode()

Returns: int