-rw-r--r-- | libopie2/opieui/oimageeffect.h | 6 | ||||
-rw-r--r-- | libopie2/opieui/opixmapeffect.h | 11 |
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 | |||
@@ -198,49 +198,49 @@ public: | |||
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. |
@@ -287,49 +287,49 @@ public: | |||
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). |
@@ -509,49 +509,49 @@ public: | |||
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 | ||
539 | private: | 539 | private: |
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, |
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 | |||
@@ -131,58 +131,53 @@ public: | |||
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 | /** |