~neon/kolourpaint/master

« back to all changes in this revision

Viewing changes to imagelib/effects/blitz.cpp

  • Committer: André Agenor
  • Date: 2019-04-09 01:34:07 UTC
  • Revision ID: git-v1:cd6a79ef79db5c5c6831b97be861d89fab9d4ce5
remove the OpenMPI dependency

Summary:
Signed-off-by: André Agenor <andreagenor@icloud.com>
OpenMP has no real performance gain because the algorithm is not vectorized

Reviewers: tcanabrava

Reviewed By: tcanabrava

Differential Revision: https://phabricator.kde.org/D20322

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
 
67
67
#include <QColor>
68
68
#include <cmath>
69
 
#include <omp.h>
70
69
 
71
70
#define M_SQ2PI 2.50662827463100024161235523934010416269302368164062
72
71
#define M_EPSILON 1.0e-6
294
293
            QRgb pixel;
295
294
            for (auto i = 0; i < mh; i++) {
296
295
                p2 = (QRgb *)img.scanLine(i + my);
297
 
#pragma omp for
298
296
                for (auto j = 0; j < width; ++j) {
299
297
                    p2++;
300
298
                    pixel = convertFromPremult(*p2);
312
310
            unsigned char *ptr;
313
311
            for (auto i = 0; i < mh; ++i) {
314
312
                ptr = img.scanLine(i + my);
315
 
#pragma omp for
316
313
                for (auto j = 0; j < width; ++j) {
317
314
                    ptr++;
318
315
                    pixel = colorTable[*ptr];
328
325
        default: {
329
326
            for (auto i = 0; i < mh; ++i) {
330
327
                p2 = (QRgb *)img.scanLine(i + my);
331
 
#pragma omp for
332
328
                for (auto j = 0; j < width; j++) {
333
329
                    p2++;
334
330
                    as[j] += qAlpha(*p2);
341
337
        }
342
338
        }
343
339
 
344
 
#pragma omp for
345
340
        for (auto i = 0; i < width; ++i) {
346
341
            auto a{0};
347
342
            auto r{0};