~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to libs/dimg/filters/levels/imagelevels.h

  • Committer: Bazaar Package Importer
  • Author(s): Christian Mangold
  • Date: 2010-04-09 21:30:01 UTC
  • mfrom: (1.2.28 upstream)
  • Revision ID: james.westby@ubuntu.com-20100409213001-4bfyibrd359rn7o3
Tags: 2:1.2.0-0ubuntu1
* New upstream release (LP: #560576)
* Remove all patches, fixed upstream
  - Remove quilt build-depend

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ============================================================
 
2
 *
 
3
 * This file is a part of digiKam project
 
4
 * http://www.digikam.org
 
5
 *
 
6
 * Date        : 2004-07-29
 
7
 * Description : image levels manipulation methods.
 
8
 *
 
9
 * Copyright (C) 2004-2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
10
 *
 
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)
 
15
 * any later version.
 
16
 *
 
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.
 
21
 *
 
22
 * ============================================================ */
 
23
 
 
24
#ifndef IMAGELEVELS_H
 
25
#define IMAGELEVELS_H
 
26
 
 
27
// KDE includes
 
28
 
 
29
#include <kurl.h>
 
30
 
 
31
// Local includes
 
32
 
 
33
#include "dcolor.h"
 
34
#include "digikam_export.h"
 
35
 
 
36
namespace Digikam
 
37
{
 
38
 
 
39
class ImageLevelsPriv;
 
40
class ImageHistogram;
 
41
 
 
42
class DIGIKAM_EXPORT ImageLevels
 
43
{
 
44
 
 
45
public:
 
46
 
 
47
    ImageLevels(bool sixteenBit);
 
48
    ~ImageLevels();
 
49
 
 
50
    bool   isDirty();
 
51
    bool   isSixteenBits();
 
52
    void   reset();
 
53
 
 
54
    // Methods for to manipulate the levels data.
 
55
 
 
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);
 
67
 
 
68
    // Methods for to set manually the levels values.
 
69
 
 
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);
 
75
 
 
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);
 
81
 
 
82
    // Methods for to save/load the levels values to/from a Gimp levels text file.
 
83
 
 
84
    bool   saveLevelsToGimpLevelsFile(const KUrl& fileUrl);
 
85
    bool   loadLevelsFromGimpLevelsFile(const KUrl& fileUrl);
 
86
 
 
87
private:
 
88
 
 
89
    ImageLevelsPriv* const d;
 
90
};
 
91
 
 
92
}  // namespace Digikam
 
93
 
 
94
#endif /* IMAGELEVELS_H */