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));
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) );
89 VP1Msg::messageDebug(
"VP1QtUtils::setEnvironmentVariable WARNING: called with empty variable name!");
97 QSettings generalSettings(
"ATLAS",
"VP1Light");
100 QSettings expertSettings(QCoreApplication::applicationDirPath()+
"/../vp1.ini", QSettings::NativeFormat);
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 ));
129 QByteArray
env = qgetenv(
name.toStdString().c_str());
130 QString
val(
env.isNull() ?
"" : QString (
env ));
148 if (
name.isEmpty()) {
149 VP1Msg::messageDebug(
"VP1QtUtils::setEnvironmentVariable WARNING: called with empty variable name!");
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() );