~ubuntu-branches/ubuntu/vivid/digikam/vivid

« back to all changes in this revision

Viewing changes to core/libs/dimg/filters/levels/histogrampainter.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-02-14 19:29:29 UTC
  • mfrom: (1.2.38) (3.1.16 experimental)
  • Revision ID: package-import@ubuntu.com-20120214192929-cx2zia3b2nt67lvz
Tags: 4:2.5.0-1ubuntu1
* Merge from debian unstable, remaining changes:
  - keep seperate binary packages:
    + libkface1, libkface-data, libkface-dev
    + libkgeomap1, libkgeomap-data, libkgeomap-dev
    + libvkontakte1, libkvkontakte-dev
    + libmediawiki1, libmediawiki-dev
  - keep patches:
    + kubuntu_mysqld_executable_name.diff
  - don't fail on missing files in dh_install
  - install oxygen icons for kipi-plugins
  - build-depend on mysql 5.5 instead of 5.1
  - update install files
* digikam breaks/replaces kipi-plugins-common << 4:2.5.0~
* digikam-doc breaks/replaces digikam-data << 4:2.5.0~
* digikam-data breaks/replaces kipi-plugins << 4:2.5.0~
* kipi-plugins-common breaks/replaces kipi-plugins << 4:2.5.0~

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
    double calculateMax()
71
71
    {
72
72
        int segments = histogram->getHistogramSegments();
73
 
        int startSeg = (int)(HISTOGRAM_CALC_CUTOFF_MIN * (segments-1));
74
 
        int endSeg   = (int)(HISTOGRAM_CALC_CUTOFF_MAX * (segments-1));
 
73
        int startSeg = (int)(HISTOGRAM_CALC_CUTOFF_MIN * (segments - 1));
 
74
        int endSeg   = (int)(HISTOGRAM_CALC_CUTOFF_MAX * (segments - 1));
75
75
        double max   = 0.0;
76
76
 
77
77
        switch (scale)
161
161
        {
162
162
            case LinScaleHistogram:
163
163
            {
164
 
                return qMin((int) ((pixmapHeight * value) / max), pixmapHeight);
 
164
                return qMin((int)((pixmapHeight * value) / max), pixmapHeight);
165
165
            }
166
166
 
167
167
            case LogScaleHistogram:
177
177
                    return 0;
178
178
                }
179
179
 
180
 
                return qMin((int) ((pixmapHeight * log(value)) / max), pixmapHeight);
 
180
                return qMin((int)((pixmapHeight * log(value)) / max), pixmapHeight);
181
181
            }
182
182
 
183
183
            default:
248
248
 
249
249
        QColor pColor;
250
250
        QColor bColor;
 
251
 
251
252
        switch (channelType)
252
253
        {
253
254
            case GreenChannel:
471
472
            p1.drawLine(xGuide, 0, xGuide, bufferPixmap.height());
472
473
 
473
474
            QString string = i18n("x:%1", guidePos);
474
 
            QFontMetrics fontMt( string );
 
475
            QFontMetrics fontMt(string);
475
476
            QRect rect     = fontMt.boundingRect(0, 0, bufferPixmap.width(), bufferPixmap.height(), 0, string);
476
477
            p1.setPen(QPen(Qt::red, 1, Qt::SolidLine));
477
478
            rect.moveTop(1);
479
480
            if (xGuide < bufferPixmap.width() / 2)
480
481
            {
481
482
                rect.moveLeft(xGuide);
482
 
                p1.fillRect(rect, QBrush(QColor(250, 250, 255)) );
 
483
                p1.fillRect(rect, QBrush(QColor(250, 250, 255)));
483
484
                p1.drawRect(rect);
484
485
                rect.moveLeft(xGuide + 3);
485
486
                p1.drawText(rect, Qt::AlignLeft, string);
487
488
            else
488
489
            {
489
490
                rect.moveRight(xGuide);
490
 
                p1.fillRect(rect, QBrush(QColor(250, 250, 255)) );
 
491
                p1.fillRect(rect, QBrush(QColor(250, 250, 255)));
491
492
                p1.drawRect(rect);
492
493
                rect.moveRight(xGuide - 3);
493
494
                p1.drawText(rect, Qt::AlignRight, string);