~ubuntu-branches/ubuntu/maverick/kdegraphics/maverick-proposed

« back to all changes in this revision

Viewing changes to libs/libkdcraw/libkdcraw/rawdecodingsettings.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2009-12-02 14:03:43 UTC
  • mfrom: (1.1.35 upstream)
  • Revision ID: james.westby@ubuntu.com-20091202140343-2732gbkj69g89arq
Tags: 4:4.3.80-0ubuntu1
* New upstream beta release:
  - Add build-depend on shared-desktop-ontologies for nepomuk integration
  - Bump .so versions for libkexiv, libkdcraw and libkipi
  - Update various .install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ============================================================
 
2
 *
 
3
 * This file is a part of kipi-plugins project
 
4
 * http://www.kipi-plugins.org
 
5
 *
 
6
 * Date        : 2006-12-09
 
7
 * Description : Raw decoding settings
 
8
 *
 
9
 * Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
10
 * Copyright (C) 2006-2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
 
11
 * Copyright (C) 2007-2008 by Guillaume Castagnino <casta at xwing dot info>
 
12
 *
 
13
 * This program is free software; you can redistribute it
 
14
 * and/or modify it under the terms of the GNU General
 
15
 * Public License as published by the Free Software Foundation;
 
16
 * either version 2, or (at your option) any later version.
 
17
 *
 
18
 * This program is distributed in the hope that it will be useful,
 
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
 * GNU General Public License for more details.
 
22
 *
 
23
 * ============================================================ */
 
24
 
 
25
// Local includes
 
26
 
 
27
#include "rawdecodingsettings.h"
 
28
 
 
29
namespace KDcrawIface
 
30
{
 
31
 
 
32
RawDecodingSettings::RawDecodingSettings()
 
33
{
 
34
    autoBrightness             = true;
 
35
    sixteenBitsImage           = false;
 
36
    brightness                 = 1.0;
 
37
    RAWQuality                 = BILINEAR;
 
38
    inputColorSpace            = NOINPUTCS;
 
39
    outputColorSpace           = SRGB;
 
40
    RGBInterpolate4Colors      = false;
 
41
    DontStretchPixels          = false;
 
42
    unclipColors               = 0;
 
43
    whiteBalance               = CAMERA;
 
44
    customWhiteBalance         = 6500;
 
45
    customWhiteBalanceGreen    = 1.0;
 
46
    medianFilterPasses         = 0;
 
47
 
 
48
    halfSizeColorImage         = false;
 
49
 
 
50
    enableBlackPoint           = false;
 
51
    blackPoint                 = 0;
 
52
 
 
53
    enableWhitePoint           = false;
 
54
    whitePoint                 = 0;
 
55
 
 
56
    enableNoiseReduction       = false;
 
57
    NRThreshold                = 100;
 
58
 
 
59
    enableCACorrection         = false;
 
60
    caMultiplier[0]            = 1.0;
 
61
    caMultiplier[1]            = 1.0;
 
62
 
 
63
    inputProfile               = QString();
 
64
    outputProfile              = QString();
 
65
 
 
66
    deadPixelMap               = QString();
 
67
 
 
68
    whiteBalanceArea           = QRect();
 
69
}
 
70
 
 
71
bool RawDecodingSettings::operator==(const RawDecodingSettings &o) const
 
72
{
 
73
    return autoBrightness          == o.autoBrightness
 
74
        && sixteenBitsImage        == o.sixteenBitsImage
 
75
        && brightness              == o.brightness
 
76
        && RAWQuality              == o.RAWQuality
 
77
        && inputColorSpace         == o.inputColorSpace
 
78
        && outputColorSpace        == o.outputColorSpace
 
79
        && RGBInterpolate4Colors   == o.RGBInterpolate4Colors
 
80
        && DontStretchPixels       == o.DontStretchPixels
 
81
        && unclipColors            == o.unclipColors
 
82
        && whiteBalance            == o.whiteBalance
 
83
        && customWhiteBalance      == o.customWhiteBalance
 
84
        && customWhiteBalanceGreen == o.customWhiteBalanceGreen
 
85
        && halfSizeColorImage      == o.halfSizeColorImage
 
86
        && enableBlackPoint        == o.enableBlackPoint
 
87
        && blackPoint              == o.blackPoint
 
88
        && enableWhitePoint        == o.enableWhitePoint
 
89
        && whitePoint              == o.whitePoint
 
90
        && enableNoiseReduction    == o.enableNoiseReduction
 
91
        && NRThreshold             == o.NRThreshold
 
92
        && enableCACorrection      == o.enableCACorrection
 
93
        && caMultiplier[0]         == o.caMultiplier[0]
 
94
        && caMultiplier[1]         == o.caMultiplier[1]
 
95
        && medianFilterPasses      == o.medianFilterPasses
 
96
        && inputProfile            == o.inputProfile
 
97
        && outputProfile           == o.outputProfile
 
98
        && deadPixelMap            == o.deadPixelMap
 
99
        && whiteBalanceArea        == o.whiteBalanceArea
 
100
        ;
 
101
}
 
102
 
 
103
RawDecodingSettings::~RawDecodingSettings()
 
104
{
 
105
}
 
106
 
 
107
void RawDecodingSettings::optimizeTimeLoading()
 
108
{
 
109
    autoBrightness          = true;
 
110
    sixteenBitsImage        = true;
 
111
    brightness              = 1.0;
 
112
    RAWQuality              = BILINEAR;
 
113
    inputColorSpace         = NOINPUTCS;
 
114
    outputColorSpace        = SRGB;
 
115
    RGBInterpolate4Colors   = false;
 
116
    DontStretchPixels       = false;
 
117
    unclipColors            = 0;
 
118
    whiteBalance            = CAMERA;
 
119
    customWhiteBalance      = 6500;
 
120
    customWhiteBalanceGreen = 1.0;
 
121
    halfSizeColorImage      = true;
 
122
    medianFilterPasses      = 0;
 
123
 
 
124
    enableBlackPoint        = false;
 
125
    blackPoint              = 0;
 
126
 
 
127
    enableWhitePoint        = false;
 
128
    whitePoint              = 0;
 
129
 
 
130
    enableNoiseReduction    = false;
 
131
    NRThreshold             = 100;
 
132
 
 
133
    enableCACorrection      = false;
 
134
    caMultiplier[0]         = 1.0;
 
135
    caMultiplier[1]         = 1.0;
 
136
 
 
137
    inputProfile            = QString();
 
138
    outputProfile           = QString();
 
139
 
 
140
    deadPixelMap            = QString();
 
141
 
 
142
    whiteBalanceArea        = QRect();
 
143
}
 
144
 
 
145
QDebug operator<<(QDebug dbg, const RawDecodingSettings& s)
 
146
{
 
147
    dbg.nospace() << "RawDecodingSettings::autoBrightness: "          << s.autoBrightness   << ", ";
 
148
    dbg.nospace() << "RawDecodingSettings::sixteenBitsImage: "        << s.sixteenBitsImage << ", ";
 
149
    dbg.nospace() << "RawDecodingSettings::brightness: "              << s.brightness << ", ";
 
150
    dbg.nospace() << "RawDecodingSettings::RAWQuality: "              << s.RAWQuality << ", ";
 
151
    dbg.nospace() << "RawDecodingSettings::inputColorSpace: "         << s.inputColorSpace << ", ";
 
152
    dbg.nospace() << "RawDecodingSettings::outputColorSpace: "        << s.outputColorSpace << ", ";
 
153
    dbg.nospace() << "RawDecodingSettings::RGBInterpolate4Colors: "   << s.RGBInterpolate4Colors << ", ";
 
154
    dbg.nospace() << "RawDecodingSettings::DontStretchPixels: "       << s.DontStretchPixels << ", ";
 
155
    dbg.nospace() << "RawDecodingSettings::unclipColors: "            << s.unclipColors << ", ";
 
156
    dbg.nospace() << "RawDecodingSettings::whiteBalance: "            << s.whiteBalance << ", ";
 
157
    dbg.nospace() << "RawDecodingSettings::customWhiteBalance: "      << s.customWhiteBalance << ", ";
 
158
    dbg.nospace() << "RawDecodingSettings::customWhiteBalanceGreen: " << s.customWhiteBalanceGreen << ", ";
 
159
    dbg.nospace() << "RawDecodingSettings::halfSizeColorImage: "      << s.halfSizeColorImage << ", ";
 
160
    dbg.nospace() << "RawDecodingSettings::enableBlackPoint: "        << s.enableBlackPoint << ", ";
 
161
    dbg.nospace() << "RawDecodingSettings::blackPoint: "              << s.blackPoint << ", ";
 
162
    dbg.nospace() << "RawDecodingSettings::enableWhitePoint: "        << s.enableWhitePoint << ", ";
 
163
    dbg.nospace() << "RawDecodingSettings::whitePoint: "              << s.whitePoint << ", ";
 
164
    dbg.nospace() << "RawDecodingSettings::enableNoiseReduction: "    << s.enableNoiseReduction << ", ";
 
165
    dbg.nospace() << "RawDecodingSettings::NRThreshold: "             << s.NRThreshold << ", ";
 
166
    dbg.nospace() << "RawDecodingSettings::enableCACorrection: "      << s.enableCACorrection << ", ";
 
167
    dbg.nospace() << "RawDecodingSettings::caMultiplier: "            << s.caMultiplier << ", ";
 
168
    dbg.nospace() << "RawDecodingSettings::medianFilterPasses: "      << s.medianFilterPasses << ", ";
 
169
    dbg.nospace() << "RawDecodingSettings::inputProfile: "            << s.inputProfile << ", ";
 
170
    dbg.nospace() << "RawDecodingSettings::outputProfile: "           << s.outputProfile << ", ";
 
171
    dbg.nospace() << "RawDecodingSettings::deadPixelMap: "            << s.deadPixelMap << ", ";
 
172
    dbg.nospace() << "RawDecodingSettings::whiteBalanceArea: "        << s.whiteBalanceArea;
 
173
    return dbg.space();
 
174
}
 
175
 
 
176
}  // namespace KDcrawIface