~ubuntu-branches/ubuntu/trusty/digikam/trusty

« back to all changes in this revision

Viewing changes to core/imageplugins/enhance/hotpixels/weights.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-11-26 18:24:20 UTC
  • mfrom: (1.9.1) (3.1.23 experimental)
  • Revision ID: package-import@ubuntu.com-20121126182420-qoy6z0nx4ai0wzcl
Tags: 4:3.0.0~beta3-0ubuntu1
* New upstream release
  - Add build-deps :  libhupnp-dev, libqtgstreamer-dev, libmagickcore-dev
* Merge from debian, remaining changes:
  - Make sure libqt4-opengl-dev, libgl1-mesa-dev and libglu1-mesa-dev only
    install on i386,amd64 and powerpc
  - Depend on libtiff-dev instead of libtiff4-dev
  - Drop digikam breaks/replaces kipi-plugins-common since we're past the
    LTS release now
  - digikam to recommend mplayerthumbs | ffmpegthumbs. We currently only
    have latter in the archives, even though former is also supposed to
    be part of kdemultimedia. (LP: #890059)
  - kipi-plugins to recommend www-browser rather than konqueror directly
    since 2.8 no direct usage of konqueror is present in the flickr
    plugin anymore (LP: #1011211)
  - Keep kubuntu_mysqld_executable_name.diff
  - Don't install libkipi translations
  - Keep deps on libcv-dev, libcvaux-dev
  - Keep split packaging of libraries
  - Replace icons from KDE 3 time in debian/xpm.d/*.xpm with the new
    versions (LP: #658047)
* Update debian/not-installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 * Description : a class to calculate filter weights
8
8
 *
9
9
 * Copyright (C) 2005-2006 by Unai Garro <ugarro at users dot sourceforge dot net>
10
 
 * Copyright (C) 2005-2010 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
10
 * Copyright (C) 2005-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
11
11
 *
12
12
 * This program is free software; you can redistribute it
13
13
 * and/or modify it under the terms of the GNU General
22
22
 *
23
23
 * ============================================================ */
24
24
 
25
 
 
26
25
#include "weights.h"
27
26
 
 
27
// C++ includes
 
28
 
 
29
#include <cstring>
 
30
 
28
31
// Qt includes
29
32
 
30
33
#include <QScopedArrayPointer>
31
34
 
32
 
// C++ includes
33
 
 
34
 
#include <cstring>
35
 
 
36
 
 
37
35
namespace DigikamEnhanceImagePlugin
38
36
{
39
37
 
72
70
    {
73
71
        double** * origMatrices = w.weightMatrices();
74
72
        // Allocate mPositions.count() matrices
75
 
        mWeightMatrices        = new double** [mPositions.count()];
 
73
        mWeightMatrices         = new double** [mPositions.count()];
76
74
 
77
75
        for (int i=0 ; i < mPositions.count() ; ++i)
78
76
        {
97
95
void Weights::calculateWeights()
98
96
{
99
97
    mCoefficientNumber = (mTwoDim ? ((size_t)mPolynomeOrder + 1) * ((size_t)mPolynomeOrder + 1)
100
 
                          : (size_t)mPolynomeOrder + 1);
 
98
                                  : (size_t)mPolynomeOrder + 1);
101
99
    size_t  ix,iy,i,j;
102
100
    int     x, y;
103
101
 
165
163
                                                    mPositions.at(j).y(), mPolynomeOrder);
166
164
 
167
165
            for (ix = 0; ix < mCoefficientNumber; ++ix)
 
166
            {
168
167
                matrix [iy* mCoefficientNumber + ix] += (vector0 [iy * mPositions.count() + j]
169
168
                                                        * polyTerm (ix, mPositions.at(j).x(), mPositions.at(j).y(), mPolynomeOrder));
 
169
            }
170
170
        }
171
171
    }
172
172
 
216
216
                mWeightMatrices [j][y][x] = 0.0;
217
217
 
218
218
                for (iy = 0; iy < mCoefficientNumber; ++iy)
 
219
                {
219
220
                    mWeightMatrices [j][y][x] += vector1 [iy * mPositions.count() + j]
220
221
                                                 * polyTerm (iy, x, y, mPolynomeOrder);
 
222
                }
221
223
 
222
224
                mWeightMatrices [j][y][x] *= (double) mPositions.count();
223
225
            }