summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/image/qpixmapfilter.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp
index 78a6b43..939b86d 100644
--- a/src/gui/image/qpixmapfilter.cpp
+++ b/src/gui/image/qpixmapfilter.cpp
@@ -602,7 +602,7 @@ QRectF QPixmapBlurFilter::boundingRectFor(const QRectF &rect) const
}
template <int shift>
-inline int static_shift(int value)
+inline int qt_static_shift(int value)
{
if (shift == 0)
return value;
@@ -613,15 +613,15 @@ inline int static_shift(int value)
}
template<int aprec, int zprec>
-inline void blurinner(uchar *bptr, int &zR, int &zG, int &zB, int &zA, int alpha)
+inline void qt_blurinner(uchar *bptr, int &zR, int &zG, int &zB, int &zA, int alpha)
{
QRgb *pixel = (QRgb *)bptr;
#define Z_MASK (0xff << zprec)
- const int A_zprec = static_shift<zprec - 24>(*pixel) & Z_MASK;
- const int R_zprec = static_shift<zprec - 16>(*pixel) & Z_MASK;
- const int G_zprec = static_shift<zprec - 8>(*pixel) & Z_MASK;
- const int B_zprec = static_shift<zprec>(*pixel) & Z_MASK;
+ const int A_zprec = qt_static_shift<zprec - 24>(*pixel) & Z_MASK;
+ const int R_zprec = qt_static_shift<zprec - 16>(*pixel) & Z_MASK;
+ const int G_zprec = qt_static_shift<zprec - 8>(*pixel) & Z_MASK;
+ const int B_zprec = qt_static_shift<zprec>(*pixel) & Z_MASK;
#undef Z_MASK
const int zR_zprec = zR >> aprec;
@@ -636,17 +636,17 @@ inline void blurinner(uchar *bptr, int &zR, int &zG, int &zB, int &zA, int alpha
#define ZA_MASK (0xff << (zprec + aprec))
*pixel =
- static_shift<24 - zprec - aprec>(zA & ZA_MASK)
- | static_shift<16 - zprec - aprec>(zR & ZA_MASK)
- | static_shift<8 - zprec - aprec>(zG & ZA_MASK)
- | static_shift<-zprec - aprec>(zB & ZA_MASK);
+ qt_static_shift<24 - zprec - aprec>(zA & ZA_MASK)
+ | qt_static_shift<16 - zprec - aprec>(zR & ZA_MASK)
+ | qt_static_shift<8 - zprec - aprec>(zG & ZA_MASK)
+ | qt_static_shift<-zprec - aprec>(zB & ZA_MASK);
#undef ZA_MASK
}
const int alphaIndex = (QSysInfo::ByteOrder == QSysInfo::BigEndian ? 0 : 3);
template<int aprec, int zprec>
-inline void blurinner_alphaOnly(uchar *bptr, int &z, int alpha)
+inline void qt_blurinner_alphaOnly(uchar *bptr, int &z, int alpha)
{
const int A_zprec = int(*(bptr)) << zprec;
const int z_zprec = z >> aprec;
@@ -655,7 +655,7 @@ inline void blurinner_alphaOnly(uchar *bptr, int &z, int alpha)
}
template<int aprec, int zprec, bool alphaOnly>
-inline void blurrow(QImage & im, int line, int alpha)
+inline void qt_blurrow(QImage & im, int line, int alpha)
{
uchar *bptr = im.scanLine(line);
@@ -668,9 +668,9 @@ inline void blurrow(QImage & im, int line, int alpha)
const int im_width = im.width();
for (int index = 0; index < im_width; ++index) {
if (alphaOnly)
- blurinner_alphaOnly<aprec, zprec>(bptr, zA, alpha);
+ qt_blurinner_alphaOnly<aprec, zprec>(bptr, zA, alpha);
else
- blurinner<aprec, zprec>(bptr, zR, zG, zB, zA, alpha);
+ qt_blurinner<aprec, zprec>(bptr, zR, zG, zB, zA, alpha);
bptr += stride;
}
@@ -679,9 +679,9 @@ inline void blurrow(QImage & im, int line, int alpha)
for (int index = im_width - 2; index >= 0; --index) {
bptr -= stride;
if (alphaOnly)
- blurinner_alphaOnly<aprec, zprec>(bptr, zA, alpha);
+ qt_blurinner_alphaOnly<aprec, zprec>(bptr, zA, alpha);
else
- blurinner<aprec, zprec>(bptr, zR, zG, zB, zA, alpha);
+ qt_blurinner<aprec, zprec>(bptr, zR, zG, zB, zA, alpha);
}
}
@@ -723,7 +723,7 @@ void expblur(QImage &img, qreal radius, bool improvedQuality = false, int transp
int img_height = img.height();
for (int row = 0; row < img_height; ++row) {
for (int i = 0; i <= improvedQuality; ++i)
- blurrow<aprec, zprec, alphaOnly>(img, row, alpha);
+ qt_blurrow<aprec, zprec, alphaOnly>(img, row, alpha);
}
QImage temp(img.height(), img.width(), img.format());
@@ -756,7 +756,7 @@ void expblur(QImage &img, qreal radius, bool improvedQuality = false, int transp
img_height = temp.height();
for (int row = 0; row < img_height; ++row) {
for (int i = 0; i <= improvedQuality; ++i)
- blurrow<aprec, zprec, alphaOnly>(temp, row, alpha);
+ qt_blurrow<aprec, zprec, alphaOnly>(temp, row, alpha);
}
if (transposed == 0) {