Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Opie::Ui::OPixmapEffect Class Reference

#include </home/clem/local/src/opie/libopie2/opieui/opixmapeffect.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 OPixmapgradient (OPixmap &pixmap, const QColor &ca, const QColor &cb, GradientType type, int ncols=3)
static OPixmapunbalancedGradient (OPixmap &pixmap, const QColor &ca, const QColor &cb, GradientType type, int xfactor=100, int yfactor=100, int ncols=3)
static OPixmap createTiled (const OPixmap &pixmap, QSize size)
static OPixmapintensity (OPixmap &pixmap, float ratio)
static OPixmapchannelIntensity (OPixmap &pixmap, float ratio, RGBComponent channel)
static OPixmapblend (OPixmap &pixmap, float initial_intensity, const QColor &bgnd, GradientType eff, bool anti_dir=false, int ncols=3)
static OPixmaphash (OPixmap &pixmap, Lighting lite=NorthLite, unsigned int spacing=0, int ncols=3)
static OPixmap pattern (const OPixmap &pixmap, QSize size, const QColor &ca, const QColor &cb, int ncols=8)
static OPixmapfade (OPixmap &pixmap, double val, const QColor &color)
static OPixmaptoGray (OPixmap &pixmap, bool fast=false)
static OPixmapdesaturate (OPixmap &pixmap, float desat=0.3)
static OPixmapcontrast (OPixmap &pixmap, int c)
static OPixmapdither (OPixmap &pixmap, const QColor *palette, int size)
static OPixmap selectedPixmap (const OPixmap &pixmap, const QColor &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 29 of file opixmapeffect.h.


Member Enumeration Documentation

enum Opie::Ui::OPixmapEffect::GradientType
 

Enumeration values:
VerticalGradient 
HorizontalGradient 
DiagonalGradient 
CrossDiagonalGradient 
PyramidGradient 
RectangleGradient 
PipeCrossGradient 
EllipticGradient 

Definition at line 32 of file opixmapeffect.h.

enum Opie::Ui::OPixmapEffect::Lighting
 

Enumeration values:
NorthLite 
NWLite 
WestLite 
SWLite 
SouthLite 
SELite 
EastLite 
NELite 

Definition at line 38 of file opixmapeffect.h.

enum Opie::Ui::OPixmapEffect::RGBComponent
 

Enumeration values:
Red 
Green 
Blue 

Definition at line 36 of file opixmapeffect.h.


Member Function Documentation

OPixmap & OPixmapEffect::blend OPixmap pixmap,
float  initial_intensity,
const QColor &  bgnd,
GradientType  eff,
bool  anti_dir = false,
int  ncols = 3
[static]
 

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).
Returns:
Returns the pixmap(), provided for convenience.

Definition at line 145 of file opixmapeffect.cpp.

References Opie::Ui::OImageEffect::blend(), Opie::Ui::OImageEffect::dither(), i, and image.

OPixmap & OPixmapEffect::channelIntensity OPixmap pixmap,
float  ratio,
RGBComponent  channel
[static]
 

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.

Definition at line 126 of file opixmapeffect.cpp.

References Opie::Ui::OImageEffect::channelIntensity(), and image.

OPixmap & OPixmapEffect::contrast OPixmap pixmap,
int  c
[static]
 

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.

Definition at line 292 of file opixmapeffect.cpp.

References contrast.

OPixmap OPixmapEffect::createTiled const OPixmap pixmap,
QSize  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:
pixmap This is the source pixmap
size The size the new pixmap should have.
Returns:
The generated, tiled pixmap.

Definition at line 245 of file opixmapeffect.cpp.

References p, and pix.

Referenced by pattern().

OPixmap & OPixmapEffect::desaturate OPixmap pixmap,
float  desat = 0.3
[static]
 

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.

Definition at line 283 of file opixmapeffect.cpp.

References Opie::Ui::OImageEffect::desaturate().

OPixmap & OPixmapEffect::dither OPixmap pixmap,
const QColor *  palette,
int  size
[static]
 

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.

Definition at line 308 of file opixmapeffect.cpp.

References Opie::Ui::OImageEffect::dither().

OPixmap & OPixmapEffect::fade OPixmap pixmap,
double  val,
const QColor &  color
[static]
 

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.

Definition at line 262 of file opixmapeffect.cpp.

References Opie::Ui::OImageEffect::fade().

OPixmap & OPixmapEffect::gradient OPixmap pixmap,
const QColor &  ca,
const QColor &  cb,
GradientType  type,
int  ncols = 3
[static]
 

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.

Definition at line 29 of file opixmapeffect.cpp.

References Opie::Ui::OImageEffect::gradient(), HorizontalGradient, image, p, VerticalGradient, Opie::MM::x, and Opie::MM::y.

OPixmap & OPixmapEffect::hash OPixmap pixmap,
Lighting  lite = NorthLite,
unsigned int  spacing = 0,
int  ncols = 3
[static]
 

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.
Returns:
Returns The pixmap(), provided for convenience.

Definition at line 184 of file opixmapeffect.cpp.

References Opie::Ui::OImageEffect::dither(), Opie::Ui::OImageEffect::hash(), i, and image.

OPixmap & OPixmapEffect::intensity OPixmap pixmap,
float  ratio
[static]
 

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.

Definition at line 114 of file opixmapeffect.cpp.

References image, and Opie::Ui::OImageEffect::intensity().

OPixmap OPixmapEffect::pattern const OPixmap pixmap,
QSize  size,
const QColor &  ca,
const QColor &  cb,
int  ncols = 8
[static]
 

Creates a pattern from a pixmap.

The given pixmap is "flattened" between color a to color b.

Parameters:
pixmap The pixmap to process.
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 pixmap(), provided for convenience.

Definition at line 228 of file opixmapeffect.cpp.

References createTiled(), and Opie::Ui::OImageEffect::flatten().

OPixmap OPixmapEffect::selectedPixmap const OPixmap pixmap,
const QColor &  col
[static]
 

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().

Definition at line 323 of file opixmapeffect.cpp.

References Opie::Ui::OImageEffect::selectedImage().

OPixmap & OPixmapEffect::toGray OPixmap pixmap,
bool  fast = false
[static]
 

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.

Definition at line 273 of file opixmapeffect.cpp.

References Opie::Ui::OImageEffect::toGray().

OPixmap & OPixmapEffect::unbalancedGradient OPixmap pixmap,
const QColor &  ca,
const QColor &  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:
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.

Definition at line 93 of file opixmapeffect.cpp.

References image, and Opie::Ui::OImageEffect::unbalancedGradient().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 18:01:59 2005 for OPIE by  doxygen 1.4.2