kis_ks3_colorspace.h 1.91 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
 *  Copyright (c) 2007 Emanuele Tamponi <emanuele@valinor.it>
 *
 *
 *  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, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
 */
19 20 21 22 23

#ifndef KIS_KS3_COLORSPACE_H_
#define KIS_KS3_COLORSPACE_H_

#include "kis_ks_colorspace_traits.h"
Emanuele Tamponi's avatar
Emanuele Tamponi committed
24
#include "channel_converter.h"
25 26
#include <KoIncompleteColorSpace.h>

Emanuele Tamponi's avatar
Emanuele Tamponi committed
27
#include <gsl/gsl_linalg.h>
28
#include <gsl/gsl_vector.h>
Emanuele Tamponi's avatar
Emanuele Tamponi committed
29

30 31 32 33 34 35 36 37 38 39 40 41 42 43
class KisIlluminantProfile;
class KoColorProfile;

class KisKS3ColorSpace : public KoIncompleteColorSpace<KisKS3ColorSpaceTrait>
{
    typedef KoIncompleteColorSpace<KisKS3ColorSpaceTrait> parent;

    public:

        KisKS3ColorSpace(KoColorProfile *p);
        ~KisKS3ColorSpace();

    public:

Emanuele Tamponi's avatar
Emanuele Tamponi committed
44 45
        bool operator==(const KoColorSpace& rhs) const;

46 47 48 49 50 51 52 53 54 55
        KoColorProfile *profile();
        const KoColorProfile *profile() const;
        bool profileIsCompatible(const KoColorProfile *profile) const;

        void fromRgbA16(const quint8 *srcU8, quint8 *dstU8, quint32 nPixels) const;
        void toRgbA16(const quint8 *srcU8, quint8 *dstU8, quint32 nPixels) const;

    private:

        KisIlluminantProfile *m_profile;
Emanuele Tamponi's avatar
Emanuele Tamponi committed
56
        ChannelConverter m_converter;
57

Emanuele Tamponi's avatar
Emanuele Tamponi committed
58 59
        int m_s;
        gsl_permutation *m_permutation;
60 61
        gsl_vector *m_rgbvec;
        gsl_vector *m_refvec;
Emanuele Tamponi's avatar
Emanuele Tamponi committed
62

63 64 65
};

#endif // KIS_KS3_COLORSPACE_H_