summaryrefslogtreecommitdiff
path: root/libopie2/opieui/oimageeffect.cpp
Unidiff
Diffstat (limited to 'libopie2/opieui/oimageeffect.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/oimageeffect.cpp7
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
@@ -32,24 +32,28 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32#include <math.h> 32#include <math.h>
33 33
34#include <qimage.h> 34#include <qimage.h>
35#include <stdlib.h> 35#include <stdlib.h>
36 36
37#include <opie2/oimageeffect.h> 37#include <opie2/oimageeffect.h>
38#include <opie2/odebug.h> 38#include <opie2/odebug.h>
39 39
40#define MaxRGB 255L 40#define MaxRGB 255L
41#define DegreesToRadians(x) ((x)*M_PI/180.0) 41#define DegreesToRadians(x) ((x)*M_PI/180.0)
42 42
43using namespace std; 43using namespace std;
44using namespace Opie::Core;
45
46namespace Opie {
47namespace Ui {
44 48
45inline unsigned int intensityValue(unsigned int color) 49inline unsigned int intensityValue(unsigned int color)
46{ 50{
47 return((unsigned int)((0.299*qRed(color) + 51 return((unsigned int)((0.299*qRed(color) +
48 0.587*qGreen(color) + 52 0.587*qGreen(color) +
49 0.1140000000000001*qBlue(color)))); 53 0.1140000000000001*qBlue(color))));
50} 54}
51 55
52//====================================================================== 56//======================================================================
53// 57//
54// Gradient effects 58// Gradient effects
55// 59//
@@ -3756,13 +3760,14 @@ void OImageEffect::contrastHSV(QImage &img, bool sharpen)
3756 brightness=1.0; 3760 brightness=1.0;
3757 else 3761 else
3758 if (brightness < 0) 3762 if (brightness < 0)
3759 brightness=0.0; 3763 brightness=0.0;
3760 v = (int)(brightness*255); 3764 v = (int)(brightness*255);
3761 c.setHsv(h, s, v); 3765 c.setHsv(h, s, v);
3762 data[i] = qRgba(c.red(), c.green(), c.blue(), qAlpha(data[i])); 3766 data[i] = qRgba(c.red(), c.green(), c.blue(), qAlpha(data[i]));
3763 } 3767 }
3764} 3768}
3765 3769
3766 3770
3767 3771
3768 3772}
3773}