23#include <QCoreApplication>
31 QSettings generalSettings(
"ATLAS",
"VP1Light");
32 set = !generalSettings.value(name).toString().isEmpty();
34 QSettings expertSettings(QCoreApplication::applicationDirPath()+
"/../vp1.ini", QSettings::NativeFormat);
35 set = !expertSettings.value(name).toString().isEmpty();
47 QSettings generalSettings(
"ATLAS",
"VP1Light");
48 env = generalSettings.value(name).toString();
50 QSettings expertSettings(QCoreApplication::applicationDirPath()+
"/../vp1.ini", QSettings::NativeFormat);
51 env = expertSettings.value(name).toString();
53 QString val(env.isNull() ?
"" : std::move(env));
55 VP1Msg::messageVerbose(
"VP1QtUtils::expertSettingValue called for variable '"+name+
"'. Returning '"+ val+
"'.");
64 QSettings generalSettings(
"ATLAS",
"VP1Light");
65 env = generalSettings.value(name).toString();
67 QSettings expertSettings(QCoreApplication::applicationDirPath()+
"/../vp1.ini", QSettings::NativeFormat);
68 env = expertSettings.value(name).toString();
70 QString val(env.isNull() ?
"" : std::move(env) );
72 if (val==
""||val==
"0")
74 else if (0==QString::compare(val,
"false",Qt::CaseInsensitive))
76 else if (0==QString::compare(val,
"off",Qt::CaseInsensitive))
78 else if (0==QString::compare(val,
"no",Qt::CaseInsensitive))
89 VP1Msg::messageDebug(
"VP1QtUtils::setEnvironmentVariable WARNING: called with empty variable name!");
94 VP1Msg::messageVerbose(
"VP1QtUtils::setEnvironmentVariable: Setting variable '"+name+
"' to value '"+content+
"'.");
97 QSettings generalSettings(
"ATLAS",
"VP1Light");
98 generalSettings.setValue(name, content);
100 QSettings expertSettings(QCoreApplication::applicationDirPath()+
"/../vp1.ini", QSettings::NativeFormat);
101 expertSettings.setValue(name, content);
110 const bool set = !qgetenv(name.toStdString().c_str()).isNull();
119 QByteArray env = qgetenv(name.toStdString().c_str());
120 QString val(env.isNull() ?
"" : QString ( env ));
122 VP1Msg::messageVerbose(
"VP1QtUtils::environmentVariableValue called for variable '"+name+
"'. Returning '"+ val+
"'.");
129 QByteArray env = qgetenv(name.toStdString().c_str());
130 QString val(env.isNull() ?
"" : QString ( env ));
132 if (val==
""||val==
"0")
134 else if (0==QString::compare(val,
"false",Qt::CaseInsensitive))
136 else if (0==QString::compare(val,
"off",Qt::CaseInsensitive))
138 else if (0==QString::compare(val,
"no",Qt::CaseInsensitive))
148 if (name.isEmpty()) {
149 VP1Msg::messageDebug(
"VP1QtUtils::setEnvironmentVariable WARNING: called with empty variable name!");
154 VP1Msg::messageVerbose(
"VP1QtUtils::setEnvironmentVariable: Setting variable '"+name+
"' to value '"+content+
"'.");
157 ::setenv(name.toStdString().c_str(),content.toStdString().c_str(),1);
163 if (name.isEmpty()) {
164 VP1Msg::messageDebug(
"VP1QtUtils::unsetEnvironmentVariable WARNING: called with empty variable name!");
172 ::unsetenv(name.toStdString().c_str());
177 if (fadefact<0.0||fadefact>1.0||img0.isNull()||img1.isNull()||img0.width()!=img1.width()||img0.height()!=img1.height())
184 double oneminusfadefact(1.0-fadefact);
185 const int w(img.width()),
h(img.height());
186 for (
int iw = 0; iw<w; ++iw)
187 for (
int ih = 0; ih<
h; ++ih) {
188 QColor col0(img0.pixel(iw,ih));
189 QColor col1(img1.pixel(iw,ih));
190 img.setPixel ( iw,ih,QColor::fromRgbF(col0.redF()*oneminusfadefact + col1.redF()*fadefact,
191 col0.greenF()*oneminusfadefact + col1.greenF()*fadefact,
192 col0.blueF()*oneminusfadefact + col1.blueF()*fadefact).rgb() );
Header file for AthHistogramAlgorithm.
static void messageVerbose(const QString &)
static void messageDebug(const QString &)
static bool environmentVariableIsOn(const QString &name)
static void setExpertSetting(const QString &type, const QString &name, const QString &content)
static bool expertSettingIsSet(const QString &type, const QString &name)
static QImage fadeImage(QImage img0, QImage img1, double fadefact)
static QString expertSettingValue(const QString &type, const QString &name)
static bool environmentVariableIsSet(const QString &name)
static QString environmentVariableValue(const QString &name)
static void unsetEnvironmentVariable(const QString &name)
static bool expertSettingIsOn(const QString &type, const QString &name)
static void setEnvironmentVariable(const QString &name, const QString &content)
static QString str(const QString &s)