Coverage Report

Created: 2026-06-14 06:57

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/qtbase/src/gui/painting/qmemrotate.cpp
Line
Count
Source
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#include "qmemrotate_p.h"
6
#include "qpixellayout_p.h"
7
8
QT_BEGIN_NAMESPACE
9
10
static const int tileSize = 32;
11
12
template<class T>
13
static inline void qt_memrotate90_tiled(const T *src, int w, int h, int isstride, T *dest, int idstride)
14
0
{
15
0
    const qsizetype sstride = isstride / sizeof(T);
16
0
    const qsizetype dstride = idstride / sizeof(T);
17
18
0
    const int pack = sizeof(quint32) / sizeof(T);
19
0
    const int unaligned =
20
0
        qMin(uint((quintptr(dest) & (sizeof(quint32)-1)) / sizeof(T)), uint(h));
21
0
    const int restX = w % tileSize;
22
0
    const int restY = (h - unaligned) % tileSize;
23
0
    const int unoptimizedY = restY % pack;
24
0
    const int numTilesX = w / tileSize + (restX > 0);
25
0
    const int numTilesY = (h - unaligned) / tileSize + (restY >= pack);
26
27
0
    for (int tx = 0; tx < numTilesX; ++tx) {
28
0
        const int startx = w - tx * tileSize - 1;
29
0
        const int stopx = qMax(startx - tileSize, 0);
30
31
0
        if (unaligned) {
32
0
            for (int x = startx; x >= stopx; --x) {
33
0
                T *d = dest + (w - x - 1) * dstride;
34
0
                for (int y = 0; y < unaligned; ++y) {
35
0
                    *d++ = src[y * sstride + x];
36
0
                }
37
0
            }
38
0
        }
39
40
0
        for (int ty = 0; ty < numTilesY; ++ty) {
41
0
            const int starty = ty * tileSize + unaligned;
42
0
            const int stopy = qMin(starty + tileSize, h - unoptimizedY);
43
44
0
            for (int x = startx; x >= stopx; --x) {
45
0
                quint32 *d = reinterpret_cast<quint32*>(dest + (w - x - 1) * dstride + starty);
46
0
                for (int y = starty; y < stopy; y += pack) {
47
0
                    quint32 c = src[y * sstride + x];
48
0
                    for (int i = 1; i < pack; ++i) {
49
0
                        const int shift = (sizeof(T) * 8 * i);
50
0
                        const T color = src[(y + i) * sstride + x];
51
0
                        c |= color << shift;
52
0
                    }
53
0
                    *d++ = c;
54
0
                }
55
0
            }
56
0
        }
57
58
0
        if (unoptimizedY) {
59
0
            const int starty = h - unoptimizedY;
60
0
            for (int x = startx; x >= stopx; --x) {
61
0
                T *d = dest + (w - x - 1) * dstride + starty;
62
0
                for (int y = starty; y < h; ++y) {
63
0
                    *d++ = src[y * sstride + x];
64
0
                }
65
0
            }
66
0
        }
67
0
    }
68
0
}
Unexecuted instantiation: qmemrotate.cpp:void qt_memrotate90_tiled<unsigned short>(unsigned short const*, int, int, int, unsigned short*, int)
Unexecuted instantiation: qmemrotate.cpp:void qt_memrotate90_tiled<unsigned char>(unsigned char const*, int, int, int, unsigned char*, int)
69
70
template<class T>
71
static inline void qt_memrotate90_tiled_unpacked(const T *src, int w, int h, int isstride, T *dest, int idstride)
72
38
{
73
38
    const qsizetype sstride = isstride;
74
38
    const qsizetype dstride = idstride;
75
38
    const int numTilesX = (w + tileSize - 1) / tileSize;
76
38
    const int numTilesY = (h + tileSize - 1) / tileSize;
77
78
8.43k
    for (int tx = 0; tx < numTilesX; ++tx) {
79
8.39k
        const int startx = w - tx * tileSize - 1;
80
8.39k
        const int stopx = qMax(startx - tileSize, 0);
81
82
29.2k
        for (int ty = 0; ty < numTilesY; ++ty) {
83
20.8k
            const int starty = ty * tileSize;
84
20.8k
            const int stopy = qMin(starty + tileSize, h);
85
86
647k
            for (int x = startx; x >= stopx; --x) {
87
626k
                T *d = (T *)((char*)dest + (w - x - 1) * dstride) + starty;
88
626k
                const char *s = (const char*)(src + x) + starty * sstride;
89
13.2M
                for (int y = starty; y < stopy; ++y) {
90
12.5M
                    *d++ = *(const T *)(s);
91
12.5M
                    s += sstride;
92
12.5M
                }
93
626k
            }
94
20.8k
        }
95
8.39k
    }
96
38
}
Unexecuted instantiation: qmemrotate.cpp:void qt_memrotate90_tiled_unpacked<QRgbaFloat<float> >(QRgbaFloat<float> const*, int, int, int, QRgbaFloat<float>*, int)
qmemrotate.cpp:void qt_memrotate90_tiled_unpacked<unsigned long long>(unsigned long long const*, int, int, int, unsigned long long*, int)
Line
Count
Source
72
19
{
73
19
    const qsizetype sstride = isstride;
74
19
    const qsizetype dstride = idstride;
75
19
    const int numTilesX = (w + tileSize - 1) / tileSize;
76
19
    const int numTilesY = (h + tileSize - 1) / tileSize;
77
78
6.70k
    for (int tx = 0; tx < numTilesX; ++tx) {
79
6.68k
        const int startx = w - tx * tileSize - 1;
80
6.68k
        const int stopx = qMax(startx - tileSize, 0);
81
82
20.9k
        for (int ty = 0; ty < numTilesY; ++ty) {
83
14.2k
            const int starty = ty * tileSize;
84
14.2k
            const int stopy = qMin(starty + tileSize, h);
85
86
428k
            for (int x = startx; x >= stopx; --x) {
87
413k
                T *d = (T *)((char*)dest + (w - x - 1) * dstride) + starty;
88
413k
                const char *s = (const char*)(src + x) + starty * sstride;
89
7.05M
                for (int y = starty; y < stopy; ++y) {
90
6.64M
                    *d++ = *(const T *)(s);
91
6.64M
                    s += sstride;
92
6.64M
                }
93
413k
            }
94
14.2k
        }
95
6.68k
    }
96
19
}
qmemrotate.cpp:void qt_memrotate90_tiled_unpacked<unsigned int>(unsigned int const*, int, int, int, unsigned int*, int)
Line
Count
Source
72
19
{
73
19
    const qsizetype sstride = isstride;
74
19
    const qsizetype dstride = idstride;
75
19
    const int numTilesX = (w + tileSize - 1) / tileSize;
76
19
    const int numTilesY = (h + tileSize - 1) / tileSize;
77
78
1.73k
    for (int tx = 0; tx < numTilesX; ++tx) {
79
1.71k
        const int startx = w - tx * tileSize - 1;
80
1.71k
        const int stopx = qMax(startx - tileSize, 0);
81
82
8.24k
        for (int ty = 0; ty < numTilesY; ++ty) {
83
6.53k
            const int starty = ty * tileSize;
84
6.53k
            const int stopy = qMin(starty + tileSize, h);
85
86
219k
            for (int x = startx; x >= stopx; --x) {
87
212k
                T *d = (T *)((char*)dest + (w - x - 1) * dstride) + starty;
88
212k
                const char *s = (const char*)(src + x) + starty * sstride;
89
6.14M
                for (int y = starty; y < stopy; ++y) {
90
5.93M
                    *d++ = *(const T *)(s);
91
5.93M
                    s += sstride;
92
5.93M
                }
93
212k
            }
94
6.53k
        }
95
1.71k
    }
96
19
}
Unexecuted instantiation: qmemrotate.cpp:void qt_memrotate90_tiled_unpacked<quint24>(quint24 const*, int, int, int, quint24*, int)
97
98
template<class T>
99
static inline void qt_memrotate270_tiled(const T *src, int w, int h, int isstride, T *dest, int idstride)
100
0
{
101
0
    const qsizetype sstride = isstride / sizeof(T);
102
0
    const qsizetype dstride = idstride / sizeof(T);
103
104
0
    const int pack = sizeof(quint32) / sizeof(T);
105
0
    const int unaligned =
106
0
        qMin(uint((quintptr(dest) & (sizeof(quint32)-1)) / sizeof(T)), uint(h));
107
0
    const int restX = w % tileSize;
108
0
    const int restY = (h - unaligned) % tileSize;
109
0
    const int unoptimizedY = restY % pack;
110
0
    const int numTilesX = w / tileSize + (restX > 0);
111
0
    const int numTilesY = (h - unaligned) / tileSize + (restY >= pack);
112
113
0
    for (int tx = 0; tx < numTilesX; ++tx) {
114
0
        const int startx = tx * tileSize;
115
0
        const int stopx = qMin(startx + tileSize, w);
116
117
0
        if (unaligned) {
118
0
            for (int x = startx; x < stopx; ++x) {
119
0
                T *d = dest + x * dstride;
120
0
                for (int y = h - 1; y >= h - unaligned; --y) {
121
0
                    *d++ = src[y * sstride + x];
122
0
                }
123
0
            }
124
0
        }
125
126
0
        for (int ty = 0; ty < numTilesY; ++ty) {
127
0
            const int starty = h - 1 - unaligned - ty * tileSize;
128
0
            const int stopy = qMax(starty - tileSize, unoptimizedY);
129
130
0
            for (int x = startx; x < stopx; ++x) {
131
0
                quint32 *d = reinterpret_cast<quint32*>(dest + x * dstride
132
0
                                                        + h - 1 - starty);
133
0
                for (int y = starty; y >= stopy; y -= pack) {
134
0
                    quint32 c = src[y * sstride + x];
135
0
                    for (int i = 1; i < pack; ++i) {
136
0
                        const int shift = (sizeof(T) * 8 * i);
137
0
                        const T color = src[(y - i) * sstride + x];
138
0
                        c |= color << shift;
139
0
                    }
140
0
                    *d++ = c;
141
0
                }
142
0
            }
143
0
        }
144
0
        if (unoptimizedY) {
145
0
            const int starty = unoptimizedY - 1;
146
0
            for (int x = startx; x < stopx; ++x) {
147
0
                T *d = dest + x * dstride + h - 1 - starty;
148
0
                for (int y = starty; y >= 0; --y) {
149
0
                    *d++ = src[y * sstride + x];
150
0
                }
151
0
            }
152
0
        }
153
0
    }
154
0
}
Unexecuted instantiation: qmemrotate.cpp:void qt_memrotate270_tiled<unsigned short>(unsigned short const*, int, int, int, unsigned short*, int)
Unexecuted instantiation: qmemrotate.cpp:void qt_memrotate270_tiled<unsigned char>(unsigned char const*, int, int, int, unsigned char*, int)
155
156
template<class T>
157
static inline void qt_memrotate270_tiled_unpacked(const T *src, int w, int h, int isstride, T *dest, int idstride)
158
28
{
159
28
    const qsizetype sstride = isstride;
160
28
    const qsizetype dstride = idstride;
161
28
    const int numTilesX = (w + tileSize - 1) / tileSize;
162
28
    const int numTilesY = (h + tileSize - 1) / tileSize;
163
164
3.82k
    for (int tx = 0; tx < numTilesX; ++tx) {
165
3.79k
        const int startx = tx * tileSize;
166
3.79k
        const int stopx = qMin(startx + tileSize, w);
167
168
9.52k
        for (int ty = 0; ty < numTilesY; ++ty) {
169
5.72k
            const int starty = h - 1 - ty * tileSize;
170
5.72k
            const int stopy = qMax(starty - tileSize, 0);
171
172
186k
            for (int x = startx; x < stopx; ++x) {
173
181k
                T *d = (T*)((char*)dest + x * dstride) + h - 1 - starty;
174
181k
                const char *s = (const char*)(src + x) + starty * sstride;
175
2.56M
                for (int y = starty; y >= stopy; --y) {
176
2.38M
                    *d++ = *(const T*)s;
177
2.38M
                    s -= sstride;
178
2.38M
                }
179
181k
            }
180
5.72k
        }
181
3.79k
    }
182
28
}
Unexecuted instantiation: qmemrotate.cpp:void qt_memrotate270_tiled_unpacked<QRgbaFloat<float> >(QRgbaFloat<float> const*, int, int, int, QRgbaFloat<float>*, int)
qmemrotate.cpp:void qt_memrotate270_tiled_unpacked<unsigned long long>(unsigned long long const*, int, int, int, unsigned long long*, int)
Line
Count
Source
158
14
{
159
14
    const qsizetype sstride = isstride;
160
14
    const qsizetype dstride = idstride;
161
14
    const int numTilesX = (w + tileSize - 1) / tileSize;
162
14
    const int numTilesY = (h + tileSize - 1) / tileSize;
163
164
2.24k
    for (int tx = 0; tx < numTilesX; ++tx) {
165
2.23k
        const int startx = tx * tileSize;
166
2.23k
        const int stopx = qMin(startx + tileSize, w);
167
168
5.45k
        for (int ty = 0; ty < numTilesY; ++ty) {
169
3.22k
            const int starty = h - 1 - ty * tileSize;
170
3.22k
            const int stopy = qMax(starty - tileSize, 0);
171
172
105k
            for (int x = startx; x < stopx; ++x) {
173
101k
                T *d = (T*)((char*)dest + x * dstride) + h - 1 - starty;
174
101k
                const char *s = (const char*)(src + x) + starty * sstride;
175
1.30M
                for (int y = starty; y >= stopy; --y) {
176
1.20M
                    *d++ = *(const T*)s;
177
1.20M
                    s -= sstride;
178
1.20M
                }
179
101k
            }
180
3.22k
        }
181
2.23k
    }
182
14
}
qmemrotate.cpp:void qt_memrotate270_tiled_unpacked<unsigned int>(unsigned int const*, int, int, int, unsigned int*, int)
Line
Count
Source
158
14
{
159
14
    const qsizetype sstride = isstride;
160
14
    const qsizetype dstride = idstride;
161
14
    const int numTilesX = (w + tileSize - 1) / tileSize;
162
14
    const int numTilesY = (h + tileSize - 1) / tileSize;
163
164
1.57k
    for (int tx = 0; tx < numTilesX; ++tx) {
165
1.56k
        const int startx = tx * tileSize;
166
1.56k
        const int stopx = qMin(startx + tileSize, w);
167
168
4.06k
        for (int ty = 0; ty < numTilesY; ++ty) {
169
2.50k
            const int starty = h - 1 - ty * tileSize;
170
2.50k
            const int stopy = qMax(starty - tileSize, 0);
171
172
81.6k
            for (int x = startx; x < stopx; ++x) {
173
79.1k
                T *d = (T*)((char*)dest + x * dstride) + h - 1 - starty;
174
79.1k
                const char *s = (const char*)(src + x) + starty * sstride;
175
1.26M
                for (int y = starty; y >= stopy; --y) {
176
1.18M
                    *d++ = *(const T*)s;
177
1.18M
                    s -= sstride;
178
1.18M
                }
179
79.1k
            }
180
2.50k
        }
181
1.56k
    }
182
14
}
Unexecuted instantiation: qmemrotate.cpp:void qt_memrotate270_tiled_unpacked<quint24>(quint24 const*, int, int, int, quint24*, int)
183
184
185
template <class T>
186
static
187
inline void qt_memrotate90_template(const T *src, int srcWidth, int srcHeight, int srcStride,
188
                                    T *dest, int dstStride)
189
0
{
190
0
#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
191
    // packed algorithm assumes little endian and that sizeof(quint32)/sizeof(T) is an integer
192
0
    static_assert(sizeof(quint32) % sizeof(T) == 0);
193
0
    qt_memrotate90_tiled<T>(src, srcWidth, srcHeight, srcStride, dest, dstStride);
194
#else
195
    qt_memrotate90_tiled_unpacked<T>(src, srcWidth, srcHeight, srcStride, dest, dstStride);
196
#endif
197
0
}
Unexecuted instantiation: qmemrotate.cpp:void qt_memrotate90_template<unsigned short>(unsigned short const*, int, int, int, unsigned short*, int)
Unexecuted instantiation: qmemrotate.cpp:void qt_memrotate90_template<unsigned char>(unsigned char const*, int, int, int, unsigned char*, int)
198
199
template<class T>
200
static inline void qt_memrotate180_template(const T *src, int w, int h, int isstride, T *dest, int idstride)
201
17
{
202
17
    const qsizetype sstride = isstride;
203
17
    const qsizetype dstride = idstride;
204
205
17
    const char *s = (const char*)(src) + (h - 1) * sstride;
206
4.08k
    for (int dy = 0; dy < h; ++dy) {
207
4.06k
        T *d = reinterpret_cast<T*>((char *)(dest) + dy * dstride);
208
4.06k
        src = reinterpret_cast<const T*>(s);
209
188k
        for (int dx = 0; dx < w; ++dx) {
210
184k
            d[dx] = src[w - 1 - dx];
211
184k
        }
212
4.06k
        s -= sstride;
213
4.06k
    }
214
17
}
Unexecuted instantiation: qmemrotate.cpp:void qt_memrotate180_template<QRgbaFloat<float> >(QRgbaFloat<float> const*, int, int, int, QRgbaFloat<float>*, int)
qmemrotate.cpp:void qt_memrotate180_template<unsigned long long>(unsigned long long const*, int, int, int, unsigned long long*, int)
Line
Count
Source
201
7
{
202
7
    const qsizetype sstride = isstride;
203
7
    const qsizetype dstride = idstride;
204
205
7
    const char *s = (const char*)(src) + (h - 1) * sstride;
206
2.65k
    for (int dy = 0; dy < h; ++dy) {
207
2.64k
        T *d = reinterpret_cast<T*>((char *)(dest) + dy * dstride);
208
2.64k
        src = reinterpret_cast<const T*>(s);
209
119k
        for (int dx = 0; dx < w; ++dx) {
210
116k
            d[dx] = src[w - 1 - dx];
211
116k
        }
212
2.64k
        s -= sstride;
213
2.64k
    }
214
7
}
qmemrotate.cpp:void qt_memrotate180_template<unsigned int>(unsigned int const*, int, int, int, unsigned int*, int)
Line
Count
Source
201
10
{
202
10
    const qsizetype sstride = isstride;
203
10
    const qsizetype dstride = idstride;
204
205
10
    const char *s = (const char*)(src) + (h - 1) * sstride;
206
1.43k
    for (int dy = 0; dy < h; ++dy) {
207
1.42k
        T *d = reinterpret_cast<T*>((char *)(dest) + dy * dstride);
208
1.42k
        src = reinterpret_cast<const T*>(s);
209
69.7k
        for (int dx = 0; dx < w; ++dx) {
210
68.2k
            d[dx] = src[w - 1 - dx];
211
68.2k
        }
212
1.42k
        s -= sstride;
213
1.42k
    }
214
10
}
Unexecuted instantiation: qmemrotate.cpp:void qt_memrotate180_template<quint24>(quint24 const*, int, int, int, quint24*, int)
Unexecuted instantiation: qmemrotate.cpp:void qt_memrotate180_template<unsigned short>(unsigned short const*, int, int, int, unsigned short*, int)
Unexecuted instantiation: qmemrotate.cpp:void qt_memrotate180_template<unsigned char>(unsigned char const*, int, int, int, unsigned char*, int)
215
216
template <class T>
217
static
218
inline void qt_memrotate270_template(const T *src, int srcWidth, int srcHeight, int srcStride,
219
                                     T *dest, int dstStride)
220
0
{
221
0
#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
222
    // packed algorithm assumes little endian and that sizeof(quint32)/sizeof(T) is an integer
223
0
    static_assert(sizeof(quint32) % sizeof(T) == 0);
224
0
    qt_memrotate270_tiled<T>(src, srcWidth, srcHeight, srcStride, dest, dstStride);
225
#else
226
    qt_memrotate270_tiled_unpacked<T>(src, srcWidth, srcHeight, srcStride, dest, dstStride);
227
#endif
228
0
}
Unexecuted instantiation: qmemrotate.cpp:void qt_memrotate270_template<unsigned short>(unsigned short const*, int, int, int, unsigned short*, int)
Unexecuted instantiation: qmemrotate.cpp:void qt_memrotate270_template<unsigned char>(unsigned char const*, int, int, int, unsigned char*, int)
229
230
#define QT_IMPL_MEMROTATE(type)                                     \
231
Q_GUI_EXPORT void qt_memrotate90(const type *src, int w, int h, int sstride, \
232
0
                                 type *dest, int dstride)           \
233
0
{                                                                   \
234
0
    qt_memrotate90_template(src, w, h, sstride, dest, dstride);     \
235
0
}                                                                   \
Unexecuted instantiation: qt_memrotate90(unsigned short const*, int, int, int, unsigned short*, int)
Unexecuted instantiation: qt_memrotate90(unsigned char const*, int, int, int, unsigned char*, int)
236
Q_GUI_EXPORT void qt_memrotate180(const type *src, int w, int h, int sstride, \
237
0
                                  type *dest, int dstride)          \
238
0
{                                                                   \
239
0
    qt_memrotate180_template(src, w, h, sstride, dest, dstride);    \
240
0
}                                                                   \
Unexecuted instantiation: qt_memrotate180(unsigned short const*, int, int, int, unsigned short*, int)
Unexecuted instantiation: qt_memrotate180(unsigned char const*, int, int, int, unsigned char*, int)
241
Q_GUI_EXPORT void qt_memrotate270(const type *src, int w, int h, int sstride, \
242
0
                                  type *dest, int dstride)          \
243
0
{                                                                   \
244
0
    qt_memrotate270_template(src, w, h, sstride, dest, dstride);    \
245
0
}
Unexecuted instantiation: qt_memrotate270(unsigned short const*, int, int, int, unsigned short*, int)
Unexecuted instantiation: qt_memrotate270(unsigned char const*, int, int, int, unsigned char*, int)
246
247
#define QT_IMPL_SIMPLE_MEMROTATE(type)                              \
248
Q_GUI_EXPORT void qt_memrotate90(const type *src, int w, int h, int sstride,  \
249
38
                                 type *dest, int dstride)           \
250
38
{                                                                   \
251
38
    qt_memrotate90_tiled_unpacked(src, w, h, sstride, dest, dstride); \
252
38
}                                                                   \
Unexecuted instantiation: qt_memrotate90(QRgbaFloat<float> const*, int, int, int, QRgbaFloat<float>*, int)
qt_memrotate90(unsigned long long const*, int, int, int, unsigned long long*, int)
Line
Count
Source
249
19
                                 type *dest, int dstride)           \
250
19
{                                                                   \
251
19
    qt_memrotate90_tiled_unpacked(src, w, h, sstride, dest, dstride); \
252
19
}                                                                   \
qt_memrotate90(unsigned int const*, int, int, int, unsigned int*, int)
Line
Count
Source
249
19
                                 type *dest, int dstride)           \
250
19
{                                                                   \
251
19
    qt_memrotate90_tiled_unpacked(src, w, h, sstride, dest, dstride); \
252
19
}                                                                   \
Unexecuted instantiation: qt_memrotate90(quint24 const*, int, int, int, quint24*, int)
253
Q_GUI_EXPORT void qt_memrotate180(const type *src, int w, int h, int sstride, \
254
17
                                  type *dest, int dstride)          \
255
17
{                                                                   \
256
17
    qt_memrotate180_template(src, w, h, sstride, dest, dstride);    \
257
17
}                                                                   \
Unexecuted instantiation: qt_memrotate180(QRgbaFloat<float> const*, int, int, int, QRgbaFloat<float>*, int)
qt_memrotate180(unsigned long long const*, int, int, int, unsigned long long*, int)
Line
Count
Source
254
7
                                  type *dest, int dstride)          \
255
7
{                                                                   \
256
7
    qt_memrotate180_template(src, w, h, sstride, dest, dstride);    \
257
7
}                                                                   \
qt_memrotate180(unsigned int const*, int, int, int, unsigned int*, int)
Line
Count
Source
254
10
                                  type *dest, int dstride)          \
255
10
{                                                                   \
256
10
    qt_memrotate180_template(src, w, h, sstride, dest, dstride);    \
257
10
}                                                                   \
Unexecuted instantiation: qt_memrotate180(quint24 const*, int, int, int, quint24*, int)
258
Q_GUI_EXPORT void qt_memrotate270(const type *src, int w, int h, int sstride, \
259
28
                                  type *dest, int dstride)          \
260
28
{                                                                   \
261
28
    qt_memrotate270_tiled_unpacked(src, w, h, sstride, dest, dstride); \
262
28
}
Unexecuted instantiation: qt_memrotate270(QRgbaFloat<float> const*, int, int, int, QRgbaFloat<float>*, int)
qt_memrotate270(unsigned long long const*, int, int, int, unsigned long long*, int)
Line
Count
Source
259
14
                                  type *dest, int dstride)          \
260
14
{                                                                   \
261
14
    qt_memrotate270_tiled_unpacked(src, w, h, sstride, dest, dstride); \
262
14
}
qt_memrotate270(unsigned int const*, int, int, int, unsigned int*, int)
Line
Count
Source
259
14
                                  type *dest, int dstride)          \
260
14
{                                                                   \
261
14
    qt_memrotate270_tiled_unpacked(src, w, h, sstride, dest, dstride); \
262
14
}
Unexecuted instantiation: qt_memrotate270(quint24 const*, int, int, int, quint24*, int)
263
264
QT_IMPL_SIMPLE_MEMROTATE(QRgbaFloat32)
265
QT_IMPL_SIMPLE_MEMROTATE(quint64)
266
QT_IMPL_SIMPLE_MEMROTATE(quint32)
267
QT_IMPL_SIMPLE_MEMROTATE(quint24)
268
QT_IMPL_MEMROTATE(quint16)
269
QT_IMPL_MEMROTATE(quint8)
270
271
void qt_memrotate90_8(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
272
0
{
273
0
    qt_memrotate90(srcPixels, w, h, sbpl, destPixels, dbpl);
274
0
}
275
276
void qt_memrotate180_8(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
277
0
{
278
0
    qt_memrotate180(srcPixels, w, h, sbpl, destPixels, dbpl);
279
0
}
280
281
void qt_memrotate270_8(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
282
0
{
283
0
    qt_memrotate270(srcPixels, w, h, sbpl, destPixels, dbpl);
284
0
}
285
286
void qt_memrotate90_16(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
287
0
{
288
0
    qt_memrotate90((const ushort *)srcPixels, w, h, sbpl, (ushort *)destPixels, dbpl);
289
0
}
290
291
void qt_memrotate180_16(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
292
0
{
293
0
    qt_memrotate180((const ushort *)srcPixels, w, h, sbpl, (ushort *)destPixels, dbpl);
294
0
}
295
296
void qt_memrotate270_16(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
297
0
{
298
0
    qt_memrotate270((const ushort *)srcPixels, w, h, sbpl, (ushort *)destPixels, dbpl);
299
0
}
300
301
void qt_memrotate90_24(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
302
0
{
303
0
    qt_memrotate90((const quint24 *)srcPixels, w, h, sbpl, (quint24 *)destPixels, dbpl);
304
0
}
305
306
void qt_memrotate180_24(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
307
0
{
308
0
    qt_memrotate180((const quint24 *)srcPixels, w, h, sbpl, (quint24 *)destPixels, dbpl);
309
0
}
310
311
void qt_memrotate270_24(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
312
0
{
313
0
    qt_memrotate270((const quint24 *)srcPixels, w, h, sbpl, (quint24 *)destPixels, dbpl);
314
0
}
315
316
void qt_memrotate90_32(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
317
19
{
318
19
    qt_memrotate90((const uint *)srcPixels, w, h, sbpl, (uint *)destPixels, dbpl);
319
19
}
320
321
void qt_memrotate180_32(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
322
10
{
323
10
    qt_memrotate180((const uint *)srcPixels, w, h, sbpl, (uint *)destPixels, dbpl);
324
10
}
325
326
void qt_memrotate270_32(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
327
14
{
328
14
    qt_memrotate270((const uint *)srcPixels, w, h, sbpl, (uint *)destPixels, dbpl);
329
14
}
330
331
332
void qt_memrotate90_64(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
333
19
{
334
19
    qt_memrotate90((const quint64 *)srcPixels, w, h, sbpl, (quint64 *)destPixels, dbpl);
335
19
}
336
337
void qt_memrotate180_64(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
338
7
{
339
7
    qt_memrotate180((const quint64 *)srcPixels, w, h, sbpl, (quint64 *)destPixels, dbpl);
340
7
}
341
342
void qt_memrotate270_64(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
343
14
{
344
14
    qt_memrotate270((const quint64 *)srcPixels, w, h, sbpl, (quint64 *)destPixels, dbpl);
345
14
}
346
347
void qt_memrotate90_128(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
348
0
{
349
0
    qt_memrotate90((const QRgbaFloat32 *)srcPixels, w, h, sbpl, (QRgbaFloat32 *)destPixels, dbpl);
350
0
}
351
352
void qt_memrotate180_128(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
353
0
{
354
0
    qt_memrotate180((const QRgbaFloat32 *)srcPixels, w, h, sbpl, (QRgbaFloat32 *)destPixels, dbpl);
355
0
}
356
357
void qt_memrotate270_128(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
358
0
{
359
0
    qt_memrotate270((const QRgbaFloat32 *)srcPixels, w, h, sbpl, (QRgbaFloat32 *)destPixels, dbpl);
360
0
}
361
362
MemRotateFunc qMemRotateFunctions[QPixelLayout::BPPCount][3] =
363
// 90, 180, 270
364
{
365
    { nullptr, nullptr, nullptr },      // BPPNone,
366
    { nullptr, nullptr, nullptr },      // BPP1MSB,
367
    { nullptr, nullptr, nullptr },      // BPP1LSB,
368
    { qt_memrotate90_8, qt_memrotate180_8, qt_memrotate270_8 },         // BPP8,
369
    { qt_memrotate90_16, qt_memrotate180_16, qt_memrotate270_16 },      // BPP16,
370
    { qt_memrotate90_24, qt_memrotate180_24, qt_memrotate270_24 },      // BPP24
371
    { qt_memrotate90_32, qt_memrotate180_32, qt_memrotate270_32 },      // BPP32
372
    { qt_memrotate90_64, qt_memrotate180_64, qt_memrotate270_64 },      // BPP64
373
    { qt_memrotate90_64, qt_memrotate180_64, qt_memrotate270_64 },      // BPP16FPx4
374
    { qt_memrotate90_128, qt_memrotate180_128, qt_memrotate270_128 },   // BPP32FPx4
375
};
376
377
QT_END_NAMESPACE