Revision 776008
Go back to digest for 17th February 2008Other in Office
Refactor (again).
Let me explain how conversions to/from KS works.
It's all still a work in progress, we have not only one way of transforming to and from rgb, so I need to be flexible in this regard.
For this reason, the current code works this way:
- KisKSColorSpace has two template parameters:
+ int N, represents the number of wavelengths used
+ TYPE, the channel type
- Subclasses of KisKSColorSpace specify the type and the factory, that has to contain the conversion transformations to/from rgb and the conversions between various types of channels for KS.
- rgbToKS and KSToRgb color conversion transformations use the code in KisIlluminantProfile to do the convertion, integrating the mechanism in the great Pigment CMS (thank you Cyrille!).
- KisIlluminantProfile defines the functions needed to convert to/from KS: fromRgb() and toRgb(). These are just wrapper functions around rgbToReflectance and reflectanceToKS ( used in fromRgb ), and KSToReflectance and reflectanceToRgb (in toRgb ). Subclasses of
KisIlluminantProfile can redefine these functions so that the conversion is perfectly costumizable.
- Some works has still to be completed:
+ conversion cache
+ LC profile (faster than QP)
+ KSToKS color conversion transformation (to convert between half and float)
File Changes
- /trunk/koffice/krita/plugins/painterlyframework
- /kis_illuminant_profile_qp.cpp
- /kis_illuminant_profile_qp.h
- /kis_ksf16_colorspace.h
- /kis_ksf32_colorspace.h
- /trunk/koffice/krita/plugins/painterlyframework
- /kis_kslc_colorspace.h
- /kis_ksqp_colorspace.h
- /kis_rgb_to_kslc_color_conversion_transformation.h
- /kis_rgb_to_ksqp_color_conversion_transformation.h
- /trunk/koffice/krita/plugins/painterlyframework
- /channel_converter.h
- /CMakeLists.txt
- /kis_illuminant_profile.cpp
- /kis_illuminant_profile.h
- /kis_ks_colorspace.h
- /kis_ks_colorspace_traits.h
- /kis_ks_to_rgb_color_conversion_transformation.h
- /kis_rgb_to_ks_color_conversion_transformation.h
- /ks_colorspaces.cpp
- /tests/CMakeLists.txt
- /tests/kis_illuminant_profile_test.cpp
- /tests/kis_illuminant_profile_test.h
- /tests/kis_ks_colorspace_test.cpp
- /tests/mixing_test.cpp