KDE 4.5 PyKDE API Reference
  • KDE's Python API
  • Overview
  • PyKDE Home
  • Sitemap
  • Contact Us
 

KIconEffect Class Reference

from PyKDE4.kdeui import *

Detailed Description

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.

"Various Effects applied to an image"

See also:
KIcon


Enumerations

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

Methods

 __init__ (self, KIconEffect other)
 __init__ (self)
QImage apply (self, QImage src, int group, int state)
QImage apply (self, QImage src, int effect, float value, QColor rgb, bool trans)
QImage apply (self, QImage src, int effect, float value, QColor rgb, QColor rgb2, bool trans)
QPixmap apply (self, QPixmap src, int group, int state)
QPixmap apply (self, QPixmap src, int effect, float value, QColor rgb, bool trans)
QPixmap apply (self, QPixmap src, int effect, float value, QColor rgb, QColor rgb2, bool trans)
QImage doublePixels (self, QImage src)
QString fingerprint (self, int group, int state)
bool hasEffect (self, int group, int state)
 init (self)

Static Methods

 colorize (QImage image, QColor col, float value)
 deSaturate (QImage image, float value)
 overlay (QImage src, QImage overlay)
 semiTransparent (QImage image)
 semiTransparent (QPixmap pixmap)
 toGamma (QImage image, float value)
 toGray (QImage image, float value)
 toMonochrome (QImage image, QColor black, QColor white, float value)

Method Documentation

__init__ (  self,
KIconEffect  other
)
__init__ (   self )

Create a new KIconEffect.

QImage apply (  self,
QImage  src,
int  group,
int  state
)

Applies an effect to a pixmap.

Parameters:
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.

QImage apply (  self,
QImage  src,
int  effect,
float  value,
QColor  rgb,
bool  trans
)

Applies an effect to a pixmap.

Parameters:
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.

QImage apply (  self,
QImage  src,
int  effect,
float  value,
QColor  rgb,
QColor  rgb2,
bool  trans
)

Applies an effect to a pixmap.

Parameters:
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.

QPixmap apply (  self,
QPixmap  src,
int  group,
int  state
)

Applies an effect to a pixmap.

Parameters:
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.

QPixmap apply (  self,
QPixmap  src,
int  effect,
float  value,
QColor  rgb,
bool  trans
)

Applies an effect to a pixmap.

Parameters:
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.

QPixmap apply (  self,
QPixmap  src,
int  effect,
float  value,
QColor  rgb,
QColor  rgb2,
bool  trans
)

Applies an effect to a pixmap.

Parameters:
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.

QImage doublePixels (  self,
QImage  src
)

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

Parameters:
src  the image.

Returns:
the scaled image.

QString fingerprint (  self,
int  group,
int  state
)

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

Parameters:
group  the group, see KIconLoader.Group
state  the state, see KIconLoader.States

Returns:
the fingerprint of the given group+@p state

bool hasEffect (  self,
int  group,
int  state
)

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

Parameters:
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 (   self )

Rereads configuration.


Static Method Documentation

colorize ( QImage  image,
QColor  col,
float  value
)

Colorizes an image with a specific color.

Parameters:
image  The image
col  The color with which the image is tinted
value  Strength of the effect. 0 <= value <= 1

deSaturate ( QImage  image,
float  value
)

Desaturates an image.

Parameters:
image  The image
value  Strength of the effect. 0 <= value <= 1

overlay ( QImage  src,
QImage  overlay
)

Overlays an image with an other image.

Parameters:
src  The image
overlay  The image to overlay src with

semiTransparent ( QImage  image
)

Renders a pixmap semi-transparent.

Parameters:
pixmap  The pixmap

semiTransparent ( QPixmap  pixmap
)

Renders a pixmap semi-transparent.

Parameters:
pixmap  The pixmap

toGamma ( QImage  image,
float  value
)

Changes the gamma value of an image.

Parameters:
image  The image
value  Strength of the effect. 0 <= value <= 1

toGray ( QImage  image,
float  value
)

Tints an image gray.

Parameters:
image  The image
value  Strength of the effect. 0 <= value <= 1

toMonochrome ( QImage  image,
QColor  black,
QColor  white,
float  value
)

Produces a monochrome icon with a given foreground and background color

Parameters:
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


Enumeration Documentation

Effects

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
  • Enumerator:
    NoEffect 
    ToGray 
    Colorize 
    ToGamma 
    DeSaturate 
    ToMonochrome 
    LastEffect 

    • Full Index

    Modules

    • akonadi
    • dnssd
    • kdecore
    • kdeui
    • khtml
    • kio
    • knewstuff
    • kparts
    • kutils
    • nepomuk
    • phonon
    • plasma
    • polkitqt
    • solid
    • soprano
    This documentation is maintained by Simon Edwards.
    KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal