Summary: | Allow more conservative memory management | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Dik Takken <kde> |
Component: | Plugin-Editor-Curves | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | andi.clemens, caulier.gilles |
Priority: | NOR | ||
Version: | 0.9.4 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 3.0.0 | |
Sentry Crash Report: |
Description
Dik Takken
2008-06-03 21:54:27 UTC
SVN commit 851712 by cgilles: digiKam from KDE3 branch : AdjustCurves tool : memory consume optimization. No need to duplicates original image data here: we can use the instance from editor instead. Andi, this way can be applied in others image plugins if necessary. i'm sure that we will find old code to polish by thi way. CCBUGS: 163164 M +7 -13 adjustcurves.cpp M +1 -1 adjustcurves.h --- branches/extragear/kde3/graphics/digikam/imageplugins/adjustcurves/adjustcurves.cpp #851711:851712 @@ -87,18 +87,12 @@ AdjustCurveTool::AdjustCurveTool(QObject* parent) : EditorTool(parent) { - m_destinationPreviewData = 0L; + m_destinationPreviewData = 0; ImageIface iface(0, 0); - uchar *data = iface.getOriginalImage(); - int w = iface.originalWidth(); - int h = iface.originalHeight(); - bool sixteenBit = iface.originalSixteenBit(); - bool hasAlpha = iface.originalHasAlpha(); - m_originalImage = DImg(w, h, sixteenBit, hasAlpha ,data); - delete [] data; + m_originalImage = iface.getOriginalImg(); - m_histoSegments = m_originalImage.sixteenBit() ? 65535 : 255; + m_histoSegments = m_originalImage->sixteenBit() ? 65535 : 255; setName("adjustcurves"); setToolName(i18n("Adjust Curves")); @@ -191,8 +185,8 @@ QLabel *spacev = new QLabel(curveBox); spacev->setFixedWidth(1); - m_curvesWidget = new CurvesWidget(256, 256, m_originalImage.bits(), m_originalImage.width(), - m_originalImage.height(), m_originalImage.sixteenBit(), + m_curvesWidget = new CurvesWidget(256, 256, m_originalImage->bits(), m_originalImage->width(), + m_originalImage->height(), m_originalImage->sixteenBit(), curveBox); QWhatsThis::add( m_curvesWidget, i18n("<p>This is the curve drawing of the selected channel from " "original image")); @@ -576,7 +570,7 @@ QPoint disable(-1, -1); QPoint p = config->readPointEntry(QString("CurveAjustmentChannel%1Point%2").arg(i).arg(j), &disable); - if (m_originalImage.sixteenBit() && p.x() != -1) + if (m_originalImage->sixteenBit() && p.x() != -1) { p.setX(p.x()*255); p.setY(p.y()*255); @@ -607,7 +601,7 @@ { QPoint p = m_curvesWidget->curves()->getCurvePoint(i, j); - if (m_originalImage.sixteenBit() && p.x() != -1) + if (m_originalImage->sixteenBit() && p.x() != -1) { p.setX(p.x()/255); p.setY(p.y()/255); --- branches/extragear/kde3/graphics/digikam/imageplugins/adjustcurves/adjustcurves.h #851711:851712 @@ -132,7 +132,7 @@ Digikam::ImageWidget *m_previewWidget; - Digikam::DImg m_originalImage; + Digikam::DImg *m_originalImage; }; } // NameSpace DigikamAdjustCurvesImagesPlugin Andi, Please look this patch and my comment. We need to apply the same way on all image plugins when we will port code to Editor Tool api Gilles Ok... we can do it when actually converting the imageplugins. Right now I'm in the "converting the widgets" flow :-) Andi Dik, This entry still valid with 2.x serie ? Gilles Caulier Gentoo is still on 1.9. I'll test again when 2.x is stable. On 1.9, the problem is still the same. Dik, This file still valid using digiKam 2.4 ? Gilles Caulier Dik, No news from this entry please ? Gilles Caulier Sorry it took so long, but 2.x is much better in this respect. Resolving as fixed. |