• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

Public Types | Public Member Functions | Static Public Member Functions

TDEIconEffect Class Reference

Applies effects to icons. More...

#include <kiconeffect.h>

List of all members.

Public Types

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

Public Member Functions

 TDEIconEffect ()
void init ()
bool hasEffect (int group, int state) const
TQString fingerprint (int group, int state) const
TQImage apply (TQImage src, int group, int state) const
TQImage apply (TQImage src, int effect, float value, const TQColor rgb, bool trans) const
TQImage apply (TQImage src, int effect, float value, const TQColor rgb, const TQColor rgb2, bool trans) const
TQPixmap apply (TQPixmap src, int group, int state) const
TQPixmap apply (TQPixmap src, int effect, float value, const TQColor rgb, bool trans) const
TQPixmap apply (TQPixmap src, int effect, float value, const TQColor rgb, const TQColor rgb2, bool trans) const
TQImage doublePixels (TQImage src) const

Static Public Member Functions

static void visualActivate (TQWidget *widget, TQRect rect)
static void visualActivate (TQWidget *widget, TQRect rect, TQPixmap *pixmap)
static void toGray (TQImage &image, float value)
static void colorize (TQImage &image, const TQColor &col, float value)
static void toMonochrome (TQImage &image, const TQColor &black, const TQColor &white, float value)
static void deSaturate (TQImage &image, float value)
static void toGamma (TQImage &image, float value)
static void semiTransparent (TQImage &image)
static void semiTransparent (TQPixmap &pixmap)
static void overlay (TQImage &src, TQImage &overlay)

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.

See also:
TDEIcon

Definition at line 34 of file kiconeffect.h.


Member Enumeration Documentation

enum TDEIconEffect::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:
ToMonochrome 
Since:
3.4

Definition at line 55 of file kiconeffect.h.


Constructor & Destructor Documentation

TDEIconEffect::TDEIconEffect (  ) 

Create a new TDEIconEffect.

Definition at line 52 of file kiconeffect.cpp.


Member Function Documentation

TQImage TDEIconEffect::apply ( TQImage  src,
int  group,
int  state 
) const

Applies an effect to an image.

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

Parameters:
src The image.
group The group for the icon, see TDEIcon::Group
state The icon's state, see TDEIcon::States
Returns:
An image with the effect applied.

Definition at line 175 of file kiconeffect.cpp.

TQImage TDEIconEffect::apply ( TQImage  src,
int  effect,
float  value,
const TQColor  rgb,
bool  trans 
) const

Applies an effect to an image.

Parameters:
src The image.
effect The effect to apply, one of TDEIconEffect::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.

Definition at line 191 of file kiconeffect.cpp.

TQPixmap TDEIconEffect::apply ( TQPixmap  src,
int  effect,
float  value,
const TQColor  rgb,
bool  trans 
) const

Applies an effect to a pixmap.

Parameters:
src The pixmap.
effect The effect to apply, one of TDEIconEffect::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.

Definition at line 248 of file kiconeffect.cpp.

TQPixmap TDEIconEffect::apply ( TQPixmap  src,
int  effect,
float  value,
const TQColor  rgb,
const TQColor  rgb2,
bool  trans 
) const
Since:
3.4

Definition at line 254 of file kiconeffect.cpp.

TQImage TDEIconEffect::apply ( TQImage  src,
int  effect,
float  value,
const TQColor  rgb,
const TQColor  rgb2,
bool  trans 
) const
Since:
3.4

Definition at line 196 of file kiconeffect.cpp.

TQPixmap TDEIconEffect::apply ( TQPixmap  src,
int  group,
int  state 
) const

Applies an effect to a pixmap.

Parameters:
src The pixmap.
group The group for the icon, see TDEIcon::Group
state The icon's state, see TDEIcon::States
Returns:
A pixmap with the effect applied.

Definition at line 232 of file kiconeffect.cpp.

void TDEIconEffect::colorize ( TQImage &  image,
const TQColor &  col,
float  value 
) [static]

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

Definition at line 307 of file kiconeffect.cpp.

void TDEIconEffect::deSaturate ( TQImage &  image,
float  value 
) [static]

Desaturates an image.

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

Definition at line 398 of file kiconeffect.cpp.

TQImage TDEIconEffect::doublePixels ( TQImage  src  )  const

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

Parameters:
src the image.
Returns:
the scaled image.

Definition at line 543 of file kiconeffect.cpp.

TQString TDEIconEffect::fingerprint ( int  group,
int  state 
) const

Returns a fingerprint for the effect by encoding the given group and state into a TQString.

This is useful for caching.

Parameters:
group the group, see TDEIcon::Group
state the state, see TDEIcon::States
Returns:
the fingerprint of the given group+state

Definition at line 145 of file kiconeffect.cpp.

bool TDEIconEffect::hasEffect ( int  group,
int  state 
) const

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

Parameters:
group the group to check, see TDEIcon::Group
state the state to check, see TDEIcon::States
Returns:
true if an effect is configured for the given group in state, otherwise false.
See also:
TDEIcon::Group TDEIcon::States

Definition at line 140 of file kiconeffect.cpp.

void TDEIconEffect::init (  ) 

Rereads configuration.

Definition at line 64 of file kiconeffect.cpp.

void TDEIconEffect::overlay ( TQImage &  src,
TQImage &  overlay 
) [static]

Overlays an image with an other image.

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

Definition at line 592 of file kiconeffect.cpp.

void TDEIconEffect::semiTransparent ( TQImage &  image  )  [static]

Renders an image semi-transparent.

Parameters:
image The image

Definition at line 438 of file kiconeffect.cpp.

void TDEIconEffect::semiTransparent ( TQPixmap &  pixmap  )  [static]

Renders a pixmap semi-transparent.

Parameters:
pixmap The pixmap

Definition at line 512 of file kiconeffect.cpp.

void TDEIconEffect::toGamma ( TQImage &  image,
float  value 
) [static]

Changes the gamma value of an image.

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

Definition at line 416 of file kiconeffect.cpp.

void TDEIconEffect::toGray ( TQImage &  image,
float  value 
) [static]

Tints an image gray.

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

Definition at line 285 of file kiconeffect.cpp.

void TDEIconEffect::toMonochrome ( TQImage &  image,
const TQColor &  black,
const TQColor &  white,
float  value 
) [static]

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
Since:
3.4

Definition at line 348 of file kiconeffect.cpp.

void TDEIconEffect::visualActivate ( TQWidget *  widget,
TQRect  rect 
) [static]

Provides visual feedback to show activation of an icon on a widget.

Not strictly an 'icon effect', but in practice that's what it looks like.

This method does nothing if the global 'Visual feedback on activation' option is not activated (See kcontrol/Peripherals/Mouse).

Parameters:
widget The widget on which the effect should be painted
rect This rectangle defines the effect's borders

Definition at line 707 of file kiconeffect.cpp.


The documentation for this class was generated from the following files:
  • kiconeffect.h
  • kiconeffect.cpp

tdecore

Skip menu "tdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.7.1
This website is maintained by Timothy Pearson.