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

kdefx

Public Types | Static Public Member Functions
KPixmapEffect Class Reference

#include <kpixmapeffect.h>

List of all members.

Public Types

enum  GradientType {
  VerticalGradient, HorizontalGradient, DiagonalGradient, CrossDiagonalGradient,
  PyramidGradient, RectangleGradient, PipeCrossGradient, EllipticGradient
}
enum  RGBComponent { Red, Green, Blue }
enum  Lighting {
  NorthLite, NWLite, WestLite, SWLite,
  SouthLite, SELite, EastLite, NELite
}

Static Public Member Functions

static KPixmap & gradient (KPixmap &pixmap, const TQColor &ca, const TQColor &cb, GradientType type, int ncols=3)
static KPixmap & unbalancedGradient (KPixmap &pixmap, const TQColor &ca, const TQColor &cb, GradientType type, int xfactor=100, int yfactor=100, int ncols=3)
static KPixmap createTiled (const KPixmap &pixmap, TQSize size)
static KPixmap & intensity (KPixmap &pixmap, float ratio)
static KPixmap & channelIntensity (KPixmap &pixmap, float ratio, RGBComponent channel)
static KPixmap & blend (KPixmap &pixmap, float initial_intensity, const TQColor &bgnd, GradientType eff, bool anti_dir=false, int ncols=3)
static KPixmap & hash (KPixmap &pixmap, Lighting lite=NorthLite, unsigned int spacing=0, int ncols=3)
static KPixmap pattern (const KPixmap &pixmap, TQSize size, const TQColor &ca, const TQColor &cb, int ncols=8)
static KPixmap & fade (KPixmap &pixmap, double val, const TQColor &color)
static KPixmap & toGray (KPixmap &pixmap, bool fast=false)
static KPixmap & desaturate (KPixmap &pixmap, float desat=0.3)
static KPixmap & contrast (KPixmap &pixmap, int c)
static KPixmap & dither (KPixmap &pixmap, const TQColor *palette, int size)
static KPixmap selectedPixmap (const KPixmap &pixmap, const TQColor &col)

Detailed Description

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.

Definition at line 27 of file kpixmapeffect.h.


Member Function Documentation

KPixmap & KPixmapEffect::blend ( KPixmap &  pixmap,
float  initial_intensity,
const TQColor &  bgnd,
GradientType  eff,
bool  anti_dir = false,
int  ncols = 3 
) [static]

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

Parameters:
pixmapThe pixmap to process.
initial_intensitythis 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
bgndIndicates the color of the background to blend in.
effLets you choose what kind of blending you like.
anti_dirBlend in the opposite direction (makes no much sense with concentric blending effects).
ncolsThe number of colors to dither the pixmap to. Only used for 8 bpp pixmaps.
Returns:
Returns the pixmap(), provided for convenience.

Definition at line 140 of file kpixmapeffect.cpp.

KPixmap & KPixmapEffect::channelIntensity ( KPixmap &  pixmap,
float  ratio,
RGBComponent  channel 
) [static]

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

Parameters:
pixmapThe pixmap to process.
ratiovalue. Use negative value to dim.
channelWhich channel(s) should be modified
Returns:
Returns the pixmap(), provided for convenience.

Definition at line 121 of file kpixmapeffect.cpp.

KPixmap & KPixmapEffect::contrast ( KPixmap &  pixmap,
int  c 
) [static]

Modifies the contrast of a pixmap.

Parameters:
pixmapThe pixmap to process.
cA contrast value between -255 and 255.
Returns:
Returns the pixmap(), provided for convenience.

Definition at line 287 of file kpixmapeffect.cpp.

KPixmap KPixmapEffect::createTiled ( const KPixmap &  pixmap,
TQSize  size 
) [static]

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:
pixmapThis is the source pixmap
sizeThe size the new pixmap should have.
Returns:
The generated, tiled pixmap.

Definition at line 240 of file kpixmapeffect.cpp.

KPixmap & KPixmapEffect::desaturate ( KPixmap &  pixmap,
float  desat = 0.3 
) [static]

Desaturates a pixmap.

Parameters:
pixmapThe pixmap to process.
desatA value between 0 and 1 setting the degree of desaturation
Returns:
Returns The pixmap(), provided for convenience.

Definition at line 278 of file kpixmapeffect.cpp.

KPixmap & KPixmapEffect::dither ( KPixmap &  pixmap,
const TQColor *  palette,
int  size 
) [static]

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

Parameters:
pixmapThe pixmap to process.
paletteThe color palette to use.
sizeThe size of the palette.
Returns:
Returns the pixmap(), provided for convenience.

Definition at line 303 of file kpixmapeffect.cpp.

KPixmap & KPixmapEffect::fade ( KPixmap &  pixmap,
double  val,
const TQColor &  color 
) [static]

Fades a pixmap to a certain color.

Parameters:
pixmapThe pixmap to process.
valThe strength of the effect. 0 <= val <= 1.
colorThe color to blend to.
Returns:
Returns the pixmap(), provided for convenience.

Definition at line 257 of file kpixmapeffect.cpp.

KPixmap & KPixmapEffect::gradient ( KPixmap &  pixmap,
const TQColor &  ca,
const TQColor &  cb,
GradientType  type,
int  ncols = 3 
) [static]

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

Parameters:
pixmapThe pixmap to process.
caColor a.
cbColor b.
typeThe type of gradient.
ncolsThe 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.

Definition at line 24 of file kpixmapeffect.cpp.

KPixmap & KPixmapEffect::hash ( KPixmap &  pixmap,
Lighting  lite = NorthLite,
unsigned int  spacing = 0,
int  ncols = 3 
) [static]

Builds a hash on any given pixmap.

Parameters:
pixmapThe pixmap to process.
liteThe hash faces the indicated lighting (cardinal poles)
spacingHow many unmodified pixels inbetween hashes.
ncolsThe number of colors to dither the pixmap to. Only used for 8 bpp pixmaps.
Returns:
Returns The pixmap(), provided for convenience.

Definition at line 179 of file kpixmapeffect.cpp.

KPixmap & KPixmapEffect::intensity ( KPixmap &  pixmap,
float  ratio 
) [static]

Either brightens or dims a pixmap by a specified ratio.

Parameters:
pixmapThe pixmap to process.
ratioThe ratio to use. Use negative value to dim.
Returns:
Returns The pixmap(), provided for convenience.

Definition at line 109 of file kpixmapeffect.cpp.

KPixmap KPixmapEffect::pattern ( const KPixmap &  pixmap,
TQSize  size,
const TQColor &  ca,
const TQColor &  cb,
int  ncols = 8 
) [static]

Creates a pattern from a pixmap.

The given pixmap is "flattened" between color a to color b. Doesn't change the original pixmap.

Parameters:
pixmapThe pixmap to process.
sizeThe size of the returned pixmap. If size is larger than the original, the resulting pixmap will be tiled.
caColor a.
cbColor b.
ncolsThe number of colors to use. The image will be dithered to this depth. Pass zero to prevent dithering.
Returns:
The resulting pixmap.

Definition at line 223 of file kpixmapeffect.cpp.

KPixmap KPixmapEffect::selectedPixmap ( const KPixmap &  pixmap,
const TQColor &  col 
) [static]

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

Parameters:
pixmapthe pixmap to select
colthe selected color, usually from TQColorGroup::highlight().

Definition at line 318 of file kpixmapeffect.cpp.

KPixmap & KPixmapEffect::toGray ( KPixmap &  pixmap,
bool  fast = false 
) [static]

Converts a pixmap to grayscale.

Parameters:
pixmapThe pixmap to process.
fastSet 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.

Definition at line 268 of file kpixmapeffect.cpp.

KPixmap & KPixmapEffect::unbalancedGradient ( KPixmap &  pixmap,
const TQColor &  ca,
const TQColor &  cb,
GradientType  type,
int  xfactor = 100,
int  yfactor = 100,
int  ncols = 3 
) [static]

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:
pixmapThe pixmap that should be written.
caColor a.
cbColor b.
typeThe type of gradient.
xfactorThe x decay length. Use a value between -200 and 200.
yfactorThe y decay length.
ncolsThe number of colors. See gradient.
Returns:
The generated pixmap, for convencience.

Definition at line 88 of file kpixmapeffect.cpp.


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

kdefx

Skip menu "kdefx"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdefx

Skip menu "kdefx"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdefx by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |