Commit 95576a2a authored by Emanuele Tamponi's avatar Emanuele Tamponi

Fix a compile problem.

svn path=/trunk/koffice/; revision=752184
parent c8af5bb7
......@@ -6,6 +6,7 @@
set(kritapainterlycommon_PART_SRCS
kis_illuminant_profile.cpp
kis_ks3_colorspace.cpp
ks_reflectance_converter.cpp
# kis_rgbks_colorspace.cpp
# mathematics.cpp
)
......
......@@ -47,8 +47,8 @@ class KisIlluminantProfile : public KoColorProfile {
gsl_matrix_float *T() const { return m_T; }
gsl_vector_float *P() const { return m_P; }
int wavelenghts() const { return m_P->size; }
double Swhite() { return S_w; }
double Kblack() { return K_b; }
double Swhite() const { return S_w; }
double Kblack() const { return K_b; }
private:
gsl_matrix_float *m_T;
......
......@@ -19,6 +19,7 @@
#include "kis_ks3_colorspace.h"
#include "ks_reflectance_converter.h"
#include "kis_illuminant_profile.h"
#include <KoColorProfile.h>
......@@ -71,6 +72,8 @@ void KisKS3ColorSpace::fromRgbA16(const quint8 *srcU8, quint8 *dstU8, quint32 nP
// 1 - convert raw bytes to quint16
// 2 - find reflectances using the T matrix of the profile
// 3 - convert reflectances to K/S
}
void KisKS3ColorSpace::toRgbA16(const quint8 *srcU8, quint8 *dstU8, quint32 nPixels) const
......
......@@ -21,6 +21,7 @@
#define KIS_KS3_COLORSPACE_H_
#include "kis_ks_colorspace_traits.h"
#include "ks_reflectance_converter.h"
#include <KoIncompleteColorSpace.h>
class KisIlluminantProfile;
......
......@@ -16,3 +16,37 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <cmath>
#include "ks_reflectance_converter.h"
KSReflectanceConverter::KSReflectanceConverter(float whiteS, float blackK)
: S_w(whiteS), K_b(blackK)
{
}
KSReflectanceConverter::~KSReflectanceConverter()
{
}
void KSReflectanceConverter::KStoReflectance(float K, float S, float &R) const
{
if (S == 0.0) {
R = 0.0;
return;
}
if (K == 0.0) {
R = 1.0;
return;
}
float Q = K/S;
R = 1.0 + Q - sqrt( Q*Q + 2.0*Q );
}
void KSReflectanceConverter::ReflectancetoKS(float R, float &K, float &S) const
{
}
......@@ -23,11 +23,12 @@
class KSReflectanceConverter {
public:
KSReflectanceConverter() {}
KSReflectanceConverter(float whiteS, float blackK);
~KSReflectanceConverter();
void KStoReflectance(float K, float S, float &R);
void ReflectancetoKS(float R, float &K, float &S);
void KStoReflectance(float K, float S, float &R) const;
void ReflectancetoKS(float R, float &K, float &S) const;
private:
float S_w, K_b;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment