]> git.sur5r.net Git - minitube/blob - src/thlibrary/thimage.cpp
Initial import
[minitube] / src / thlibrary / thimage.cpp
1 #include "imageblur.h"
2 #include "thpainter.h"
3 #include "thimage.h"
4
5 /* ============================================================================
6  *  PUBLIC Constructor/Destructors
7  */
8 THImage::THImage (const QSize& size, Format format)
9         : QImage(size, format)
10 {
11 }
12
13 THImage::THImage (int width, int height, Format format)
14         : QImage(width, height, format)
15 {
16 }
17
18 THImage::THImage (uchar *data, int width, int height, Format format)
19         : QImage(data, width, height, format)
20 {
21 }
22
23 THImage::THImage (const uchar *data, int width, int height, Format format)
24         : QImage(data, width, height, format)
25 {
26 }
27
28 THImage::THImage (uchar *data, int width, int height, int bytesPerLine, Format format)
29         : QImage(data, width, height, bytesPerLine, format)
30 {
31 }
32
33 THImage::THImage (const uchar *data, int width, int height, int bytesPerLine, Format format)
34         : QImage(data, width, height, bytesPerLine, format)
35 {
36 }
37
38 THImage::THImage (const QString& fileName, const char *format)
39         : QImage(fileName, format)
40 {
41 }
42
43 THImage::THImage (const char *fileName, const char *format)
44         : QImage(fileName, format)
45 {
46 }
47
48 THImage::THImage (const QImage& image)
49         : QImage(image)
50 {
51 }
52
53 THImage::~THImage() {
54 }
55
56 /* ============================================================================
57  *  PUBLIC Methods
58  */
59 void THImage::expblur(int aprec, int zprec, int radius) {
60         ImageBlur::expblur(this, aprec, zprec, radius);
61 }
62 #include <QCoreApplication>
63
64 void THImage::shadowBlur (int radius, const QColor& color) {
65         ImageBlur::expblur(this, 16, 7, radius);
66
67         THPainter p(this);
68         p.setCompositionMode(QPainter::CompositionMode_SourceIn);
69         p.fillRect(rect(), color);
70         p.end();
71 }
72
73