# class KIconEffect

###

Module | kdeui
Namespace |
Class | KIconEffect
Inherits |

Applies effects to icons.

This class applies effects to icons depending on their state and group. For example, it can be used to make all disabled icons in a toolbar gray.

See also KIcon

### enums

- Effects { NoEffect, ToGray, Colorize, ToGamma, DeSaturate, ToMonochrome, LastEffect }

enum details

### methods

- KIconEffect ( )

  returns ctor

  Create a new KIconEffect.

- apply (src, group, state)

  returns QImage

  Argument | Type | Default
  --- | --- | ---
  src | QImage |
  group | int |
  state | int |

  Applies an effect to an image. The effect to apply depends on the group and state parameters, and is configured by the user.

  src - The image.

  group - The group for the icon, see KIconLoader.Group

  state - The icon's state, see KIconLoader.States Returns An image with the effect applied.

- apply (src, effect, value, rgb, trans)

  returns QImage

  Argument | Type | Default
  --- | --- | ---
  src | QImage |
  effect | int |
  value | float |
  rgb | QColor |
  trans | bool |

  Applies an effect to an image.

  src - The image.

  effect - The effect to apply, one of KIconEffect.Effects.

  value - Strength of the effect. 0 <= value <= 1.

  rgb - Color parameter for effects that need one.

  trans - Add Transparency if trans = true. Returns An image with the effect applied.

- apply (src, effect, value, rgb, rgb2, trans)

  returns QImage

  Argument | Type | Default
  --- | --- | ---
  src | QImage |
  effect | int |
  value | float |
  rgb | QColor |
  rgb2 | QColor |
  trans | bool |

- apply (src, group, state)

  returns QPixmap

  Argument | Type | Default
  --- | --- | ---
  src | QPixmap |
  group | int |
  state | int |

  Applies an effect to a pixmap.

  src - The pixmap.

  group - The group for the icon, see KIconLoader.Group

  state - The icon's state, see KIconLoader.States Returns A pixmap with the effect applied.

- apply (src, effect, value, rgb, trans)

  returns QPixmap

  Argument | Type | Default
  --- | --- | ---
  src | QPixmap |
  effect | int |
  value | float |
  rgb | QColor |
  trans | bool |

  Applies an effect to a pixmap.

  src - The pixmap.

  effect - The effect to apply, one of KIconEffect.Effects.

  value - Strength of the effect. 0 <= value <= 1.

  rgb - Color parameter for effects that need one.

  trans - Add Transparency if trans = true. Returns A pixmap with the effect applied.

- apply (src, effect, value, rgb, rgb2, trans)

  returns QPixmap

  Argument | Type | Default
  --- | --- | ---
  src | QPixmap |
  effect | int |
  value | float |
  rgb | QColor |
  rgb2 | QColor |
  trans | bool |

- colorize (image, col, value)

  returns Nothing
  static

  Argument | Type | Default
  --- | --- | ---
  image | QImage |
  col | QColor |
  value | float |

  Colorizes an image with a specific color.

  image - The image

  col - The color with which the image is tinted

  value - Strength of the effect. 0 <= value <= 1

- deSaturate (image, value)

  returns Nothing
  static

  Argument | Type | Default
  --- | --- | ---
  image | QImage |
  value | float |

  Desaturates an image.

  image - The image

  value - Strength of the effect. 0 <= value <= 1

- doublePixels (src)

  returns QImage

  Argument | Type | Default
  --- | --- | ---
  src | QImage |

  Returns an image twice as large, consisting of 2x2 pixels.

  src - the image. Returns the scaled image.

- fingerprint (group, state)

  returns QString

  Argument | Type | Default
  --- | --- | ---
  group | int |
  state | int |

  Returns a fingerprint for the effect by encoding the given group and state into a QString. This is useful for caching.

  group - the group, see KIconLoader.Group

  state - the state, see KIconLoader.States Returns the fingerprint of the given group+@p state

- hasEffect (group, state)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  group | int |
  state | int |

  Tests whether an effect has been configured for the given icon group.

  group - the group to check, see KIconLoader.Group

  state - the state to check, see KIconLoader.States Returns true if an effect is configured for the given group in state, otherwise false.

  See also KIconLoader.Group KIconLoader.States

- init ( )

  returns Nothing

  Rereads configuration.

- overlay (src, overlay)

  returns Nothing
  static

  Argument | Type | Default
  --- | --- | ---
  src | QImage |
  overlay | QImage |

  Overlays an image with an other image.

  src - The image

  overlay - The image to overlay src with

- semiTransparent (image)

  returns Nothing
  static

  Argument | Type | Default
  --- | --- | ---
  image | QImage |

  Renders an image semi-transparent.

  image - The image

- semiTransparent (pixmap)

  returns Nothing
  static

  Argument | Type | Default
  --- | --- | ---
  pixmap | QPixmap |

  Renders a pixmap semi-transparent.

  pixmap - The pixmap

- toGamma (image, value)

  returns Nothing
  static

  Argument | Type | Default
  --- | --- | ---
  image | QImage |
  value | float |

  Changes the gamma value of an image.

  image - The image

  value - Strength of the effect. 0 <= value <= 1

- toGray (image, value)

  returns Nothing
  static

  Argument | Type | Default
  --- | --- | ---
  image | QImage |
  value | float |

  Tints an image gray.

  image - The image

  value - Strength of the effect. 0 <= value <= 1

- toMonochrome (image, black, white, value)

  returns Nothing
  static

  Argument | Type | Default
  --- | --- | ---
  image | QImage |
  black | QColor |
  white | QColor |
  value | float |

  Produces a monochrome icon with a given foreground and background color

  image - The image

  white - The color with which the white parts of image are painted

  black - The color with which the black parts of image are painted

  value - Strength of the effect. 0 <= value <= 1

### enums - detail

- Effects { NoEffect, ToGray, Colorize, ToGamma, DeSaturate, ToMonochrome, LastEffect }

  This is the enumeration of all possible icon effects. Note that 'LastEffect' is no valid icon effect but only used internally to check for invalid icon effects.

- NoEffect: Don't apply any icon effect
- ToGray: Tints the icon gray
- Colorize: Tints the icon with an other color
- ToGamma: Change the gamma value of the icon
- DeSaturate: Reduce the saturation of the icon
- ToMonochrome: Produces a monochrome icon

| NoEffect | - | - |
| ToGray | - | - |
| Colorize | - | - |
| ToGamma | - | - |
| DeSaturate | - | - |
| ToMonochrome | - | - |
| LastEffect | - | - |