summaryrefslogtreecommitdiffstats
path: root/chalk/chalkcolor/kis_composite_op.h
blob: bd4f10a2a6fc0e3be5c2dcac13f4c35889dea169 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
 *  Copyright (c) 2005 Adrian Page <adrian@pagenet.plus.com>
 *
 *  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.
 */
#ifndef KIS_COMPOSITE_OP_H_
#define KIS_COMPOSITE_OP_H_

#include <map>
#include <tqvaluelist.h>

//#include "kis_global.h"
#include "kis_id.h"

enum CompositeOp {
    COMPOSITE_OVER,
    COMPOSITE_IN,
    COMPOSITE_OUT,
    COMPOSITE_ATOP,
    COMPOSITE_XOR,
    COMPOSITE_PLUS,
    COMPOSITE_MINUS,
    COMPOSITE_ADD,
    COMPOSITE_SUBTRACT,
    COMPOSITE_DIFF,
    COMPOSITE_MULT,
    COMPOSITE_DIVIDE,
    COMPOSITE_DODGE,
    COMPOSITE_BURN,
    COMPOSITE_BUMPMAP,
    COMPOSITE_COPY,
    COMPOSITE_COPY_RED,
    COMPOSITE_COPY_GREEN,
    COMPOSITE_COPY_BLUE,
    COMPOSITE_COPY_OPACITY,
    COMPOSITE_CLEAR,
    COMPOSITE_DISSOLVE,
    COMPOSITE_DISPLACE,
#if 0
    COMPOSITE_MODULATE,
    COMPOSITE_THRESHOLD,
#endif
    COMPOSITE_NO,
    COMPOSITE_DARKEN,
    COMPOSITE_LIGHTEN,
    COMPOSITE_HUE,
    COMPOSITE_SATURATION,
    COMPOSITE_VALUE,
    COMPOSITE_COLOR,
    COMPOSITE_COLORIZE,
    COMPOSITE_LUMINIZE,
    COMPOSITE_SCREEN,
    COMPOSITE_OVERLAY,
    COMPOSITE_COPY_CYAN,
    COMPOSITE_COPY_MAGENTA,
    COMPOSITE_COPY_YELLOW,
    COMPOSITE_COPY_BLACK,
    COMPOSITE_ERASE,
    COMPOSITE_ALPHA_DARKEN,
    COMPOSITE_UNDEF
};

class KisCompositeOp {
public:
    KisCompositeOp();
    KisCompositeOp(const TQString& id);
    KisCompositeOp(CompositeOp compositeOp);

    KisID id() const { return m_id; }
    CompositeOp op() const { return m_op; }

    bool isValid() const { return m_valid; }

    bool operator==(const KisCompositeOp& other) const;
    bool operator!=(const KisCompositeOp& other) const;

private:
    void fillMap();

private:
    CompositeOp m_op;
    KisID m_id;
    bool m_valid;

    typedef std::map<KisID, CompositeOp> KisIDCompositeOpMap;
    static KisIDCompositeOpMap s_idOpMap;
};

typedef TQValueList<KisCompositeOp> KisCompositeOpList;

#endif // KIS_COMPOSITE_OP_H