1
/* ============================================================
3
* This file is a part of digiKam project
4
* http://www.digikam.org
7
* Description : image levels manipulation methods.
9
* Copyright (C) 2004-2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
11
* This program is free software; you can redistribute it
12
* and/or modify it under the terms of the GNU General
13
* Public License as published by the Free Software Foundation;
14
* either version 2, or (at your option)
17
* This program is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
* GNU General Public License for more details.
22
* ============================================================ */
34
#include "digikam_export.h"
39
class ImageLevelsPriv;
42
class DIGIKAM_EXPORT ImageLevels
47
ImageLevels(bool sixteenBit);
54
// Methods for to manipulate the levels data.
56
void levelsChannelReset(int channel);
57
void levelsAuto(ImageHistogram* hist);
58
void levelsChannelAuto(ImageHistogram* hist, int channel);
59
int levelsInputFromColor(int channel, const DColor& color);
60
void levelsBlackToneAdjustByColors(int channel, const DColor& color);
61
void levelsGrayToneAdjustByColors(int channel, const DColor& color);
62
void levelsWhiteToneAdjustByColors(int channel, const DColor& color);
63
void levelsCalculateTransfers();
64
float levelsLutFunc(int nchannels, int channel, float value);
65
void levelsLutSetup(int nchannels);
66
void levelsLutProcess(uchar* srcPR, uchar* destPR, int w, int h);
68
// Methods for to set manually the levels values.
70
void setLevelGammaValue(int channel, double val);
71
void setLevelLowInputValue(int channel, int val);
72
void setLevelHighInputValue(int channel, int val);
73
void setLevelLowOutputValue(int channel, int val);
74
void setLevelHighOutputValue(int channel, int val);
76
double getLevelGammaValue(int channel);
77
int getLevelLowInputValue(int channel);
78
int getLevelHighInputValue(int channel);
79
int getLevelLowOutputValue(int channel);
80
int getLevelHighOutputValue(int channel);
82
// Methods for to save/load the levels values to/from a Gimp levels text file.
84
bool saveLevelsToGimpLevelsFile(const KUrl& fileUrl);
85
bool loadLevelsFromGimpLevelsFile(const KUrl& fileUrl);
89
ImageLevelsPriv* const d;
92
} // namespace Digikam
94
#endif /* IMAGELEVELS_H */