Diffstat (limited to 'libopie2/opieui/oimageeffect.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opieui/oimageeffect.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libopie2/opieui/oimageeffect.cpp b/libopie2/opieui/oimageeffect.cpp index 9a58bb9..be47eb2 100644 --- a/libopie2/opieui/oimageeffect.cpp +++ b/libopie2/opieui/oimageeffect.cpp @@ -28,32 +28,36 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // $Id$ #include <math.h> #include <qimage.h> #include <stdlib.h> #include <opie2/oimageeffect.h> #include <opie2/odebug.h> #define MaxRGB 255L #define DegreesToRadians(x) ((x)*M_PI/180.0) using namespace std; +using namespace Opie::Core; + +namespace Opie { +namespace Ui { inline unsigned int intensityValue(unsigned int color) { return((unsigned int)((0.299*qRed(color) + 0.587*qGreen(color) + 0.1140000000000001*qBlue(color)))); } //====================================================================== // // Gradient effects // //====================================================================== QImage OImageEffect::gradient(const QSize &size, const QColor &ca, const QColor &cb, GradientType eff, int ncols) @@ -3752,17 +3756,18 @@ void OImageEffect::contrastHSV(QImage &img, bool sharpen) brightness = v/255.0; theta=(brightness-0.5)*M_PI; brightness+=scale*(((scale*((sin(theta)+1.0)))-brightness)*sign); if (brightness > 1.0) brightness=1.0; else if (brightness < 0) brightness=0.0; v = (int)(brightness*255); c.setHsv(h, s, v); data[i] = qRgba(c.red(), c.green(), c.blue(), qAlpha(data[i])); } } - +} +} |