-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 @@ -174,186 +174,186 @@ public: */ static QImage& blend(QImage &image1, QImage &image2, QImage &blendImage, RGBComponent channel); /** * Blend an image into another one, using alpha in the expected way. * @author Rik Hemsley (rikkus) <rik@kde.org> */ static bool blend(const QImage & upper, const QImage & lower, QImage & output); // Not yet... static bool blend(const QImage & image1, const QImage & image2, QImage & output, const QRect & destRect); /** * Blend an image into another one, using alpha in the expected way and * over coordinates @p x and @p y with respect to the lower image. * The output is a QImage which is the @p upper image already blended * with the @p lower one, so its size will be (in general) the same than * @p upper instead of the same size than @p lower like the method above. * In fact, the size of @p output is like upper's one only when it can be * painted on lower, if there has to be some clipping, output's size will * be the clipped area and x and y will be set to the correct up-left corner * where the clipped rectangle begins. */ static bool blend(int &x, int &y, const QImage & upper, const QImage & lower, QImage & output); /** * Blend an image into another one, using alpha in the expected way and * over coordinates @p x and @p y with respect to the lower image. * The output is painted in the own @p lower image. This is an optimization * of the blend method above provided by convenience. */ static bool blendOnLower(int x, int y, const QImage & upper, const QImage & lower); /** * Modifies the intensity of a pixmap's RGB channel component. * * @author Daniel M. Duley (mosfet) * @param image The QImage to process. * @param percent Percent value. Use a negative value to dim. * @param channel Which channel(s) should be modified * @return The @p image, provided for convenience. */ static QImage& channelIntensity(QImage &image, float percent, RGBComponent channel); /** * Fade an image to a certain background color. * * The number of colors will not be changed. * - * @param image The QImage to process. + * @param img The QImage to process. * @param val The strength of the effect. 0 <= val <= 1. * @param color The background color. * @return Returns the @ref image(), provided for convenience. */ static QImage& fade(QImage &img, float val, const QColor &color); /** * This recolors a pixmap. The most dark color will become color a, * the most bright one color b, and in between. * * @param image A QImage to process. * @param ca Color a * @param cb Color b */ static QImage& flatten(QImage &image, const QColor &ca, const QColor &cb, int ncols=0); /** * Build a hash on any given @ref QImage * * @param image The QImage to process * @param lite The hash faces the indicated lighting (cardinal poles). * @param spacing How many unmodified pixels inbetween hashes. * @return Returns the @ref image(), provided for convenience. */ static QImage& hash(QImage &image, Lighting lite=NorthLite, unsigned int spacing=0); /** * Either brighten or dim the image by a specified percent. * For example, .50 will modify the colors by 50%. * * @author Daniel M. Duley (mosfet) * @param image The QImage to process. * @param percent The percent value. Use a negative value to dim. * @return Returns The @ref image(), provided for convenience. */ static QImage& intensity(QImage &image, float percent); /** * Modulate the image with a color channel of another image. * * @param image The QImage to modulate and result. * @param modImage The QImage to use for modulation. * @param reverse Invert the meaning of image/modImage; result is image! * @param type The modulation Type to use. * @param factor The modulation amplitude; with 0 no effect [-200;200]. * @param channel The RBG channel of image2 to use for modulation. * @return Returns the @ref image(), provided for convenience. */ static QImage& modulate(QImage &image, QImage &modImage, bool reverse, ModulationType type, int factor, RGBComponent channel); /** * Convert an image to grayscale. * * @author Daniel M. Duley (mosfet) * @param image The @ref QImage to process. * @param fast Set to @p true in order to use a faster but non-photographic * quality algorithm. Appropriate for things such as toolbar icons. * @return Returns the @ref image(), provided for convenience. */ static QImage& toGray(QImage &image, bool fast = false); /** * Desaturate an image evenly. * * @param image The QImage to process. * @param desat A value between 0 and 1 setting the degree of desaturation * @return Returns the @ref image(), provided for convenience. */ static QImage& desaturate(QImage &image, float desat = 0.3); /** * Fast, but low quality contrast of an image. Also see contrastHSV. * * @author Daniel M. Duley (mosfet) * @param image The QImage to process. * @param c A contrast value between -255 to 255. * @return The @ref image(), provided for convenience. */ static QImage& contrast(QImage &image, int c); /** * Dither an image using Floyd-Steinberg dithering for low-color * situations. * - * @param image The QImage to process. + * @param img The QImage to process. * @param palette The color palette to use * @param size The size of the palette * @return Returns the @ref image(), provided for convenience. */ static QImage& dither(QImage &img, const QColor *palette, int size); /** * Calculate the image for a selected image, for instance a selected icon * on the desktop. * @param img the QImage to select * @param col the selected color, usually from QColorGroup::highlight(). */ static QImage& selectedImage( QImage &img, const QColor &col ); /** * High quality, expensive HSV contrast. You can do a faster one by just * taking a intensity threshold (ie: 128) and incrementing RGB color * channels above it and decrementing those below it, but this gives much * better results. * * @author Daniel M. Duley (mosfet) * @param img The QImage to process. * @param sharpen If true sharpness is increase, (spiffed). Otherwise * it is decreased, (dulled). */ static void contrastHSV(QImage &img, bool sharpen=true); /** * Normalizes the pixel values to span the full range of color values. * This is a contrast enhancement technique. * @author Daniel M. Duley (mosfet) */ static void normalize(QImage &img); /** * Performs histogram equalization on the reference * image. * @author Daniel M. Duley (mosfet) */ static void equalize(QImage &img); /** * Thresholds the reference image. You can also threshold images by using * ThresholdDither in the various QPixmap/QImage convert methods, but this * lets you specify a threshold value. * * @author Daniel M. Duley (mosfet) * @param img The QImage to process. @@ -485,80 +485,80 @@ public: * @author Daniel M. Duley (mosfet) * @param src The QImage to process. * @param factor The percent weight to give to the center pixel. * @return The sharpened image. The original is not changed. */ static QImage sharpen(QImage &src, double factor=30.0); /** * Randomly displaces pixels. * * @author Daniel M. Duley (mosfet) * @param src The QImage to process. * @param amount The vicinity for choosing a random pixel to swap. * @return The image with pixels displaced. The original is not changed. */ static QImage spread(QImage &src, unsigned int amount=3); /** * Shades the image using a distance light source. * * @author Daniel M. Duley (mosfet) * @param src The QImage to process. * @param color_shading If true do color shading, otherwise do grayscale. * @param azimuth Determines the light source and direction. * @param elevation Determines the light source and direction. * @return The shaded image. The original is not changed. */ static QImage shade(QImage &src, bool color_shading=true, double azimuth=30.0, double elevation=30.0); /** * Swirls the image by a specified amount * * @author Daniel M. Duley (mosfet) * @param src The QImage to process. * @param degrees The tightness of the swirl. * @param background An RGBA value to use for the background. After the * effect some pixels may be "empty". This value is used for those pixels. * @return The swirled image. The original is not changed. */ static QImage swirl(QImage &src, double degrees=50.0, unsigned int background = 0xFFFFFFFF); /** * Modifies the pixels along a sine wave. * * @author Daniel M. Duley (mosfet) * @param src The QImage to process. * @param amplitude The amplitude of the sine wave. - * @param wavelength The frequency of the sine wave. + * @param frequency The frequency of the sine wave. * @return The new image. The original is not changed. */ static QImage wave(QImage &src, double amplitude=25.0, double frequency=150.0, unsigned int background = 0xFFFFFFFF); private: /** * Helper function to fast calc some altered (lighten, shaded) colors * */ static unsigned int lHash(unsigned int c); static unsigned int uHash(unsigned int c); /** * Helper function to find the nearest color to the RBG triplet */ static int nearestColor( int r, int g, int b, const QColor *pal, int size ); static void hull(const int x_offset, const int y_offset, const int polarity, const int width, const int height, unsigned int *f, unsigned int *g); static unsigned int generateNoise(unsigned int pixel, NoiseType type); static unsigned int interpolateColor(QImage *image, double x, double y, unsigned int background); }; } } #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: /** * Blends the provided pixmap into a background of the indicated color. * * @param pixmap The pixmap to process. * @param initial_intensity this parameter takes values from -1 to 1: * @li If positive, it tells how much to fade the image in its * less affected spot. * @li If negative, it tells roughly indicates how much of the image * remains unaffected * @param bgnd Indicates the color of the background to blend in. * @param eff Lets you choose what kind of blending you like. * @param anti_dir Blend in the opposite direction (makes no much sense * with concentric blending effects). * @return Returns the @ref pixmap(), provided for convenience. */ static OPixmap& blend(OPixmap& pixmap, float initial_intensity, const QColor &bgnd, GradientType eff, bool anti_dir=false, int ncols=3); /** * Builds a hash on any given pixmap. * * @param pixmap The pixmap to process. * @param lite The hash faces the indicated lighting (cardinal poles) * @param spacing How many unmodified pixels inbetween hashes. * @return Returns The @ref pixmap(), provided for convenience. */ static OPixmap& hash(OPixmap& pixmap, Lighting lite=NorthLite, unsigned int spacing=0, int ncols=3); /** * Creates a pattern from a pixmap. * * The given pixmap is "flattened" * between color a to color b. * * @param pixmap The pixmap to process. * @param ca Color a. * @param cb Color b. * @param ncols The number of colors to use. The image will be * dithered to this depth. Pass zero to prevent dithering. * @return The @ref pixmap(), provided for convenience. */ static OPixmap pattern(const OPixmap& pixmap, QSize size, const QColor &ca, const QColor &cb, int ncols=8); /** - * Recolors a pixmap. - * - * The most dark color will become color a, - * the most bright one color b, and in between. + * Fades a pixmap to a certain color. * * @param pixmap The pixmap to process. - * @param ca Color a. - * @param cb Color b. - * @param ncols The number of colors to use. Pass zero to prevent - * dithering. + * @param val The strength of the effect. 0 <= val <= 1. + * @param color The color to blend to. * @return Returns the @ref pixmap(), provided for convenience. */ static OPixmap& fade(OPixmap& pixmap, double val, const QColor &color); /** * Converts a pixmap to grayscale. * * @param pixmap The pixmap to process. * @param fast Set to @p true in order to use a faster but non-photographic * quality algorithm. Appropriate for things such as toolbar icons. * @return Returns the @ref pixmap(), provided for convenience. */ static OPixmap& toGray(OPixmap& pixmap, bool fast=false); /** * Desaturates a pixmap. * * @param pixmap The pixmap to process. * @param desat A value between 0 and 1 setting the degree of desaturation * @return Returns The @ref pixmap(), provided for convenience. */ static OPixmap& desaturate(OPixmap& pixmap, float desat = 0.3); /** * Modifies the contrast of a pixmap. * * @param pixmap The pixmap to process. * @param c A contrast value between -255 and 255. * @return Returns the @ref pixmap(), provided for convenience. */ static OPixmap& contrast(OPixmap& pixmap, int c); /** * Dithers a pixmap using Floyd-Steinberg dithering for low-color * situations. * * @param pixmap The pixmap to process. * @param palette The color palette to use. * @param size The size of the palette. * @return Returns the @ref pixmap(), provided for convenience. */ static OPixmap& dither(OPixmap &pixmap, const QColor *palette, int size); /** * Calculate a 'selected' pixmap, for instance a selected icon * on the desktop. * @param pixmap the pixmap to select * @param col the selected color, usually from QColorGroup::highlight(). |