digiKam
dcolorcomposer.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2006-03-02
7  * Description : DColor methods for composing
8  *
9  * Copyright (C) 2006-2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_DCOLOR_COMPOSER_H
25 #define DIGIKAM_DCOLOR_COMPOSER_H
26 
27 // Local includes
28 
29 #include "dcolor.h"
30 #include "digikam_export.h"
31 
32 namespace Digikam
33 {
34 
35 class DIGIKAM_EXPORT DColorComposer
36 {
37 public:
38 
71  {
83  PorterDuffXor
84  };
85 
87  {
88  NoMultiplication = 0x00,
89  PremultiplySrc = 0x01,
90  PremultiplyDst = 0x02,
91  DemultiplyDst = 0x04,
92 
93  MultiplicationFlagsDImg = PremultiplySrc | PremultiplyDst | DemultiplyDst,
94  MultiplicationFlagsPremultipliedColorOnDImg = PremultiplyDst | DemultiplyDst
95  };
96 
101  static DColorComposer* getComposer(CompositingOperation rule);
102 
116  virtual void compose(DColor& dest, DColor& src) = 0;
117 
127  virtual void compose(DColor& dest, DColor& src, MultiplicationFlags multiplicationFlags);
128 
129  DColorComposer() = default;
130  virtual ~DColorComposer() = default;
131 
132 private:
133 
134  Q_DISABLE_COPY(DColorComposer)
135 };
136 
137 } // namespace Digikam
138 
139 #endif // DIGIKAM_DCOLOR_COMPOSER_H
Definition: dcolorcomposer.h:36
CompositingOperation
Definition: dcolorcomposer.h:71
@ PorterDuffNone
Definition: dcolorcomposer.h:72
@ PorterDuffDstIn
Definition: dcolorcomposer.h:78
@ PorterDuffSrcOut
Definition: dcolorcomposer.h:79
@ PorterDuffSrcAtop
Definition: dcolorcomposer.h:81
@ PorterDuffDstOut
Definition: dcolorcomposer.h:80
@ PorterDuffSrc
Definition: dcolorcomposer.h:74
@ PorterDuffSrcIn
Definition: dcolorcomposer.h:77
@ PorterDuffDstOver
Definition: dcolorcomposer.h:76
@ PorterDuffSrcOver
Definition: dcolorcomposer.h:75
@ PorterDuffDstAtop
Definition: dcolorcomposer.h:82
@ PorterDuffClear
Definition: dcolorcomposer.h:73
virtual ~DColorComposer()=default
virtual void compose(DColor &dest, DColor &src)=0
MultiplicationFlags
Definition: dcolorcomposer.h:87
Definition: dcolor.h:43
Definition: datefolderview.cpp:43