org.kde.koala

Class KPixmapEffect

public class KPixmapEffect extends Object implements QtSupport

This class includes various pixmap-based graphical effects. Everything is static, so there is no need to create an instance of this class. You can just call the static methods. They are encapsulated here merely to provide a common namespace.

UNKNOWN: This class includes various pixmap-based graphical effects.

Field Summary
static intBlue
static intCrossDiagonalGradient
static intDiagonalGradient
static intEastLite
static intEllipticGradient
static intGreen
static intHorizontalGradient
static intNELite
static intNorthLite
static intNWLite
static intPipeCrossGradient
static intPyramidGradient
static intRectangleGradient
static intRed
static intSELite
static intSouthLite
static intSWLite
static intVerticalGradient
static intWestLite
Constructor Summary
protected KPixmapEffect(Class dummy)
KPixmapEffect()
Method Summary
static KPixmapblend(KPixmap pixmap, float initial_intensity, QColor bgnd, int eff, boolean anti_dir, int ncols)
Blends the provided pixmap into a background of the indicated color.
static KPixmapblend(KPixmap pixmap, float initial_intensity, QColor bgnd, int eff, boolean anti_dir)
static KPixmapblend(KPixmap pixmap, float initial_intensity, QColor bgnd, int eff)
static KPixmapchannelIntensity(KPixmap pixmap, float ratio, int channel)
Modifies the intensity of a pixmap's RGB channel component.
static KPixmapcontrast(KPixmap pixmap, int c)
Modifies the contrast of a pixmap.
static KPixmapcreateTiled(KPixmap pixmap, QSize size)
Creates a pixmap of a given size with the given pixmap. if the given size is bigger than the size of the pixmap, the pixmap is tiled.
static KPixmapdesaturate(KPixmap pixmap, float desat)
Desaturates a pixmap.
static KPixmapdesaturate(KPixmap pixmap)
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
static KPixmapdither(KPixmap pixmap, QColor palette, int size)
Dithers a pixmap using Floyd-Steinberg dithering for low-color situations.
static KPixmapfade(KPixmap pixmap, double val, QColor color)
Fades a pixmap to a certain color.
protected voidfinalize()
Deletes the wrapped C++ instance
static KPixmapgradient(KPixmap pixmap, QColor ca, QColor cb, int type, int ncols)
Creates a gradient from color a to color b of the specified type.
static KPixmapgradient(KPixmap pixmap, QColor ca, QColor cb, int type)
static KPixmaphash(KPixmap pixmap, int lite, int spacing, int ncols)
Builds a hash on any given pixmap.
static KPixmaphash(KPixmap pixmap, int lite, int spacing)
static KPixmaphash(KPixmap pixmap, int lite)
static KPixmaphash(KPixmap pixmap)
static KPixmapintensity(KPixmap pixmap, float ratio)
Either brightens or dims a pixmap by a specified ratio.
booleanisDisposed()
Has the wrapped C++ instance been deleted?
static KPixmappattern(KPixmap pixmap, QSize size, QColor ca, QColor cb, int ncols)
Creates a pattern from a pixmap.
static KPixmappattern(KPixmap pixmap, QSize size, QColor ca, QColor cb)
static KPixmapselectedPixmap(KPixmap pixmap, QColor col)
Calculate a 'selected' pixmap, for instance a selected icon on the desktop.
static KPixmaptoGray(KPixmap pixmap, boolean fast)
Converts a pixmap to grayscale.
static KPixmaptoGray(KPixmap pixmap)
static KPixmapunbalancedGradient(KPixmap pixmap, QColor ca, QColor cb, int type, int xfactor, int yfactor, int ncols)
Creates an unbalanced gradient.
static KPixmapunbalancedGradient(KPixmap pixmap, QColor ca, QColor cb, int type, int xfactor, int yfactor)
static KPixmapunbalancedGradient(KPixmap pixmap, QColor ca, QColor cb, int type, int xfactor)
static KPixmapunbalancedGradient(KPixmap pixmap, QColor ca, QColor cb, int type)

Field Detail

Blue

public static final int Blue

CrossDiagonalGradient

public static final int CrossDiagonalGradient

DiagonalGradient

public static final int DiagonalGradient

EastLite

public static final int EastLite

EllipticGradient

public static final int EllipticGradient

Green

public static final int Green

HorizontalGradient

public static final int HorizontalGradient

NELite

public static final int NELite

NorthLite

public static final int NorthLite

NWLite

public static final int NWLite

PipeCrossGradient

public static final int PipeCrossGradient

PyramidGradient

public static final int PyramidGradient

RectangleGradient

public static final int RectangleGradient

Red

public static final int Red

SELite

public static final int SELite

SouthLite

public static final int SouthLite

SWLite

public static final int SWLite

VerticalGradient

public static final int VerticalGradient

WestLite

public static final int WestLite

Constructor Detail

KPixmapEffect

protected KPixmapEffect(Class dummy)

KPixmapEffect

public KPixmapEffect()

Method Detail

blend

public static KPixmap blend(KPixmap pixmap, float initial_intensity, QColor bgnd, int eff, boolean anti_dir, int ncols)
Blends the provided pixmap into a background of the indicated color.

Parameters: pixmap The pixmap to process. initial_intensity this parameter takes values from -1 to 1:

  • If positive, it tells how much to fade the image in its less affected spot.
  • If negative, it tells roughly indicates how much of the image remains unaffected
  • bgnd Indicates the color of the background to blend in. eff Lets you choose what kind of blending you like. anti_dir Blend in the opposite direction (makes no much sense with concentric blending effects). ncols The number of colors to dither the pixmap to. Only used for 8 bpp pixmaps.

    Returns: Returns the pixmap(), provided for convenience.

    UNKNOWN: Blends the provided pixmap into a background of the indicated color.

    blend

    public static KPixmap blend(KPixmap pixmap, float initial_intensity, QColor bgnd, int eff, boolean anti_dir)

    blend

    public static KPixmap blend(KPixmap pixmap, float initial_intensity, QColor bgnd, int eff)

    channelIntensity

    public static KPixmap channelIntensity(KPixmap pixmap, float ratio, int channel)
    Modifies the intensity of a pixmap's RGB channel component.

    Parameters: pixmap The pixmap to process. ratio value. Use negative value to dim. channel Which channel(s) should be modified

    Returns: Returns the pixmap(), provided for convenience.

    UNKNOWN: Modifies the intensity of a pixmap's RGB channel component.

    contrast

    public static KPixmap contrast(KPixmap pixmap, int c)
    Modifies the contrast of a pixmap.

    Parameters: pixmap The pixmap to process. c A contrast value between -255 and 255.

    Returns: Returns the pixmap(), provided for convenience.

    UNKNOWN: Modifies the contrast of a pixmap.

    createTiled

    public static KPixmap createTiled(KPixmap pixmap, QSize size)
    Creates a pixmap of a given size with the given pixmap. if the given size is bigger than the size of the pixmap, the pixmap is tiled.

    Parameters: pixmap This is the source pixmap size The size the new pixmap should have.

    Returns: The generated, tiled pixmap.

    UNKNOWN: Creates a pixmap of a given size with the given pixmap.

    desaturate

    public static KPixmap desaturate(KPixmap pixmap, float desat)
    Desaturates a pixmap.

    Parameters: pixmap The pixmap to process. desat A value between 0 and 1 setting the degree of desaturation

    Returns: Returns The pixmap(), provided for convenience.

    UNKNOWN: Desaturates a pixmap.

    desaturate

    public static KPixmap desaturate(KPixmap pixmap)

    dispose

    public void dispose()
    Delete the wrapped C++ instance ahead of finalize()

    dither

    public static KPixmap dither(KPixmap pixmap, QColor palette, int size)
    Dithers a pixmap using Floyd-Steinberg dithering for low-color situations.

    Parameters: pixmap The pixmap to process. palette The color palette to use. size The size of the palette.

    Returns: Returns the pixmap(), provided for convenience.

    UNKNOWN: Dithers a pixmap using Floyd-Steinberg dithering for low-color situations.

    fade

    public static KPixmap fade(KPixmap pixmap, double val, QColor color)
    Fades a pixmap to a certain color.

    Parameters: pixmap The pixmap to process. val The strength of the effect. 0 <= val <= 1. color The color to blend to.

    Returns: Returns the pixmap(), provided for convenience.

    UNKNOWN: Fades a pixmap to a certain color.

    finalize

    protected void finalize()
    Deletes the wrapped C++ instance

    gradient

    public static KPixmap gradient(KPixmap pixmap, QColor ca, QColor cb, int type, int ncols)
    Creates a gradient from color a to color b of the specified type.

    Parameters: pixmap The pixmap to process. ca Color a. cb Color b. type The type of gradient. ncols The number of colors to use when not running on a truecolor display. The gradient will be dithered to this number of colors. Pass 0 to prevent dithering.

    Returns: Returns the generated pixmap, for convenience.

    UNKNOWN: Creates a gradient from color a to color b of the specified type.

    gradient

    public static KPixmap gradient(KPixmap pixmap, QColor ca, QColor cb, int type)

    hash

    public static KPixmap hash(KPixmap pixmap, int lite, int spacing, int ncols)
    Builds a hash on any given pixmap.

    Parameters: pixmap The pixmap to process. lite The hash faces the indicated lighting (cardinal poles) spacing How many unmodified pixels inbetween hashes. ncols The number of colors to dither the pixmap to. Only used for 8 bpp pixmaps.

    Returns: Returns The pixmap(), provided for convenience.

    UNKNOWN: Builds a hash on any given pixmap.

    hash

    public static KPixmap hash(KPixmap pixmap, int lite, int spacing)

    hash

    public static KPixmap hash(KPixmap pixmap, int lite)

    hash

    public static KPixmap hash(KPixmap pixmap)

    intensity

    public static KPixmap intensity(KPixmap pixmap, float ratio)
    Either brightens or dims a pixmap by a specified ratio.

    Parameters: pixmap The pixmap to process. ratio The ratio to use. Use negative value to dim.

    Returns: Returns The pixmap(), provided for convenience.

    UNKNOWN: Either brightens or dims a pixmap by a specified ratio.

    isDisposed

    public boolean isDisposed()
    Has the wrapped C++ instance been deleted?

    pattern

    public static KPixmap pattern(KPixmap pixmap, QSize size, QColor ca, QColor cb, int ncols)
    Creates a pattern from a pixmap. The given pixmap is "flattened" between color a to color b. Doesn't change the original pixmap.

    Parameters: pixmap The pixmap to process. size The size of the returned pixmap. If size is larger than the original, the resulting pixmap will be tiled. ca Color a. cb Color b. ncols The number of colors to use. The image will be dithered to this depth. Pass zero to prevent dithering.

    Returns: The resulting pixmap.

    UNKNOWN: Creates a pattern from a pixmap.

    pattern

    public static KPixmap pattern(KPixmap pixmap, QSize size, QColor ca, QColor cb)

    selectedPixmap

    public static KPixmap selectedPixmap(KPixmap pixmap, QColor col)
    Calculate a 'selected' pixmap, for instance a selected icon on the desktop.

    Parameters: pixmap the pixmap to select col the selected color, usually from QColorGroup.highlight().

    UNKNOWN: Calculate a 'selected' pixmap, for instance a selected icon on the desktop.

    toGray

    public static KPixmap toGray(KPixmap pixmap, boolean fast)
    Converts a pixmap to grayscale.

    Parameters: pixmap The pixmap to process. fast Set to true in order to use a faster but non-photographic quality algorithm. Appropriate for things such as toolbar icons.

    Returns: Returns the pixmap(), provided for convenience.

    UNKNOWN: Converts a pixmap to grayscale.

    toGray

    public static KPixmap toGray(KPixmap pixmap)

    unbalancedGradient

    public static KPixmap unbalancedGradient(KPixmap pixmap, QColor ca, QColor cb, int type, int xfactor, int yfactor, int ncols)
    Creates an unbalanced gradient. An unbalanced gradient is a gradient where the transition from color a to color b is not linear, but in this case, exponential.

    Parameters: pixmap The pixmap that should be written. ca Color a. cb Color b. type The type of gradient. xfactor The x decay length. Use a value between -200 and 200. yfactor The y decay length. ncols The number of colors. See #gradient.

    Returns: The generated pixmap, for convencience.

    UNKNOWN: Creates an unbalanced gradient.

    unbalancedGradient

    public static KPixmap unbalancedGradient(KPixmap pixmap, QColor ca, QColor cb, int type, int xfactor, int yfactor)

    unbalancedGradient

    public static KPixmap unbalancedGradient(KPixmap pixmap, QColor ca, QColor cb, int type, int xfactor)

    unbalancedGradient

    public static KPixmap unbalancedGradient(KPixmap pixmap, QColor ca, QColor cb, int type)