ICF 3.0.5.47
Technical documentation of ICF Libraries
CCmy.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#pragma once
7
8
9#include <iser/IArchive.h>
10
11#include <icmm/TComposedColor.h>
12
13
14namespace icmm
15{
16
17
22class CCmy: public TComposedColor<3>
23{
24public:
26
34
35 CCmy(double c = 0.0, double m = 0.0, double y = 0.0);
36 CCmy(const CCmy& color);
37
38 // access to component values
39 double GetC() const;
40 void SetC(double value);
41 double GetM() const;
42 void SetM(double value);
43 double GetY() const;
44 void SetY(double value);
45
46 bool Serialize(iser::IArchive& archive);
47
48 // operators
49 CCmy operator+(const CCmy& color) const;
50 CCmy operator-(const CCmy& color) const;
51 CCmy operator*(const CCmy& color) const;
52 CCmy operator/(const CCmy& color) const;
53
54 CCmy operator*(double value) const;
55 CCmy operator/(double value) const;
56
57 CCmy& operator=(const CCmy& color);
58
59 const CCmy& operator+=(const CCmy& color);
60 const CCmy& operator-=(const CCmy& color);
61 const CCmy& operator*=(const CCmy& color);
62 const CCmy& operator/=(const CCmy& color);
63
64 const CCmy& operator*=(double value);
65 const CCmy& operator/=(double value);
66};
67
68
69// inline methods
70
71inline CCmy::CCmy(double c, double m, double y)
72{
76}
77
78
79inline CCmy::CCmy(const CCmy& color)
80: BaseClass(color)
81{
82}
83
84
85// access to components
86
87inline double CCmy::GetC() const
88{
89 return GetElement(CI_CYAN);
90}
91
92
93inline void CCmy::SetC(double value)
94{
95 SetElement(CI_CYAN, value);
96}
97
98
99inline double CCmy::GetM() const
100{
101 return GetElement(CI_MAGENTA);
102}
103
104
105inline void CCmy::SetM(double value)
106{
107 SetElement(CI_MAGENTA, value);
108}
109
110
111inline double CCmy::GetY() const
112{
113 return GetElement(CI_YELLOW);
114}
115
116
117inline void CCmy::SetY(double value)
118{
119 SetElement(CI_YELLOW, value);
120}
121
122
123// operators
124
125inline CCmy& CCmy::operator=(const CCmy& color)
126{
128
129 return *this;
130}
131
132
133inline const CCmy& CCmy::operator+=(const CCmy& color)
134{
136
137 return *this;
138}
139
140
141inline const CCmy& CCmy::operator-=(const CCmy& color)
142{
144
145 return *this;
146}
147
148
149inline const CCmy& CCmy::operator*=(const CCmy& color)
150{
152
153 return *this;
154}
155
156
157inline const CCmy& CCmy::operator/=(const CCmy& color)
158{
160
161 return *this;
162}
163
164
165inline const CCmy& CCmy::operator*=(double value)
166{
168
169 return *this;
170}
171
172
173inline const CCmy& CCmy::operator/=(double value)
174{
176
177 return *this;
178}
179
180
181} // namespace icmm
182
183
Primitive for representation of CMY color value.
Definition CCmy.h:23
CCmy operator/(double value) const
void SetC(double value)
Definition CCmy.h:93
CCmy operator*(double value) const
const CCmy & operator/=(const CCmy &color)
Definition CCmy.h:157
void SetM(double value)
Definition CCmy.h:105
CCmy & operator=(const CCmy &color)
Definition CCmy.h:125
double GetC() const
Definition CCmy.h:87
const CCmy & operator*=(const CCmy &color)
Definition CCmy.h:149
double GetY() const
Definition CCmy.h:111
TComposedColor< 3 > BaseClass
Definition CCmy.h:25
bool Serialize(iser::IArchive &archive)
Load or store state of this object as a archive stream.
CCmy operator+(const CCmy &color) const
const CCmy & operator-=(const CCmy &color)
Definition CCmy.h:141
ComponentIndex
Definition CCmy.h:28
@ CI_LAST
Definition CCmy.h:32
@ CI_MAGENTA
Definition CCmy.h:30
@ CI_CYAN
Definition CCmy.h:29
@ CI_YELLOW
Definition CCmy.h:31
CCmy operator-(const CCmy &color) const
CCmy operator*(const CCmy &color) const
const CCmy & operator+=(const CCmy &color)
Definition CCmy.h:133
double GetM() const
Definition CCmy.h:99
CCmy operator/(const CCmy &color) const
CCmy(double c=0.0, double m=0.0, double y=0.0)
Definition CCmy.h:71
void SetY(double value)
Definition CCmy.h:117
Generic color implementation.
const TComposedColor< Size > & operator=(const TComposedColor< Size > &color)
const TComposedColor< Size > & operator+=(const TComposedColor< Size > &color)
const TComposedColor< Size > & operator-=(const TComposedColor< Size > &color)
const TComposedColor< Size > & operator*=(const TComposedColor< Size > &color)
const TComposedColor< Size > & operator/=(const TComposedColor< Size > &color)
void SetElement(int i, const Element &value)
Set element at specified i.
Definition TVector.h:266
const Element & GetElement(int i) const
Get element at specified i.
Definition TVector.h:252
Represent input/output persistence archive.
Definition IArchive.h:33
Contains color management classes.
Definition CCmy.h:15

© Witold Gantzke and Kirill Lepskiy