[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/extragear/kde3/graphics/digikam/libs/curves
From: Gilles Caulier <caulier.gilles () gmail ! com>
Date: 2008-08-09 12:06:24
Message-ID: 1218283584.101800.1799.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 844333 by cgilles:
polish
M +13 -11 imagecurves.cpp
M +7 -7 imagecurves.h
--- branches/extragear/kde3/graphics/digikam/libs/curves/imagecurves.cpp #844332:844333
@@ -112,17 +112,17 @@
delete [] d->lut->luts;
}
-
+
delete d->lut;
}
-
+
if (d->curves)
delete d->curves;
-
+
delete d;
}
-void ImageCurves::curvesReset(void)
+void ImageCurves::curvesReset()
{
memset(d->curves, 0, sizeof(struct ImageCurvesPriv::_Curves));
d->lut->luts = NULL;
@@ -138,16 +138,16 @@
void ImageCurves::curvesChannelReset(int channel)
{
int j;
-
+
if (!d->curves) return;
// Contruct a linear curve.
-
+
for (j = 0 ; j <= d->segmentMax ; j++)
d->curves->curve[channel][j] = j;
// Init coordinates points to null.
-
+
for (j = 0 ; j < 17 ; j++)
{
d->curves->points[channel][j][0] = -1;
@@ -155,7 +155,7 @@
}
// First and last points init.
-
+
d->curves->points[channel][0][0] = 0;
d->curves->points[channel][0][1] = 0;
d->curves->points[channel][16][0] = d->segmentMax;
@@ -529,12 +529,12 @@
QPointArray ImageCurves::getCurvePoints(int channel)
{
- QPointArray array(16);
+ QPointArray array(17);
if ( d->curves &&
channel>=0 && channel<5)
{
- for (int j = 0 ; j < 17 ; j++)
+ for (int j = 0 ; j <= 17 ; j++)
array.setPoint(j, getCurvePoint(channel, j));
}
@@ -595,10 +595,12 @@
{
if ( d->curves &&
channel>=0 && channel<5 &&
- vals.size() == 16 )
+ vals.size() == 17 )
{
for (int j = 0 ; j < 17 ; j++)
+ {
setCurvePoint(channel, j, vals.point(j));
+ }
}
}
--- branches/extragear/kde3/graphics/digikam/libs/curves/imagecurves.h #844332:844333
@@ -58,21 +58,21 @@
typedef double CRMatrix[4][4];
public:
-
+
ImageCurves(bool sixteenBit);
~ImageCurves();
// Methods for to manipulate the curves data.
-
- void curvesReset(void);
+
+ void curvesReset();
void curvesChannelReset(int channel);
void curvesCalculateCurve(int channel);
float curvesLutFunc(int n_channels, int channel, float value);
void curvesLutSetup(int nchannels);
void curvesLutProcess(uchar *srcPR, uchar *destPR, int w, int h);
- // Methods for to set manually the curves values.
-
+ // Methods for to set manually the curves values.
+
void setCurveValue(int channel, int bin, int val);
void setCurvePointX(int channel, int point, int x);
void setCurvePointY(int channel, int point, int y);
@@ -90,12 +90,12 @@
QPointArray getCurvePoints(int channel);
// Methods for to save/load the curves values to/from a Gimp curves text file.
-
+
bool saveCurvesToGimpCurvesFile(const KURL& fileUrl);
bool loadCurvesFromGimpCurvesFile(const KURL& fileUrl);
private:
-
+
void curvesPlotCurve(int channel, int p1, int p2, int p3, int p4);
void curvesCRCompose(CRMatrix a, CRMatrix b, CRMatrix ab);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic