D21076: ICC Color Correction Effect
Anthony Fieroni <[email protected]>
| Newsgroups | gmane.comp.kde.devel.kwin |
|---|---|
| Message-ID | <[email protected]> |
anthonyfieroni added inline comments.
INLINE COMMENTS
> CMakeLists.txt:13-21
> +## 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})
Strip out commented code.
> icc.cpp:113-118
> + 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;
Don't use goto and custom allocations, use QScopedPointer on pointer type (also notice custom deleters https://doc.qt.io/qt-5/qscopedpointer.html#custom-cleanup-handlers), vector on arrays.
> icc.h:44-47
> + 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;
Use override not virtual.
> icc_config.h:38-40
> + virtual void save();
> + virtual void load();
> + virtual void defaults();
override.
REPOSITORY
R108 KWin
REVISION DETAIL
https://phabricator.kde.org/D21076
To: vitaliyf
Cc: anthonyfieroni, zzag, ngraham, kwin, jraleigh, GB_2, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, alexeymin, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart