krita

kis_composite_op.h

00001 /*
00002  *  Copyright (c) 2005 Adrian Page <adrian@pagenet.plus.com>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 #ifndef KIS_COMPOSITE_OP_H_
00019 #define KIS_COMPOSITE_OP_H_
00020 
00021 #include <map>
00022 #include <qvaluelist.h>
00023 
00024 //#include "kis_global.h"
00025 #include "kis_id.h"
00026 
00027 enum CompositeOp {
00028     COMPOSITE_OVER,
00029     COMPOSITE_IN,
00030     COMPOSITE_OUT,
00031     COMPOSITE_ATOP,
00032     COMPOSITE_XOR,
00033     COMPOSITE_PLUS,
00034     COMPOSITE_MINUS,
00035     COMPOSITE_ADD,
00036     COMPOSITE_SUBTRACT,
00037     COMPOSITE_DIFF,
00038     COMPOSITE_MULT,
00039     COMPOSITE_DIVIDE,
00040     COMPOSITE_DODGE,
00041     COMPOSITE_BURN,
00042     COMPOSITE_BUMPMAP,
00043     COMPOSITE_COPY,
00044     COMPOSITE_COPY_RED,
00045     COMPOSITE_COPY_GREEN,
00046     COMPOSITE_COPY_BLUE,
00047     COMPOSITE_COPY_OPACITY,
00048     COMPOSITE_CLEAR,
00049     COMPOSITE_DISSOLVE,
00050     COMPOSITE_DISPLACE,
00051 #if 0
00052     COMPOSITE_MODULATE,
00053     COMPOSITE_THRESHOLD,
00054 #endif
00055     COMPOSITE_NO,
00056     COMPOSITE_DARKEN,
00057     COMPOSITE_LIGHTEN,
00058     COMPOSITE_HUE,
00059     COMPOSITE_SATURATION,
00060     COMPOSITE_VALUE,
00061     COMPOSITE_COLOR,
00062     COMPOSITE_COLORIZE,
00063     COMPOSITE_LUMINIZE,
00064     COMPOSITE_SCREEN,
00065     COMPOSITE_OVERLAY,
00066     COMPOSITE_COPY_CYAN,
00067     COMPOSITE_COPY_MAGENTA,
00068     COMPOSITE_COPY_YELLOW,
00069     COMPOSITE_COPY_BLACK,
00070     COMPOSITE_ERASE,
00071     COMPOSITE_ALPHA_DARKEN,
00072     COMPOSITE_UNDEF
00073 };
00074 
00075 class KisCompositeOp {
00076 public:
00077     KisCompositeOp();
00078     KisCompositeOp(const QString& id);
00079     KisCompositeOp(CompositeOp compositeOp);
00080 
00081     KisID id() const { return m_id; }
00082     CompositeOp op() const { return m_op; }
00083 
00084     bool isValid() const { return m_valid; }
00085 
00086     bool operator==(const KisCompositeOp& other) const;
00087     bool operator!=(const KisCompositeOp& other) const;
00088 
00089 private:
00090     void fillMap();
00091 
00092 private:
00093     CompositeOp m_op;
00094     KisID m_id;
00095     bool m_valid;
00096 
00097     typedef std::map<KisID, CompositeOp> KisIDCompositeOpMap;
00098     static KisIDCompositeOpMap s_idOpMap;
00099 };
00100 
00101 typedef QValueList<KisCompositeOp> KisCompositeOpList;
00102 
00103 #endif // KIS_COMPOSITE_OP_H
KDE Home | KDE Accessibility Home | Description of Access Keys