|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kde.koala.KIconEffect
public class KIconEffect
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.
KIcon
Field Summary | |
---|---|
static int |
Colorize
|
static int |
DeSaturate
|
static int |
LastEffect
|
static int |
NoEffect
This is the enumeration of all possible icon effects. |
static int |
ToGamma
|
static int |
ToGray
|
static int |
ToMonochrome
|
Constructor Summary | |
---|---|
|
KIconEffect()
Create a new KIconEffect. |
protected |
KIconEffect(java.lang.Class dummy)
|
Method Summary | |
---|---|
org.kde.qt.QImage |
apply(org.kde.qt.QImage src,
int effect,
float value,
org.kde.qt.QColor rgb,
boolean trans)
Applies an effect to an image. |
org.kde.qt.QImage |
apply(org.kde.qt.QImage src,
int effect,
float value,
org.kde.qt.QColor rgb,
org.kde.qt.QColor rgb2,
boolean trans)
|
org.kde.qt.QImage |
apply(org.kde.qt.QImage src,
int group,
int state)
Applies an effect to an image. |
org.kde.qt.QPixmap |
apply(org.kde.qt.QPixmap src,
int effect,
float value,
org.kde.qt.QColor rgb,
boolean trans)
Applies an effect to a pixmap. |
org.kde.qt.QPixmap |
apply(org.kde.qt.QPixmap src,
int effect,
float value,
org.kde.qt.QColor rgb,
org.kde.qt.QColor rgb2,
boolean trans)
|
org.kde.qt.QPixmap |
apply(org.kde.qt.QPixmap src,
int group,
int state)
Applies an effect to a pixmap. |
static void |
colorize(org.kde.qt.QImage image,
org.kde.qt.QColor col,
float value)
Colorizes an image with a specific color. |
static void |
deSaturate(org.kde.qt.QImage image,
float value)
Desaturates an image. |
void |
dispose()
Delete the wrapped C++ instance ahead of finalize() |
org.kde.qt.QImage |
doublePixels(org.kde.qt.QImage src)
Returns an image twice as large, consisting of 2x2 pixels. |
protected void |
finalize()
Deletes the wrapped C++ instance |
java.lang.String |
fingerprint(int group,
int state)
Returns a fingerprint for the effect by encoding the given group and state into a String. |
boolean |
hasEffect(int group,
int state)
Tests whether an effect has been configured for the given icon group. |
void |
init()
Rereads configuration. |
boolean |
isDisposed()
Has the wrapped C++ instance been deleted? |
static void |
overlay(org.kde.qt.QImage src,
org.kde.qt.QImage overlay)
Overlays an image with an other image. |
static void |
semiTransparent(org.kde.qt.QImage image)
Renders an image semi-transparent. |
static void |
semiTransparent(org.kde.qt.QPixmap pixmap)
Renders a pixmap semi-transparent. |
static void |
toGamma(org.kde.qt.QImage image,
float value)
Changes the gamma value of an image. |
static void |
toGray(org.kde.qt.QImage image,
float value)
Tints an image gray. |
static void |
toMonochrome(org.kde.qt.QImage image,
org.kde.qt.QColor black,
org.kde.qt.QColor white,
float value)
Produces a monochrome icon with a given foreground and background color |
static void |
visualActivate(org.kde.qt.QWidget widget,
org.kde.qt.QRect rect)
Provides visual feedback to show activation of an icon on a widget. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NoEffect
public static final int ToGray
public static final int Colorize
public static final int ToGamma
public static final int DeSaturate
public static final int ToMonochrome
public static final int LastEffect
Constructor Detail |
---|
protected KIconEffect(java.lang.Class dummy)
public KIconEffect()
Method Detail |
---|
public void init()
public boolean hasEffect(int group, int state)
group
- the group to check, see KIcon.Groupstate
- the state to check, see KIcon.States
group
in state
, otherwise false.KIcon#Group
,
KIcon#States
public java.lang.String fingerprint(int group, int state)
group
and state
into a String. This
is useful for caching.
group
- the group, see KIcon.Groupstate
- the state, see KIcon.States
group
+state
public org.kde.qt.QImage apply(org.kde.qt.QImage src, int group, int state)
group
and state
parameters, and is configured by the user.
src
- The image.group
- The group for the icon, see KIcon.Groupstate
- The icon's state, see KIcon.States
public org.kde.qt.QImage apply(org.kde.qt.QImage src, int effect, float value, org.kde.qt.QColor rgb, boolean trans)
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.
public org.kde.qt.QImage apply(org.kde.qt.QImage src, int effect, float value, org.kde.qt.QColor rgb, org.kde.qt.QColor rgb2, boolean trans)
public org.kde.qt.QPixmap apply(org.kde.qt.QPixmap src, int group, int state)
src
- The pixmap.group
- The group for the icon, see KIcon.Groupstate
- The icon's state, see KIcon.States
public org.kde.qt.QPixmap apply(org.kde.qt.QPixmap src, int effect, float value, org.kde.qt.QColor rgb, boolean trans)
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.
public org.kde.qt.QPixmap apply(org.kde.qt.QPixmap src, int effect, float value, org.kde.qt.QColor rgb, org.kde.qt.QColor rgb2, boolean trans)
public org.kde.qt.QImage doublePixels(org.kde.qt.QImage src)
src
- the image.
public static void visualActivate(org.kde.qt.QWidget widget, org.kde.qt.QRect rect)
widget
- The widget on which the effect should be paintedrect
- This rectangle defines the effect's borderspublic static void toGray(org.kde.qt.QImage image, float value)
image
- The imagevalue
- Strength of the effect. 0 <= value
<= 1public static void colorize(org.kde.qt.QImage image, org.kde.qt.QColor col, float value)
image
- The imagecol
- The color with which the image
is tintedvalue
- Strength of the effect. 0 <= value
<= 1public static void toMonochrome(org.kde.qt.QImage image, org.kde.qt.QColor black, org.kde.qt.QColor white, float value)
image
- The imagewhite
- The color with which the white parts of image
are paintedblack
- The color with which the black parts of image
are paintedvalue
- Strength of the effect. 0 <= value
<= 1public static void deSaturate(org.kde.qt.QImage image, float value)
image
- The imagevalue
- Strength of the effect. 0 <= value
<= 1public static void toGamma(org.kde.qt.QImage image, float value)
image
- The imagevalue
- Strength of the effect. 0 <= value
<= 1public static void semiTransparent(org.kde.qt.QImage image)
image
- The imagepublic static void semiTransparent(org.kde.qt.QPixmap pixmap)
pixmap
- The pixmappublic static void overlay(org.kde.qt.QImage src, org.kde.qt.QImage overlay)
src
- The imageoverlay
- The image to overlay src
withprotected void finalize() throws java.lang.InternalError
finalize
in class java.lang.Object
java.lang.InternalError
public void dispose()
public boolean isDisposed()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |