~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to libs/dimg/filters/sharp/refocusfilter.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-21 23:19:11 UTC
  • mfrom: (1.2.33 upstream) (3.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20101221231911-z9jip7s5aht1jqn9
Tags: 2:1.7.0-1ubuntu1
* Merge from Debian Experimental. Remaining Ubuntu changes:
  - Export .pot name and copy to plugins in debian/rules
  - Version build-depends on kipi-plugins-dev to ensure build is against the
    same version on all archs
* Drop debian/patches/kubuntu_01_linker.diff, incoporated upstream
* Remove patches directory and unused patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 
51
51
RefocusFilter::RefocusFilter(DImg* orgImage, QObject* parent, int matrixSize, double radius,
52
52
                             double gauss, double correlation, double noise)
53
 
             : DImgThreadedFilter(orgImage, parent, "Refocus")
 
53
    : DImgThreadedFilter(orgImage, parent, "Refocus")
54
54
{
55
55
    m_matrixSize  = matrixSize;
56
56
    m_radius      = radius;
139
139
}
140
140
 
141
141
void RefocusFilter::refocusImage(uchar* data, int width, int height, bool sixteenBit,
142
 
                               int matrixSize, double radius, double gauss,
143
 
                               double correlation, double noise)
 
142
                                 int matrixSize, double radius, double gauss,
 
143
                                 double correlation, double noise)
144
144
{
145
 
    CMat *matrix=0;
 
145
    CMat* matrix=0;
146
146
 
147
147
    // Compute matrix
148
148
    kDebug() << "RefocusFilter::Compute matrix...";
170
170
}
171
171
 
172
172
void RefocusFilter::convolveImage(uchar* orgData, uchar* destData, int width, int height,
173
 
                                bool sixteenBit, const double* const matrix, int mat_size)
 
173
                                  bool sixteenBit, const double* const matrix, int mat_size)
174
174
{
175
175
    int progress;
176
176
    unsigned short* orgData16  = (unsigned short*)orgData;
191
191
            if (!sixteenBit)        // 8 bits image.
192
192
            {
193
193
                uchar red, green, blue;
194
 
                uchar *ptr;
 
194
                uchar* ptr;
195
195
 
196
196
                for (y2 = 0; runningFlag() && (y2 < mat_size); ++y2)
197
197
                {
198
198
                    int y2_matsize = y2 * mat_size;
 
199
 
199
200
                    for (x2 = 0; runningFlag() && (x2 < mat_size); ++x2)
200
201
                    {
201
202
                        index1 = width * (y1 + y2 - mat_offset) +
232
233
            else                 // 16 bits image.
233
234
            {
234
235
                unsigned short red, green, blue;
235
 
                unsigned short *ptr;
 
236
                unsigned short* ptr;
236
237
 
237
238
                for (y2 = 0; runningFlag() && (y2 < mat_size); ++y2)
238
239
                {
239
240
                    int y2_matsize = y2 * mat_size;
 
241
 
240
242
                    for (x2 = 0; runningFlag() && (x2 < mat_size); ++x2)
241
243
                    {
242
244
                        index1 = width * (y1 + y2 - mat_offset) +
274
276
 
275
277
        // Update the progress bar in dialog.
276
278
        progress = (int)(((double)y1 * 100.0) / height);
 
279
 
277
280
        if (progress%5 == 0)
 
281
        {
278
282
            postProgress( progress );
 
283
        }
279
284
    }
280
285
}
281
286