summaryrefslogtreecommitdiff
path: root/libopie2/opieui
Unidiff
Diffstat (limited to 'libopie2/opieui') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/oimageeffect.h6
-rw-r--r--libopie2/opieui/opixmapeffect.h11
2 files changed, 6 insertions, 11 deletions
diff --git a/libopie2/opieui/oimageeffect.h b/libopie2/opieui/oimageeffect.h
index 4f86d5b..4422741 100644
--- a/libopie2/opieui/oimageeffect.h
+++ b/libopie2/opieui/oimageeffect.h
@@ -174,186 +174,186 @@ public:
174 */ 174 */
175 static QImage& blend(QImage &image1, QImage &image2, 175 static QImage& blend(QImage &image1, QImage &image2,
176 QImage &blendImage, RGBComponent channel); 176 QImage &blendImage, RGBComponent channel);
177 177
178 /** 178 /**
179 * Blend an image into another one, using alpha in the expected way. 179 * Blend an image into another one, using alpha in the expected way.
180 * @author Rik Hemsley (rikkus) <rik@kde.org> 180 * @author Rik Hemsley (rikkus) <rik@kde.org>
181 */ 181 */
182 static bool blend(const QImage & upper, const QImage & lower, QImage & output); 182 static bool blend(const QImage & upper, const QImage & lower, QImage & output);
183// Not yet... static bool blend(const QImage & image1, const QImage & image2, QImage & output, const QRect & destRect); 183// Not yet... static bool blend(const QImage & image1, const QImage & image2, QImage & output, const QRect & destRect);
184 184
185 /** 185 /**
186 * Blend an image into another one, using alpha in the expected way and 186 * Blend an image into another one, using alpha in the expected way and
187 * over coordinates @p x and @p y with respect to the lower image. 187 * over coordinates @p x and @p y with respect to the lower image.
188 * The output is a QImage which is the @p upper image already blended 188 * The output is a QImage which is the @p upper image already blended
189 * with the @p lower one, so its size will be (in general) the same than 189 * with the @p lower one, so its size will be (in general) the same than
190 * @p upper instead of the same size than @p lower like the method above. 190 * @p upper instead of the same size than @p lower like the method above.
191 * In fact, the size of @p output is like upper's one only when it can be 191 * In fact, the size of @p output is like upper's one only when it can be
192 * painted on lower, if there has to be some clipping, output's size will 192 * painted on lower, if there has to be some clipping, output's size will
193 * be the clipped area and x and y will be set to the correct up-left corner 193 * be the clipped area and x and y will be set to the correct up-left corner
194 * where the clipped rectangle begins. 194 * where the clipped rectangle begins.
195 */ 195 */
196 static bool blend(int &x, int &y, const QImage & upper, const QImage & lower, QImage & output); 196 static bool blend(int &x, int &y, const QImage & upper, const QImage & lower, QImage & output);
197 /** 197 /**
198 * Blend an image into another one, using alpha in the expected way and 198 * Blend an image into another one, using alpha in the expected way and
199 * over coordinates @p x and @p y with respect to the lower image. 199 * over coordinates @p x and @p y with respect to the lower image.
200 * The output is painted in the own @p lower image. This is an optimization 200 * The output is painted in the own @p lower image. This is an optimization
201 * of the blend method above provided by convenience. 201 * of the blend method above provided by convenience.
202 */ 202 */
203 static bool blendOnLower(int x, int y, const QImage & upper, const QImage & lower); 203 static bool blendOnLower(int x, int y, const QImage & upper, const QImage & lower);
204 204
205 /** 205 /**
206 * Modifies the intensity of a pixmap's RGB channel component. 206 * Modifies the intensity of a pixmap's RGB channel component.
207 * 207 *
208 * @author Daniel M. Duley (mosfet) 208 * @author Daniel M. Duley (mosfet)
209 * @param image The QImage to process. 209 * @param image The QImage to process.
210 * @param percent Percent value. Use a negative value to dim. 210 * @param percent Percent value. Use a negative value to dim.
211 * @param channel Which channel(s) should be modified 211 * @param channel Which channel(s) should be modified
212 * @return The @p image, provided for convenience. 212 * @return The @p image, provided for convenience.
213 */ 213 */
214 static QImage& channelIntensity(QImage &image, float percent, 214 static QImage& channelIntensity(QImage &image, float percent,
215 RGBComponent channel); 215 RGBComponent channel);
216 216
217 /** 217 /**
218 * Fade an image to a certain background color. 218 * Fade an image to a certain background color.
219 * 219 *
220 * The number of colors will not be changed. 220 * The number of colors will not be changed.
221 * 221 *
222 * @param image The QImage to process. 222 * @param img The QImage to process.
223 * @param val The strength of the effect. 0 <= val <= 1. 223 * @param val The strength of the effect. 0 <= val <= 1.
224 * @param color The background color. 224 * @param color The background color.
225 * @return Returns the @ref image(), provided for convenience. 225 * @return Returns the @ref image(), provided for convenience.
226 */ 226 */
227 static QImage& fade(QImage &img, float val, const QColor &color); 227 static QImage& fade(QImage &img, float val, const QColor &color);
228 228
229 229
230 /** 230 /**
231 * This recolors a pixmap. The most dark color will become color a, 231 * This recolors a pixmap. The most dark color will become color a,
232 * the most bright one color b, and in between. 232 * the most bright one color b, and in between.
233 * 233 *
234 * @param image A QImage to process. 234 * @param image A QImage to process.
235 * @param ca Color a 235 * @param ca Color a
236 * @param cb Color b 236 * @param cb Color b
237 */ 237 */
238 static QImage& flatten(QImage &image, const QColor &ca, 238 static QImage& flatten(QImage &image, const QColor &ca,
239 const QColor &cb, int ncols=0); 239 const QColor &cb, int ncols=0);
240 240
241 /** 241 /**
242 * Build a hash on any given @ref QImage 242 * Build a hash on any given @ref QImage
243 * 243 *
244 * @param image The QImage to process 244 * @param image The QImage to process
245 * @param lite The hash faces the indicated lighting (cardinal poles). 245 * @param lite The hash faces the indicated lighting (cardinal poles).
246 * @param spacing How many unmodified pixels inbetween hashes. 246 * @param spacing How many unmodified pixels inbetween hashes.
247 * @return Returns the @ref image(), provided for convenience. 247 * @return Returns the @ref image(), provided for convenience.
248 */ 248 */
249 static QImage& hash(QImage &image, Lighting lite=NorthLite, 249 static QImage& hash(QImage &image, Lighting lite=NorthLite,
250 unsigned int spacing=0); 250 unsigned int spacing=0);
251 251
252 /** 252 /**
253 * Either brighten or dim the image by a specified percent. 253 * Either brighten or dim the image by a specified percent.
254 * For example, .50 will modify the colors by 50%. 254 * For example, .50 will modify the colors by 50%.
255 * 255 *
256 * @author Daniel M. Duley (mosfet) 256 * @author Daniel M. Duley (mosfet)
257 * @param image The QImage to process. 257 * @param image The QImage to process.
258 * @param percent The percent value. Use a negative value to dim. 258 * @param percent The percent value. Use a negative value to dim.
259 * @return Returns The @ref image(), provided for convenience. 259 * @return Returns The @ref image(), provided for convenience.
260 */ 260 */
261 static QImage& intensity(QImage &image, float percent); 261 static QImage& intensity(QImage &image, float percent);
262 262
263 /** 263 /**
264 * Modulate the image with a color channel of another image. 264 * Modulate the image with a color channel of another image.
265 * 265 *
266 * @param image The QImage to modulate and result. 266 * @param image The QImage to modulate and result.
267 * @param modImage The QImage to use for modulation. 267 * @param modImage The QImage to use for modulation.
268 * @param reverse Invert the meaning of image/modImage; result is image! 268 * @param reverse Invert the meaning of image/modImage; result is image!
269 * @param type The modulation Type to use. 269 * @param type The modulation Type to use.
270 * @param factor The modulation amplitude; with 0 no effect [-200;200]. 270 * @param factor The modulation amplitude; with 0 no effect [-200;200].
271 * @param channel The RBG channel of image2 to use for modulation. 271 * @param channel The RBG channel of image2 to use for modulation.
272 * @return Returns the @ref image(), provided for convenience. 272 * @return Returns the @ref image(), provided for convenience.
273 */ 273 */
274 static QImage& modulate(QImage &image, QImage &modImage, bool reverse, 274 static QImage& modulate(QImage &image, QImage &modImage, bool reverse,
275 ModulationType type, int factor, RGBComponent channel); 275 ModulationType type, int factor, RGBComponent channel);
276 276
277 /** 277 /**
278 * Convert an image to grayscale. 278 * Convert an image to grayscale.
279 * 279 *
280 * @author Daniel M. Duley (mosfet) 280 * @author Daniel M. Duley (mosfet)
281 * @param image The @ref QImage to process. 281 * @param image The @ref QImage to process.
282 * @param fast Set to @p true in order to use a faster but non-photographic 282 * @param fast Set to @p true in order to use a faster but non-photographic
283 * quality algorithm. Appropriate for things such as toolbar icons. 283 * quality algorithm. Appropriate for things such as toolbar icons.
284 * @return Returns the @ref image(), provided for convenience. 284 * @return Returns the @ref image(), provided for convenience.
285 */ 285 */
286 static QImage& toGray(QImage &image, bool fast = false); 286 static QImage& toGray(QImage &image, bool fast = false);
287 287
288 /** 288 /**
289 * Desaturate an image evenly. 289 * Desaturate an image evenly.
290 * 290 *
291 * @param image The QImage to process. 291 * @param image The QImage to process.
292 * @param desat A value between 0 and 1 setting the degree of desaturation 292 * @param desat A value between 0 and 1 setting the degree of desaturation
293 * @return Returns the @ref image(), provided for convenience. 293 * @return Returns the @ref image(), provided for convenience.
294 */ 294 */
295 static QImage& desaturate(QImage &image, float desat = 0.3); 295 static QImage& desaturate(QImage &image, float desat = 0.3);
296 296
297 /** 297 /**
298 * Fast, but low quality contrast of an image. Also see contrastHSV. 298 * Fast, but low quality contrast of an image. Also see contrastHSV.
299 * 299 *
300 * @author Daniel M. Duley (mosfet) 300 * @author Daniel M. Duley (mosfet)
301 * @param image The QImage to process. 301 * @param image The QImage to process.
302 * @param c A contrast value between -255 to 255. 302 * @param c A contrast value between -255 to 255.
303 * @return The @ref image(), provided for convenience. 303 * @return The @ref image(), provided for convenience.
304 */ 304 */
305 static QImage& contrast(QImage &image, int c); 305 static QImage& contrast(QImage &image, int c);
306 306
307 /** 307 /**
308 * Dither an image using Floyd-Steinberg dithering for low-color 308 * Dither an image using Floyd-Steinberg dithering for low-color
309 * situations. 309 * situations.
310 * 310 *
311 * @param image The QImage to process. 311 * @param img The QImage to process.
312 * @param palette The color palette to use 312 * @param palette The color palette to use
313 * @param size The size of the palette 313 * @param size The size of the palette
314 * @return Returns the @ref image(), provided for convenience. 314 * @return Returns the @ref image(), provided for convenience.
315 */ 315 */
316 static QImage& dither(QImage &img, const QColor *palette, int size); 316 static QImage& dither(QImage &img, const QColor *palette, int size);
317 317
318 /** 318 /**
319 * Calculate the image for a selected image, for instance a selected icon 319 * Calculate the image for a selected image, for instance a selected icon
320 * on the desktop. 320 * on the desktop.
321 * @param img the QImage to select 321 * @param img the QImage to select
322 * @param col the selected color, usually from QColorGroup::highlight(). 322 * @param col the selected color, usually from QColorGroup::highlight().
323 */ 323 */
324 static QImage& selectedImage( QImage &img, const QColor &col ); 324 static QImage& selectedImage( QImage &img, const QColor &col );
325 325
326 /** 326 /**
327 * High quality, expensive HSV contrast. You can do a faster one by just 327 * High quality, expensive HSV contrast. You can do a faster one by just
328 * taking a intensity threshold (ie: 128) and incrementing RGB color 328 * taking a intensity threshold (ie: 128) and incrementing RGB color
329 * channels above it and decrementing those below it, but this gives much 329 * channels above it and decrementing those below it, but this gives much
330 * better results. 330 * better results.
331 * 331 *
332 * @author Daniel M. Duley (mosfet) 332 * @author Daniel M. Duley (mosfet)
333 * @param img The QImage to process. 333 * @param img The QImage to process.
334 * @param sharpen If true sharpness is increase, (spiffed). Otherwise 334 * @param sharpen If true sharpness is increase, (spiffed). Otherwise
335 * it is decreased, (dulled). 335 * it is decreased, (dulled).
336 */ 336 */
337 static void contrastHSV(QImage &img, bool sharpen=true); 337 static void contrastHSV(QImage &img, bool sharpen=true);
338 338
339 /** 339 /**
340 * Normalizes the pixel values to span the full range of color values. 340 * Normalizes the pixel values to span the full range of color values.
341 * This is a contrast enhancement technique. 341 * This is a contrast enhancement technique.
342 * @author Daniel M. Duley (mosfet) 342 * @author Daniel M. Duley (mosfet)
343 */ 343 */
344 static void normalize(QImage &img); 344 static void normalize(QImage &img);
345 345
346 /** 346 /**
347 * Performs histogram equalization on the reference 347 * Performs histogram equalization on the reference
348 * image. 348 * image.
349 * @author Daniel M. Duley (mosfet) 349 * @author Daniel M. Duley (mosfet)
350 */ 350 */
351 static void equalize(QImage &img); 351 static void equalize(QImage &img);
352 352
353 /** 353 /**
354 * Thresholds the reference image. You can also threshold images by using 354 * Thresholds the reference image. You can also threshold images by using
355 * ThresholdDither in the various QPixmap/QImage convert methods, but this 355 * ThresholdDither in the various QPixmap/QImage convert methods, but this
356 * lets you specify a threshold value. 356 * lets you specify a threshold value.
357 * 357 *
358 * @author Daniel M. Duley (mosfet) 358 * @author Daniel M. Duley (mosfet)
359 * @param img The QImage to process. 359 * @param img The QImage to process.
@@ -485,80 +485,80 @@ public:
485 * @author Daniel M. Duley (mosfet) 485 * @author Daniel M. Duley (mosfet)
486 * @param src The QImage to process. 486 * @param src The QImage to process.
487 * @param factor The percent weight to give to the center pixel. 487 * @param factor The percent weight to give to the center pixel.
488 * @return The sharpened image. The original is not changed. 488 * @return The sharpened image. The original is not changed.
489 */ 489 */
490 static QImage sharpen(QImage &src, double factor=30.0); 490 static QImage sharpen(QImage &src, double factor=30.0);
491 491
492 /** 492 /**
493 * Randomly displaces pixels. 493 * Randomly displaces pixels.
494 * 494 *
495 * @author Daniel M. Duley (mosfet) 495 * @author Daniel M. Duley (mosfet)
496 * @param src The QImage to process. 496 * @param src The QImage to process.
497 * @param amount The vicinity for choosing a random pixel to swap. 497 * @param amount The vicinity for choosing a random pixel to swap.
498 * @return The image with pixels displaced. The original is not changed. 498 * @return The image with pixels displaced. The original is not changed.
499 */ 499 */
500 static QImage spread(QImage &src, unsigned int amount=3); 500 static QImage spread(QImage &src, unsigned int amount=3);
501 501
502 /** 502 /**
503 * Shades the image using a distance light source. 503 * Shades the image using a distance light source.
504 * 504 *
505 * @author Daniel M. Duley (mosfet) 505 * @author Daniel M. Duley (mosfet)
506 * @param src The QImage to process. 506 * @param src The QImage to process.
507 * @param color_shading If true do color shading, otherwise do grayscale. 507 * @param color_shading If true do color shading, otherwise do grayscale.
508 * @param azimuth Determines the light source and direction. 508 * @param azimuth Determines the light source and direction.
509 * @param elevation Determines the light source and direction. 509 * @param elevation Determines the light source and direction.
510 * @return The shaded image. The original is not changed. 510 * @return The shaded image. The original is not changed.
511 */ 511 */
512 static QImage shade(QImage &src, bool color_shading=true, double azimuth=30.0, 512 static QImage shade(QImage &src, bool color_shading=true, double azimuth=30.0,
513 double elevation=30.0); 513 double elevation=30.0);
514 /** 514 /**
515 * Swirls the image by a specified amount 515 * Swirls the image by a specified amount
516 * 516 *
517 * @author Daniel M. Duley (mosfet) 517 * @author Daniel M. Duley (mosfet)
518 * @param src The QImage to process. 518 * @param src The QImage to process.
519 * @param degrees The tightness of the swirl. 519 * @param degrees The tightness of the swirl.
520 * @param background An RGBA value to use for the background. After the 520 * @param background An RGBA value to use for the background. After the
521 * effect some pixels may be "empty". This value is used for those pixels. 521 * effect some pixels may be "empty". This value is used for those pixels.
522 * @return The swirled image. The original is not changed. 522 * @return The swirled image. The original is not changed.
523 */ 523 */
524 static QImage swirl(QImage &src, double degrees=50.0, unsigned int background = 524 static QImage swirl(QImage &src, double degrees=50.0, unsigned int background =
525 0xFFFFFFFF); 525 0xFFFFFFFF);
526 526
527 /** 527 /**
528 * Modifies the pixels along a sine wave. 528 * Modifies the pixels along a sine wave.
529 * 529 *
530 * @author Daniel M. Duley (mosfet) 530 * @author Daniel M. Duley (mosfet)
531 * @param src The QImage to process. 531 * @param src The QImage to process.
532 * @param amplitude The amplitude of the sine wave. 532 * @param amplitude The amplitude of the sine wave.
533 * @param wavelength The frequency of the sine wave. 533 * @param frequency The frequency of the sine wave.
534 * @return The new image. The original is not changed. 534 * @return The new image. The original is not changed.
535 */ 535 */
536 static QImage wave(QImage &src, double amplitude=25.0, double frequency=150.0, 536 static QImage wave(QImage &src, double amplitude=25.0, double frequency=150.0,
537 unsigned int background = 0xFFFFFFFF); 537 unsigned int background = 0xFFFFFFFF);
538 538
539private: 539private:
540 540
541 /** 541 /**
542 * Helper function to fast calc some altered (lighten, shaded) colors 542 * Helper function to fast calc some altered (lighten, shaded) colors
543 * 543 *
544 */ 544 */
545 static unsigned int lHash(unsigned int c); 545 static unsigned int lHash(unsigned int c);
546 static unsigned int uHash(unsigned int c); 546 static unsigned int uHash(unsigned int c);
547 547
548 /** 548 /**
549 * Helper function to find the nearest color to the RBG triplet 549 * Helper function to find the nearest color to the RBG triplet
550 */ 550 */
551 static int nearestColor( int r, int g, int b, const QColor *pal, int size ); 551 static int nearestColor( int r, int g, int b, const QColor *pal, int size );
552 552
553 static void hull(const int x_offset, const int y_offset, const int polarity, 553 static void hull(const int x_offset, const int y_offset, const int polarity,
554 const int width, const int height, 554 const int width, const int height,
555 unsigned int *f, unsigned int *g); 555 unsigned int *f, unsigned int *g);
556 static unsigned int generateNoise(unsigned int pixel, NoiseType type); 556 static unsigned int generateNoise(unsigned int pixel, NoiseType type);
557 static unsigned int interpolateColor(QImage *image, double x, double y, 557 static unsigned int interpolateColor(QImage *image, double x, double y,
558 unsigned int background); 558 unsigned int background);
559}; 559};
560 560
561} 561}
562} 562}
563 563
564#endif 564#endif
diff --git a/libopie2/opieui/opixmapeffect.h b/libopie2/opieui/opixmapeffect.h
index b780f9f..85a1e25 100644
--- a/libopie2/opieui/opixmapeffect.h
+++ b/libopie2/opieui/opixmapeffect.h
@@ -107,106 +107,101 @@ public:
107 107
108 /** 108 /**
109 * Blends the provided pixmap into a background of the indicated color. 109 * Blends the provided pixmap into a background of the indicated color.
110 * 110 *
111 * @param pixmap The pixmap to process. 111 * @param pixmap The pixmap to process.
112 * @param initial_intensity this parameter takes values from -1 to 1: 112 * @param initial_intensity this parameter takes values from -1 to 1:
113 * @li If positive, it tells how much to fade the image in its 113 * @li If positive, it tells how much to fade the image in its
114 * less affected spot. 114 * less affected spot.
115 * @li If negative, it tells roughly indicates how much of the image 115 * @li If negative, it tells roughly indicates how much of the image
116 * remains unaffected 116 * remains unaffected
117 * @param bgnd Indicates the color of the background to blend in. 117 * @param bgnd Indicates the color of the background to blend in.
118 * @param eff Lets you choose what kind of blending you like. 118 * @param eff Lets you choose what kind of blending you like.
119 * @param anti_dir Blend in the opposite direction (makes no much sense 119 * @param anti_dir Blend in the opposite direction (makes no much sense
120 * with concentric blending effects). 120 * with concentric blending effects).
121 * @return Returns the @ref pixmap(), provided for convenience. 121 * @return Returns the @ref pixmap(), provided for convenience.
122 */ 122 */
123 static OPixmap& blend(OPixmap& pixmap, float initial_intensity, 123 static OPixmap& blend(OPixmap& pixmap, float initial_intensity,
124 const QColor &bgnd, GradientType eff, 124 const QColor &bgnd, GradientType eff,
125 bool anti_dir=false, int ncols=3); 125 bool anti_dir=false, int ncols=3);
126 126
127 /** 127 /**
128 * Builds a hash on any given pixmap. 128 * Builds a hash on any given pixmap.
129 * 129 *
130 * @param pixmap The pixmap to process. 130 * @param pixmap The pixmap to process.
131 * @param lite The hash faces the indicated lighting (cardinal poles) 131 * @param lite The hash faces the indicated lighting (cardinal poles)
132 * @param spacing How many unmodified pixels inbetween hashes. 132 * @param spacing How many unmodified pixels inbetween hashes.
133 * @return Returns The @ref pixmap(), provided for convenience. 133 * @return Returns The @ref pixmap(), provided for convenience.
134 */ 134 */
135 static OPixmap& hash(OPixmap& pixmap, Lighting lite=NorthLite, 135 static OPixmap& hash(OPixmap& pixmap, Lighting lite=NorthLite,
136 unsigned int spacing=0, int ncols=3); 136 unsigned int spacing=0, int ncols=3);
137 137
138 /** 138 /**
139 * Creates a pattern from a pixmap. 139 * Creates a pattern from a pixmap.
140 * 140 *
141 * The given pixmap is "flattened" 141 * The given pixmap is "flattened"
142 * between color a to color b. 142 * between color a to color b.
143 * 143 *
144 * @param pixmap The pixmap to process. 144 * @param pixmap The pixmap to process.
145 * @param ca Color a. 145 * @param ca Color a.
146 * @param cb Color b. 146 * @param cb Color b.
147 * @param ncols The number of colors to use. The image will be 147 * @param ncols The number of colors to use. The image will be
148 * dithered to this depth. Pass zero to prevent dithering. 148 * dithered to this depth. Pass zero to prevent dithering.
149 * @return The @ref pixmap(), provided for convenience. 149 * @return The @ref pixmap(), provided for convenience.
150 */ 150 */
151 static OPixmap pattern(const OPixmap& pixmap, QSize size, 151 static OPixmap pattern(const OPixmap& pixmap, QSize size,
152 const QColor &ca, const QColor &cb, int ncols=8); 152 const QColor &ca, const QColor &cb, int ncols=8);
153 153
154 /** 154 /**
155 * Recolors a pixmap. 155 * Fades a pixmap to a certain color.
156 *
157 * The most dark color will become color a,
158 * the most bright one color b, and in between.
159 * 156 *
160 * @param pixmap The pixmap to process. 157 * @param pixmap The pixmap to process.
161 * @param ca Color a. 158 * @param val The strength of the effect. 0 <= val <= 1.
162 * @param cb Color b. 159 * @param color The color to blend to.
163 * @param ncols The number of colors to use. Pass zero to prevent
164 * dithering.
165 * @return Returns the @ref pixmap(), provided for convenience. 160 * @return Returns the @ref pixmap(), provided for convenience.
166 */ 161 */
167 static OPixmap& fade(OPixmap& pixmap, double val, const QColor &color); 162 static OPixmap& fade(OPixmap& pixmap, double val, const QColor &color);
168 163
169 /** 164 /**
170 * Converts a pixmap to grayscale. 165 * Converts a pixmap to grayscale.
171 * 166 *
172 * @param pixmap The pixmap to process. 167 * @param pixmap The pixmap to process.
173 * @param fast Set to @p true in order to use a faster but non-photographic 168 * @param fast Set to @p true in order to use a faster but non-photographic
174 * quality algorithm. Appropriate for things such as toolbar icons. 169 * quality algorithm. Appropriate for things such as toolbar icons.
175 * @return Returns the @ref pixmap(), provided for convenience. 170 * @return Returns the @ref pixmap(), provided for convenience.
176 */ 171 */
177 static OPixmap& toGray(OPixmap& pixmap, bool fast=false); 172 static OPixmap& toGray(OPixmap& pixmap, bool fast=false);
178 173
179 /** 174 /**
180 * Desaturates a pixmap. 175 * Desaturates a pixmap.
181 * 176 *
182 * @param pixmap The pixmap to process. 177 * @param pixmap The pixmap to process.
183 * @param desat A value between 0 and 1 setting the degree of desaturation 178 * @param desat A value between 0 and 1 setting the degree of desaturation
184 * @return Returns The @ref pixmap(), provided for convenience. 179 * @return Returns The @ref pixmap(), provided for convenience.
185 */ 180 */
186 static OPixmap& desaturate(OPixmap& pixmap, float desat = 0.3); 181 static OPixmap& desaturate(OPixmap& pixmap, float desat = 0.3);
187 182
188 /** 183 /**
189 * Modifies the contrast of a pixmap. 184 * Modifies the contrast of a pixmap.
190 * 185 *
191 * @param pixmap The pixmap to process. 186 * @param pixmap The pixmap to process.
192 * @param c A contrast value between -255 and 255. 187 * @param c A contrast value between -255 and 255.
193 * @return Returns the @ref pixmap(), provided for convenience. 188 * @return Returns the @ref pixmap(), provided for convenience.
194 */ 189 */
195 static OPixmap& contrast(OPixmap& pixmap, int c); 190 static OPixmap& contrast(OPixmap& pixmap, int c);
196 191
197 /** 192 /**
198 * Dithers a pixmap using Floyd-Steinberg dithering for low-color 193 * Dithers a pixmap using Floyd-Steinberg dithering for low-color
199 * situations. 194 * situations.
200 * 195 *
201 * @param pixmap The pixmap to process. 196 * @param pixmap The pixmap to process.
202 * @param palette The color palette to use. 197 * @param palette The color palette to use.
203 * @param size The size of the palette. 198 * @param size The size of the palette.
204 * @return Returns the @ref pixmap(), provided for convenience. 199 * @return Returns the @ref pixmap(), provided for convenience.
205 */ 200 */
206 static OPixmap& dither(OPixmap &pixmap, const QColor *palette, int size); 201 static OPixmap& dither(OPixmap &pixmap, const QColor *palette, int size);
207 202
208 /** 203 /**
209 * Calculate a 'selected' pixmap, for instance a selected icon 204 * Calculate a 'selected' pixmap, for instance a selected icon
210 * on the desktop. 205 * on the desktop.
211 * @param pixmap the pixmap to select 206 * @param pixmap the pixmap to select
212 * @param col the selected color, usually from QColorGroup::highlight(). 207 * @param col the selected color, usually from QColorGroup::highlight().