Compare commits
1 Commits
master
...
icc-effect
Author | SHA1 | Date |
---|---|---|
Vitaliy Filippov | d9369375d2 |
|
@ -73,6 +73,11 @@ macro(KWIN4_ADD_EFFECT name)
|
|||
install(TARGETS kwin4_effect_${name} ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
endmacro()
|
||||
|
||||
# For ICC (FIXME remove if building separately)
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(LCMS2 REQUIRED lcms2)
|
||||
set_package_properties(LCMS2 PROPERTIES TYPE REQUIRED PURPOSE "Required for ICC color correction.")
|
||||
|
||||
# Install the KWin/Effect service type
|
||||
install(FILES kwineffect.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
|
||||
|
||||
|
@ -92,6 +97,7 @@ set(kwin4_effect_builtins_sources
|
|||
effect_builtins.cpp
|
||||
flipswitch/flipswitch.cpp
|
||||
glide/glide.cpp
|
||||
icc/icc.cpp
|
||||
invert/invert.cpp
|
||||
logging.cpp
|
||||
lookingglass/lookingglass.cpp
|
||||
|
@ -133,6 +139,7 @@ kconfig_add_kcfg_files(kwin4_effect_builtins_sources
|
|||
fallapart/fallapartconfig.kcfgc
|
||||
flipswitch/flipswitchconfig.kcfgc
|
||||
glide/glideconfig.kcfgc
|
||||
icc/iccconfig.kcfgc
|
||||
lookingglass/lookingglassconfig.kcfgc
|
||||
magiclamp/magiclampconfig.kcfgc
|
||||
magnifier/magnifierconfig.kcfgc
|
||||
|
@ -205,6 +212,7 @@ add_subdirectory(cube)
|
|||
add_subdirectory(cubeslide)
|
||||
add_subdirectory(flipswitch)
|
||||
add_subdirectory(glide)
|
||||
add_subdirectory(icc)
|
||||
add_subdirectory(invert)
|
||||
add_subdirectory(lookingglass)
|
||||
add_subdirectory(magnifier)
|
||||
|
@ -221,3 +229,8 @@ add_subdirectory(wobblywindows)
|
|||
|
||||
# Add the builtins plugin
|
||||
kwin4_add_effect(builtins ${kwin4_effect_builtins_sources})
|
||||
|
||||
# FIXME For ICC, remove if building separately
|
||||
target_link_libraries(kwin4_effect_builtins PUBLIC ${LCMS2_LIBRARIES})
|
||||
target_include_directories(kwin4_effect_builtins PUBLIC ${LCMS2_INCLUDE_DIRS})
|
||||
target_compile_options(kwin4_effect_builtins PUBLIC ${LCMS2_CFLAGS_OTHER})
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "cubeslide/cubeslide.h"
|
||||
#include "flipswitch/flipswitch.h"
|
||||
#include "glide/glide.h"
|
||||
#include "icc/icc.h"
|
||||
#include "invert/invert.h"
|
||||
#include "lookingglass/lookingglass.h"
|
||||
#include "magnifier/magnifier.h"
|
||||
|
@ -265,6 +266,21 @@ EFFECT_FALLBACK
|
|||
nullptr,
|
||||
nullptr
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
}, {
|
||||
QStringLiteral("icc"),
|
||||
i18ndc("kwin_effects", "Name of a KWin Effect", "ICC Color Correction"),
|
||||
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Applies full ICC color correction to the whole display"),
|
||||
QStringLiteral("Appearance"),
|
||||
QString(),
|
||||
QUrl(),
|
||||
false,
|
||||
false,
|
||||
#ifdef EFFECT_BUILTINS
|
||||
&createHelper<ICCEffect>,
|
||||
&ICCEffect::supported,
|
||||
nullptr
|
||||
#endif
|
||||
EFFECT_FALLBACK
|
||||
}, {
|
||||
QStringLiteral("invert"),
|
||||
|
|
|
@ -35,6 +35,7 @@ enum class BuiltInEffect
|
|||
FlipSwitch,
|
||||
Glide,
|
||||
HighlightWindow,
|
||||
ICC,
|
||||
Invert,
|
||||
Kscreen,
|
||||
LookingGlass,
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
#######################################
|
||||
# Effect
|
||||
|
||||
#######################################
|
||||
# Config
|
||||
set(kwin_icc_config_SRCS icc_config.cpp)
|
||||
ki18n_wrap_ui(kwin_icc_config_SRCS icc_config.ui)
|
||||
qt5_add_dbus_interface(kwin_icc_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface)
|
||||
kconfig_add_kcfg_files(kwin_icc_config_SRCS iccconfig.kcfgc)
|
||||
|
||||
add_library(kwin_icc_config MODULE ${kwin_icc_config_SRCS})
|
||||
|
||||
## Build separate plugin
|
||||
#find_package(PkgConfig)
|
||||
#pkg_check_modules(LCMS2 REQUIRED lcms2)
|
||||
#set_package_properties(LCMS2 PROPERTIES TYPE REQUIRED PURPOSE "Required for ICC color correction.")
|
||||
#
|
||||
#kwin4_add_effect(icc icc.cpp)
|
||||
#target_link_libraries(kwin4_effect_icc PUBLIC ${LCMS2_LIBRARIES})
|
||||
#target_include_directories(kwin4_effect_icc PUBLIC ${LCMS2_INCLUDE_DIRS})
|
||||
#target_compile_options(kwin4_effect_icc PUBLIC ${LCMS2_CFLAGS_OTHER})
|
||||
|
||||
target_link_libraries(kwin_icc_config
|
||||
KF5::ConfigWidgets
|
||||
KF5::I18n
|
||||
KF5::Service
|
||||
KF5::XmlGui
|
||||
)
|
||||
|
||||
kcoreaddons_desktop_to_json(kwin_icc_config icc_config.desktop SERVICE_TYPES kcmodule.desktop)
|
||||
|
||||
install(
|
||||
TARGETS
|
||||
kwin_icc_config
|
||||
DESTINATION
|
||||
${PLUGIN_INSTALL_DIR}/kwin/effects/configs
|
||||
)
|
|
@ -0,0 +1,26 @@
|
|||
uniform sampler2D sampler;
|
||||
|
||||
varying vec2 texcoord0;
|
||||
|
||||
uniform sampler3D clut;
|
||||
|
||||
uniform vec4 modulation;
|
||||
|
||||
uniform float saturation;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 tex = texture2D(sampler, texcoord0);
|
||||
|
||||
if (saturation != 1.0) {
|
||||
vec3 desaturated = tex.rgb * vec3( 0.30, 0.59, 0.11 );
|
||||
desaturated = vec3( dot( desaturated, tex.rgb ));
|
||||
tex.rgb = tex.rgb * vec3( saturation ) + desaturated * vec3( 1.0 - saturation );
|
||||
}
|
||||
|
||||
tex.rgb = texture3D(clut, tex.rgb).rgb;
|
||||
tex *= modulation;
|
||||
tex.rgb *= tex.a;
|
||||
|
||||
gl_FragColor = tex;
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
#version 140
|
||||
uniform sampler2D sampler;
|
||||
|
||||
in vec2 texcoord0;
|
||||
|
||||
uniform sampler3D clut;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
uniform vec4 modulation;
|
||||
|
||||
uniform float saturation;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 tex = texture(sampler, texcoord0);
|
||||
|
||||
if (saturation != 1.0) {
|
||||
vec3 desaturated = tex.rgb * vec3( 0.30, 0.59, 0.11 );
|
||||
desaturated = vec3( dot( desaturated, tex.rgb ));
|
||||
tex.rgb = tex.rgb * vec3( saturation ) + desaturated * vec3( 1.0 - saturation );
|
||||
}
|
||||
|
||||
tex.rgb = texture(clut, tex.rgb).rgb;
|
||||
tex *= modulation;
|
||||
tex.rgb *= tex.a;
|
||||
|
||||
fragColor = tex;
|
||||
}
|
|
@ -0,0 +1,242 @@
|
|||
/********************************************************************
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
Copyright (C) 2019 Vitaliy Filippov <vitalif@yourcmc.ru>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************/
|
||||
|
||||
#include "icc.h"
|
||||
#include "iccconfig.h"
|
||||
#include "kwinglplatform.h"
|
||||
|
||||
#include "lcms2.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QFile>
|
||||
#include <KGlobalAccel>
|
||||
#include <KLocalizedString>
|
||||
#include <QStandardPaths>
|
||||
|
||||
static const int LUT_POINTS = 64;
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
ICCEffect::ICCEffect()
|
||||
: m_valid(false),
|
||||
m_shader(NULL),
|
||||
m_texture(0),
|
||||
m_clut(NULL)
|
||||
{
|
||||
initConfig<ICCConfig>();
|
||||
reconfigure(ReconfigureAll);
|
||||
}
|
||||
|
||||
ICCEffect::~ICCEffect()
|
||||
{
|
||||
if (m_shader)
|
||||
delete m_shader;
|
||||
if (m_clut)
|
||||
delete[] m_clut;
|
||||
if (m_texture != 0)
|
||||
glDeleteTextures(1, &m_texture);
|
||||
}
|
||||
|
||||
bool ICCEffect::supported()
|
||||
{
|
||||
return effects->compositingType() == OpenGL2Compositing;
|
||||
}
|
||||
|
||||
void ICCEffect::reconfigure(ReconfigureFlags flags)
|
||||
{
|
||||
Q_UNUSED(flags)
|
||||
|
||||
ICCConfig::self()->read();
|
||||
|
||||
m_sourceICC = ICCConfig::self()->sourceICC().trimmed();
|
||||
m_targetICC = ICCConfig::self()->targetICC().trimmed();
|
||||
|
||||
loadData();
|
||||
|
||||
effects->addRepaintFull();
|
||||
}
|
||||
|
||||
bool ICCEffect::loadData()
|
||||
{
|
||||
m_valid = false;
|
||||
|
||||
if (m_shader)
|
||||
delete m_shader;
|
||||
if (m_clut)
|
||||
delete[] m_clut;
|
||||
if (m_texture != 0)
|
||||
glDeleteTextures(1, &m_texture);
|
||||
|
||||
m_shader = ShaderManager::instance()->generateShaderFromResources(ShaderTrait::MapTexture, QString(), QStringLiteral("icc.frag"));
|
||||
if (!m_shader->isValid())
|
||||
{
|
||||
qCCritical(KWINEFFECTS) << "The shader failed to load!";
|
||||
return false;
|
||||
}
|
||||
ShaderManager::instance()->pushShader(m_shader);
|
||||
m_shader->setUniform("clut", 3); // GL_TEXTURE3
|
||||
ShaderManager::instance()->popShader();
|
||||
|
||||
m_clut = makeCLUT(m_sourceICC.trimmed().isEmpty() ? NULL : m_sourceICC.toLocal8Bit().data(), m_targetICC.toLocal8Bit().data());
|
||||
|
||||
if (m_clut)
|
||||
{
|
||||
m_texture = setupCCTexture(m_clut);
|
||||
|
||||
if (m_texture)
|
||||
{
|
||||
m_valid = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t *ICCEffect::makeCLUT(const char* source_icc, const char* target_icc)
|
||||
{
|
||||
uint8_t *clut = NULL, *clut_source = NULL;
|
||||
cmsHPROFILE source, target;
|
||||
cmsHTRANSFORM transform;
|
||||
source = source_icc ? cmsOpenProfileFromFile(source_icc, "r") : cmsCreate_sRGBProfile();
|
||||
if (!source)
|
||||
goto free_nothing;
|
||||
target = cmsOpenProfileFromFile(target_icc, "r");
|
||||
if (!target)
|
||||
goto free_source;
|
||||
transform = cmsCreateTransform(
|
||||
source, TYPE_RGB_8, target, TYPE_RGB_8,
|
||||
INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_BLACKPOINTCOMPENSATION
|
||||
);
|
||||
if (!transform)
|
||||
goto free_target;
|
||||
clut_source = new uint8_t[LUT_POINTS*LUT_POINTS*LUT_POINTS*3];
|
||||
if (!clut_source)
|
||||
goto free_transform;
|
||||
for (int b = 0, addr = 0; b < LUT_POINTS; b++)
|
||||
{
|
||||
for (int g = 0; g < LUT_POINTS; g++)
|
||||
{
|
||||
for (int r = 0; r < LUT_POINTS; r++, addr += 3)
|
||||
{
|
||||
clut_source[addr] = 255*r/(LUT_POINTS-1);
|
||||
clut_source[addr+1] = 255*g/(LUT_POINTS-1);
|
||||
clut_source[addr+2] = 255*b/(LUT_POINTS-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
clut = new uint8_t[LUT_POINTS*LUT_POINTS*LUT_POINTS*3];
|
||||
if (!clut)
|
||||
goto free_clut_source;
|
||||
cmsDoTransform(transform, clut_source, clut, LUT_POINTS*LUT_POINTS*LUT_POINTS);
|
||||
/*for (int b = 0, addr = 0; b < LUT_POINTS; b++)
|
||||
{
|
||||
for (int g = 0; g < LUT_POINTS; g++)
|
||||
{
|
||||
for (int r = 0; r < LUT_POINTS; r++, addr += 3)
|
||||
{
|
||||
printf("cLUT %02x%02x%02x -> %02x%02x%02x\n", 255*r/(LUT_POINTS-1), 255*g/(LUT_POINTS-1), 255*b/(LUT_POINTS-1), clut[addr], clut[addr+1], clut[addr+2]);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
free_clut_source:
|
||||
delete[] clut_source;
|
||||
free_transform:
|
||||
cmsDeleteTransform(transform);
|
||||
free_target:
|
||||
cmsCloseProfile(target);
|
||||
free_source:
|
||||
cmsCloseProfile(source);
|
||||
free_nothing:
|
||||
return clut;
|
||||
}
|
||||
|
||||
GLuint ICCEffect::setupCCTexture(uint8_t *clut)
|
||||
{
|
||||
GLenum err = glGetError();
|
||||
GLuint texture;
|
||||
|
||||
glGenTextures(1, &texture);
|
||||
|
||||
glBindTexture(GL_TEXTURE_3D, texture);
|
||||
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
|
||||
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB8,
|
||||
LUT_POINTS, LUT_POINTS, LUT_POINTS,
|
||||
0, GL_RGB, GL_UNSIGNED_BYTE, clut);
|
||||
|
||||
if ((err = glGetError()) != GL_NO_ERROR)
|
||||
{
|
||||
glDeleteTextures(1, &texture);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return texture;
|
||||
}
|
||||
|
||||
void ICCEffect::drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
|
||||
{
|
||||
if (m_valid)
|
||||
{
|
||||
glActiveTexture(GL_TEXTURE3);
|
||||
glBindTexture(GL_TEXTURE_3D, m_texture);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
ShaderManager *shaderManager = ShaderManager::instance();
|
||||
shaderManager->pushShader(m_shader);
|
||||
data.shader = m_shader;
|
||||
}
|
||||
|
||||
effects->drawWindow(w, mask, region, data);
|
||||
|
||||
if (m_valid)
|
||||
{
|
||||
ShaderManager::instance()->popShader();
|
||||
}
|
||||
}
|
||||
|
||||
void ICCEffect::paintEffectFrame(KWin::EffectFrame* frame, QRegion region, double opacity, double frameOpacity)
|
||||
{
|
||||
if (m_valid)
|
||||
{
|
||||
glActiveTexture(GL_TEXTURE3);
|
||||
glBindTexture(GL_TEXTURE_3D, m_texture);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
frame->setShader(m_shader);
|
||||
ShaderBinder binder(m_shader);
|
||||
effects->paintEffectFrame(frame, region, opacity, frameOpacity);
|
||||
}
|
||||
else
|
||||
{
|
||||
effects->paintEffectFrame(frame, region, opacity, frameOpacity);
|
||||
}
|
||||
}
|
||||
|
||||
bool ICCEffect::isActive() const
|
||||
{
|
||||
return m_valid;
|
||||
}
|
||||
|
||||
} // namespace
|
|
@ -0,0 +1,78 @@
|
|||
/********************************************************************
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
Copyright (C) 2019 Vitaliy Filippov <vitalif@yourcmc.ru>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************/
|
||||
|
||||
#ifndef KWIN_ICC_H
|
||||
#define KWIN_ICC_H
|
||||
|
||||
#include <kwineffects.h>
|
||||
#include "kwinglutils.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
class GLShader;
|
||||
|
||||
/**
|
||||
* Applies cLUT (32x32x32 RGB LUT)-based color correction to the whole desktop
|
||||
* cLUT is generated from a pair of ICC profiles using LCMS2
|
||||
*/
|
||||
class ICCEffect
|
||||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ICCEffect();
|
||||
~ICCEffect();
|
||||
|
||||
virtual void reconfigure(ReconfigureFlags flags);
|
||||
virtual void drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
virtual void paintEffectFrame(KWin::EffectFrame* frame, QRegion region, double opacity, double frameOpacity) override;
|
||||
virtual bool isActive() const;
|
||||
|
||||
int requestedEffectChainPosition() const override;
|
||||
|
||||
static bool supported();
|
||||
|
||||
public Q_SLOTS:
|
||||
|
||||
protected:
|
||||
bool loadData();
|
||||
|
||||
private:
|
||||
bool m_inited;
|
||||
bool m_valid;
|
||||
QString m_sourceICC;
|
||||
QString m_targetICC;
|
||||
GLShader* m_shader;
|
||||
GLuint m_texture;
|
||||
uint8_t *m_clut;
|
||||
|
||||
uint8_t *makeCLUT(const char* source_icc, const char* target_icc);
|
||||
GLuint setupCCTexture(uint8_t *clut);
|
||||
};
|
||||
|
||||
inline int ICCEffect::requestedEffectChainPosition() const
|
||||
{
|
||||
return 98;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
|
||||
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
|
||||
<kcfgfile arg="true"/>
|
||||
<group name="Effect-ICC">
|
||||
<entry name="SourceICC" type="String">
|
||||
<default></default>
|
||||
</entry>
|
||||
<entry name="TargetICC" type="String">
|
||||
<default></default>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
|
@ -0,0 +1,82 @@
|
|||
/********************************************************************
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
Copyright (C) 2019 Vitaliy Filippov <vitalif@yourcmc.ru>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************/
|
||||
|
||||
#include "icc_config.h"
|
||||
#include <kwineffects_interface.h>
|
||||
#include "iccconfig.h"
|
||||
#include <config-kwin.h>
|
||||
|
||||
#include <QAction>
|
||||
|
||||
#include <KLocalizedString>
|
||||
#include <KActionCollection>
|
||||
#include <KAboutData>
|
||||
#include <KPluginFactory>
|
||||
|
||||
#include <QVBoxLayout>
|
||||
|
||||
K_PLUGIN_FACTORY_WITH_JSON(ICCEffectConfigFactory,
|
||||
"icc_config.json",
|
||||
registerPlugin<KWin::ICCEffectConfig>();)
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
ICCEffectConfig::ICCEffectConfig(QWidget* parent, const QVariantList& args) :
|
||||
KCModule(KAboutData::pluginData(QStringLiteral("icc")), parent, args)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
ICCConfig::instance(KWIN_CONFIG);
|
||||
addConfig(ICCConfig::self(), this);
|
||||
load();
|
||||
}
|
||||
|
||||
ICCEffectConfig::~ICCEffectConfig()
|
||||
{
|
||||
// Undo unsaved changes
|
||||
}
|
||||
|
||||
void ICCEffectConfig::load()
|
||||
{
|
||||
KCModule::load();
|
||||
|
||||
emit changed(false);
|
||||
}
|
||||
|
||||
void ICCEffectConfig::save()
|
||||
{
|
||||
KCModule::save();
|
||||
|
||||
emit changed(false);
|
||||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
interface.reconfigureEffect(QStringLiteral("icc"));
|
||||
}
|
||||
|
||||
void ICCEffectConfig::defaults()
|
||||
{
|
||||
emit changed(true);
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
#include "icc_config.moc"
|
|
@ -0,0 +1,9 @@
|
|||
[Desktop Entry]
|
||||
Type=Service
|
||||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kwin_icc_config
|
||||
X-KDE-ParentComponents=icc
|
||||
|
||||
Name=ICC color correction
|
||||
Name[ru]=ICC цветокоррекция
|
|
@ -0,0 +1,48 @@
|
|||
/********************************************************************
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
Copyright (C) 2019 Vitaliy Filippov <vitalif@yourcmc.ru>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************/
|
||||
|
||||
#ifndef KWIN_ICC_CONFIG_H
|
||||
#define KWIN_ICC_CONFIG_H
|
||||
|
||||
#include <kcmodule.h>
|
||||
#include "ui_icc_config.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
class ICCEffectConfig : public KCModule
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ICCEffectConfig(QWidget* parent = 0, const QVariantList& args = QVariantList());
|
||||
~ICCEffectConfig();
|
||||
|
||||
public Q_SLOTS:
|
||||
virtual void save();
|
||||
virtual void load();
|
||||
virtual void defaults();
|
||||
|
||||
private:
|
||||
::Ui::ICCEffectConfig ui;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif
|
|
@ -0,0 +1,59 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ICCEffectConfig</class>
|
||||
<widget class="QWidget" name="ICCEffectConfig">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>642</width>
|
||||
<height>107</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="iccForm">
|
||||
<property name="labelAlignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="sourceICCProfileLabel">
|
||||
<property name="text">
|
||||
<string>Source ICC profile file:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="kcfg_SourceICC">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>leave empty to use sRGB (default color space)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="targetICCProfileLabel">
|
||||
<property name="text">
|
||||
<string>Target ICC profile file:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="kcfg_TargetICC">
|
||||
<property name="placeholderText">
|
||||
<string>select your display's ICC profile here</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -0,0 +1,5 @@
|
|||
File=icc.kcfg
|
||||
ClassName=ICCConfig
|
||||
NameSpace=KWin
|
||||
Singleton=true
|
||||
Mutators=true
|
|
@ -6,6 +6,7 @@
|
|||
<file alias="cylinder.vert">cube/data/1.10/cylinder.vert</file>
|
||||
<file alias="sphere.vert">cube/data/1.10/sphere.vert</file>
|
||||
<file alias="invert.frag">invert/data/1.10/invert.frag</file>
|
||||
<file alias="icc.frag">icc/data/1.10/icc.frag</file>
|
||||
<file alias="lookingglass.frag">lookingglass/data/1.10/lookingglass.frag</file>
|
||||
<file alias="blinking-startup-fragment.glsl">startupfeedback/data/1.10/blinking-startup-fragment.glsl</file>
|
||||
</qresource>
|
||||
|
@ -16,6 +17,7 @@
|
|||
<file alias="cylinder.vert">cube/data/1.40/cylinder.vert</file>
|
||||
<file alias="sphere.vert">cube/data/1.40/sphere.vert</file>
|
||||
<file alias="invert.frag">invert/data/1.40/invert.frag</file>
|
||||
<file alias="icc.frag">icc/data/1.40/icc.frag</file>
|
||||
<file alias="lookingglass.frag">lookingglass/data/1.40/lookingglass.frag</file>
|
||||
<file alias="blinking-startup-fragment.glsl">startupfeedback/data/1.40/blinking-startup-fragment.glsl</file>
|
||||
</qresource>
|
||||
|
|
|
@ -95,7 +95,7 @@ Comment[x-test]=xxConfigure compositor settings for desktop effectsxx
|
|||
Comment[zh_CN]=配置桌面特效混成器设置
|
||||
Comment[zh_TW]=設定桌面特效的合成器設定
|
||||
|
||||
X-KDE-Keywords=kwin,window,manager,effect,3D effects,2D effects,graphical effects,desktop effects,animations,various animations,window management effects,window switching effect,desktop switching effect,animations,desktop animations,drivers,driver settings,rendering,render,invert effect,looking glass effect,magnifier effect,snap helper effect,track mouse effect,zoom effect,blur effect,fade effect,fade desktop effect,fall apart effect,glide effect,highlight window effect,login effect,logout effect,magic lamp effect,minimize animation effect,mouse mark effect,scale effect,screenshot effect,sheet effect,slide effect,sliding popups effect,thumbnail aside effect,translucency,translucency effect,transparency,window geometry effect,wobbly windows effect,startup feedback effect,dialog parent effect,dim inactive effect,dim screen effect,slide back effect,eye candy,candy,show FPS effect,show paint effect,cover switch effect,desktop cube effect,desktop cube animation effect,desktop grid effect,flip switch effect,present windows effect,resize window effect,background contrast effect
|
||||
X-KDE-Keywords=kwin,window,manager,effect,3D effects,2D effects,graphical effects,desktop effects,animations,various animations,window management effects,window switching effect,desktop switching effect,animations,desktop animations,drivers,driver settings,rendering,render,icc effect,invert effect,looking glass effect,magnifier effect,snap helper effect,track mouse effect,zoom effect,blur effect,fade effect,fade desktop effect,fall apart effect,glide effect,highlight window effect,login effect,logout effect,magic lamp effect,minimize animation effect,mouse mark effect,scale effect,screenshot effect,sheet effect,slide effect,sliding popups effect,thumbnail aside effect,translucency,translucency effect,transparency,window geometry effect,wobbly windows effect,startup feedback effect,dialog parent effect,dim inactive effect,dim screen effect,slide back effect,eye candy,candy,show FPS effect,show paint effect,cover switch effect,desktop cube effect,desktop cube animation effect,desktop grid effect,flip switch effect,present windows effect,resize window effect,background contrast effect
|
||||
X-KDE-Keywords[az]=kwin, pəncərə,menecer,effekt,3D effektlər,2D effektlər,qrafik effektlər,iş masası effektləri,animasiyalar,dəyişkən animasiyalar,pəncərə effektləri idarəsi,pəncərə dəyişdirmə effektləri,iş masası dəyişdirmə effektləri,animasiyalar,iş masası animasiyaları,sürücülər,sürücü ayarları,təsvirin işlənməsi,əks effektlər,linza effekti,lupa effekti,qopma effekti,siçanı izləmə effekti,miqyaslama effekti,yayğınlaşma effekti,solma effekti,iş masasının solması effekti,səpələnmə effekti,süzülmə effekti,vurğulama effekti,pəncərə işıqlandırma effekti,giriş effekti,çıxış effekti,sehirli lampa,animasiyalı yığılma,siçanı işarələmək,tor,ekran şəkli,vərəq,sürüşdürmə,sürüşən pəncərələr,yan miniatürləri,şəffaflıq,pəncərə həndəsəsi,titrək pəncərə,dialoq pəncərəsi,tutqunlaşma,pəncərə tutqunlaşması,ekran tutqunlaşması,geriyə sürüşmə,saniyədə kadrlar,ekranda şəkil çəkmə,örtmə,iş masası kubu animasiyası,kitab vərəqləri,pəncərə təqdimatı,pəncərə ölçüsünün dəyişdirilməsi,arxa fon kontrastı
|
||||
X-KDE-Keywords[ca]=kwin,finestra,gestor,efecte,efectes 3D,efectes 2D,efectes gràfics,efectes d'escriptori,animacions,animacions diverses,efectes en la gestió de les finestres,efecte en el canvi de finestra,efecte en el canvi d'escriptori,animacions,animacions a l'escriptori,controladors,configuració dels controladors,renderització,render,efecte d'inversió,efecte d'aspecte de vidre,efecte de lupa,efecte ajudant del desplaçament,efecte de seguiment del ratolí,efecte de zoom,efecte de difuminat,efecte d'esvaïment,efecte d'esvaïment de l'escriptori,efecte de trencament,efecte de lliscament,efecte de ressaltat de la finestra,efecte en l'inici de la sessió,efecte en sortir de la sessió,efecte de làmpada màgica,efecte d'animació de la minimització,efecte de marca del ratolí,efecte d'apropament,efecte de captura de la pantalla,efecte de full,efecte de diapositiva,efecte de missatges emergents lliscants,efecte de miniatures laterals,translucidesa,efecte de translucidesa,transparència,efecte de geometria de la finestra,efecte de finestres sacsejades,efecte de confirmació d'engegada,efecte de diàleg principal,efecte d'enfosquiment en estar inactiu,efecte d'enfosquiment de la pantalla,efecte de diapositiva prèvia,decoració,efecte per a mostrar els FPS,efecte de mostrar el pintat,efecte de canvi de coberta,efecte de cub de l'escriptori,efecte d'animació del cub de l'escriptori,efecte de quadrícula de l'escriptori,efecte de canvi en roda,efecte de presentació de les finestres,efecte de redimensionat de la finestra,efecte de contrast del fons
|
||||
X-KDE-Keywords[ca@valencia]=kwin,finestra,gestor,efecte,efectes 3D,efectes 2D,efectes gràfics,efectes d'escriptori,animacions,animacions diverses,efectes en la gestió de les finestres,efecte en el canvi de finestra,efecte en el canvi d'escriptori,animacions,animacions en l'escriptori,controladors,configuració dels controladors,renderització,render,efecte d'inversió,efecte d'aspecte de vidre,efecte de lupa,efecte ajudant del desplaçament,efecte de seguiment del ratolí,efecte de zoom,efecte de difuminat,efecte de fosa,efecte de fosa de l'escriptori,efecte de trencament,efecte de lliscament,efecte de ressaltat de la finestra,efecte en l'inici de la sessió,efecte en eixir de la sessió,efecte de làmpada màgica,efecte d'animació de la minimització,efecte de marca del ratolí,efecte d'apropament,efecte de captura de pantalla,efecte de full,efecte de diapositiva,efecte de missatges emergents lliscants,efecte de miniatures laterals,translucidesa,efecte de translucidesa,transparència,efecte de geometria de la finestra,efecte de finestres sacsejades,efecte de retroacció d'inici,efecte de diàleg principal,efecte d'enfosquiment en estar inactiu,efecte d'enfosquiment de la pantalla,efecte de diapositiva prèvia,decoració,efecte per a mostrar els FPS,efecte per a mostrar les zones pintades,efecte de canvi de coberta,efecte de cub de l'escriptori,efecte d'animació del cub de l'escriptori,efecte de graella de l'escriptori,efecte de canvi en roda,efecte de presentació de les finestres,efecte de redimensionat de la finestra,efecte de contrast del fons
|
||||
|
|
Loading…
Reference in New Issue