Coverage Report

Created: 2025-09-08 07:52

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