digiKam
filmfilter_p.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2012-02-05
7  * Description : film color negative inverter filter
8  *
9  * Copyright (C) 2012 by Matthias Welwarsky <matthias at welwarsky dot de>
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 DIGIKAM_FILM_FILTER_PRIVATE_H
25 #define DIGIKAM_FILM_FILTER_PRIVATE_H
26 
27 #include "filmfilter.h"
28 
29 namespace Digikam
30 {
31 
32 class DColor;
33 
34 class Q_DECL_HIDDEN FilmProfile
35 {
36 public:
37 
38  explicit FilmProfile(double rdm = 0.0, double gdm = 0.0, double bdm = 0.0)
39  : redDmax (rdm),
40  greenDmax(gdm),
41  blueDmax (bdm),
42  rBalance (1.0),
43  gBalance (1.0),
44  bBalance (1.0),
45  wpRed (1.0),
46  wpGreen (1.0),
47  wpBlue (1.0)
48  {
49  }
50 
51  double dmax(int channel) const
52  {
53  switch (channel)
54  {
55  case RedChannel:
56  return redDmax;
57 
58  case GreenChannel:
59  return greenDmax;
60 
61  case BlueChannel:
62  return blueDmax;
63 
64  default:
65  return 0.0;
66  }
67  }
68 
69  FilmProfile& setBalance(double rB, double gB, double bB)
70  {
71  rBalance = rB;
72  gBalance = gB;
73  bBalance = bB;
74 
75  return *this;
76  }
77 
78  double balance(int channel) const
79  {
80  switch (channel)
81  {
82  case RedChannel:
83  return rBalance;
84 
85  case GreenChannel:
86  return gBalance;
87 
88  case BlueChannel:
89  return bBalance;
90 
91  default:
92  return 1.0;
93  }
94  }
95 
96  FilmProfile& setWp(double rWp, double gWp, double bWp)
97  {
98  wpRed = rWp;
99  wpGreen = gWp;
100  wpBlue = bWp;
101 
102  return *this;
103  }
104 
105  double wp(int channel) const
106  {
107  switch (channel)
108  {
109  case RedChannel:
110  return wpRed;
111 
112  case GreenChannel:
113  return wpGreen;
114 
115  case BlueChannel:
116  return wpBlue;
117 
118  default:
119  return 1.0;
120  }
121  }
122 
123 private:
124 
125  double redDmax;
126  double greenDmax;
127  double blueDmax;
128 
129  double rBalance;
130  double gBalance;
131  double bBalance;
132 
133  double wpRed;
134  double wpGreen;
135  double wpBlue;
136 };
137 
138 // --------------------------------------------------------------------------------------------------------
139 
140 class Q_DECL_HIDDEN FilmContainer::Private
141 {
142 public:
143 
144  explicit Private()
145  : gamma (1.0),
146  exposure (1.0),
147  sixteenBit (false),
148  profile (FilmProfile(1.0, 1.0, 1.0)),
149  cnType (CNNeutral),
150  whitePoint (DColor(QColor("white"), false)),
151  applyBalance(true)
152  {
153  }
154 
156  {
157  }
158 
159  double gamma;
160  double exposure;
166 };
167 
168 // ------------------------------------------------------------------
169 
170 class Q_DECL_HIDDEN FilmFilter::Private
171 {
172 public:
173 
174  explicit Private()
175  {
176  }
177 
179  {
180  }
181 
183 };
184 
185 } // namespace Digikam
186 
187 #endif // DIGIKAM_FILM_FILTER_PRIVATE_H
Definition: dcolor.h:43
Definition: filmfilter_p.h:141
~Private()
Definition: filmfilter_p.h:155
double exposure
Definition: filmfilter_p.h:160
FilmProfile profile
Definition: filmfilter_p.h:162
bool sixteenBit
Definition: filmfilter_p.h:161
CNFilmProfile cnType
Definition: filmfilter_p.h:163
Private()
Definition: filmfilter_p.h:144
double gamma
Definition: filmfilter_p.h:159
DColor whitePoint
Definition: filmfilter_p.h:164
bool applyBalance
Definition: filmfilter_p.h:165
Definition: filmfilter.h:44
CNFilmProfile
Definition: filmfilter.h:48
Definition: filmfilter_p.h:171
~Private()
Definition: filmfilter_p.h:178
FilmContainer film
Definition: filmfilter_p.h:182
Private()
Definition: filmfilter_p.h:174
Definition: filmfilter.h:144
Definition: filmfilter_p.h:35
double dmax(int channel) const
Definition: filmfilter_p.h:51
FilmProfile(double rdm=0.0, double gdm=0.0, double bdm=0.0)
Definition: filmfilter_p.h:38
double balance(int channel) const
Definition: filmfilter_p.h:78
double wp(int channel) const
Definition: filmfilter_p.h:105
FilmProfile & setWp(double rWp, double gWp, double bWp)
Definition: filmfilter_p.h:96
FilmProfile & setBalance(double rB, double gB, double bB)
Definition: filmfilter_p.h:69
Definition: datefolderview.cpp:43
@ GreenChannel
Definition: digikam_globals.h:162
@ RedChannel
Definition: digikam_globals.h:161
@ BlueChannel
Definition: digikam_globals.h:163