[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [Bug 152192] resize really bad qualitatively
From:       Gilles Caulier <caulier.gilles () gmail ! com>
Date:       2007-11-21 8:54:08
Message-ID: 20071121085408.17149.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
         
http://bugs.kde.org/show_bug.cgi?id=152192         




------- Additional Comments From caulier.gilles gmail com  2007-11-21 09:54 -------
To be clean in digiKam code about CImg, i have contacted David Tschumperlé (Cimg \
author) to have tips around this problem. 

Sound like we cannot use directly a simple CImg::resize(), but an iteration of \
progressive half resizements :

void GreycstorationIface::simpleResize()
{
    const unsigned int method = 3;      // Initial estimate (0, none, 1=block, \
3=linear, 4=grid, 5=bicubic).

    int w = m_destImage.width();
    int h = m_destImage.height();

    while (d->img.dimx() > 2*w &&
           d->img.dimy() > 2*h)
    {
        d->img.resize_halfXY();
    }

    d->img.resize(w, h, -100, -100, method);
}

I have patched my Digikam::CImg interface and now result is similar than others \
algorithm...

Gilles... Who love clean code (:=)))


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic