com.aspose.imaging
Class ImageAttributes

java.lang.Object
  extended by com.aspose.imaging.ImageAttributes

public final class ImageAttributes
extends java.lang.Object

An ImageAttributes object contains information about how bitmap and metafile colors are manipulated during rendering. An 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 ImageAttributes object and pass the path of that ImageAttributes object (along with the path of an Image) to the DrawImage method.


Constructor Summary
ImageAttributes()
           Initializes a new instance of the ImageAttributes class.
 
Method Summary
 void clearBrushRemapTable()
           Clears the brush color-remap table of this 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 getAdjustedPalette(IColorPalette palette, int type)
           Adjusts the colors in a palette according to the adjustment settings of 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(java.lang.String colorProfileFilename)
           Sets the output channel color-profile file for the default category.
 void setOutputChannelColorProfile(java.lang.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageAttributes

public ImageAttributes()

Initializes a new instance of the ImageAttributes class.

Method Detail

clearBrushRemapTable

public void clearBrushRemapTable()

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


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 ColorAdjustType that specifies the category for which the color key is cleared.

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 ColorAdjustType that specifies the category for which the color-adjustment matrix is cleared.

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 ColorAdjustType that specifies the category for which gamma correction is disabled.

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 ColorAdjustType that specifies the category for which the NoOp setting is cleared.

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 ColorAdjustType that specifies the category for which the output channel setting is cleared.

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 ColorAdjustType that specifies the category for which the output channel profile setting is cleared.

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 ColorAdjustType that specifies the category for which the remap table is cleared.

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 ColorAdjustType that specifies the category for which the threshold is cleared.

getAdjustedPalette

public void getAdjustedPalette(IColorPalette palette,
                               int type)

Adjusts the colors in a palette according to the adjustment settings of a specified category.

Parameters:
palette - A ColorPalette that on input contains the palette to be adjusted, and on output contains the adjusted palette.
type - An element of ColorAdjustType that specifies the category whose adjustment settings will be applied to the palette.

setBrushRemapTable

public void setBrushRemapTable(ColorMap[] map)

Sets the color-remap table for the brush category.

Parameters:
map - An array of ColorMap objects.

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 ColorAdjustType that specifies the category for which the color key is set.

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 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 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 ColorAdjustType that specifies the category for which the color-adjustment and grayscale-adjustment matrices are set.

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 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 ColorMatrixFlag that specifies the type of image and color that will be affected by the color-adjustment matrix.
type - An element of ColorAdjustType that specifies the category for which the color-adjustment matrix is set.

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 ColorAdjustType enumeration that specifies the category for which the gamma value is set.

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 ColorAdjustType that specifies the category for which color correction is turned off.

setOutputChannel

public void setOutputChannel(int flags)

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

Parameters:
flags - An element of 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 ColorChannelFlag that specifies the output channel.
type - An element of ColorAdjustType that specifies the category for which the output channel is set.

setOutputChannelColorProfile

public void setOutputChannelColorProfile(java.lang.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(java.lang.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 ColorAdjustType that specifies the category for which the output channel color-profile file is set.

setRemapTable

public void setRemapTable(ColorMap[] map)

Sets the color-remap table for the default category.

Parameters:
map - An array of color pairs of type 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 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 ColorAdjustType that specifies the category for which the color-remap table is 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 ColorAdjustType that specifies the category for which the color threshold is set.

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 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 WrapMode that specifies how repeated copies of an image are used to tile an area.
color - An 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 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.