ColorReference.h Source File documentation

ColorReference.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * This file is part of the libmspub project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10 #ifndef INCLUDED_COLORREFERENCE_H
11 #define INCLUDED_COLORREFERENCE_H
12
13 #include <vector>
14
15 #include "MSPUBTypes.h"
16
17 namespace libmspub
18 {
19 class ColorReference
20 {
21 unsigned m_baseColor;
22 unsigned m_modifiedColor;
23 // static const unsigned char COLOR_PALETTE;
24 static const unsigned char CHANGE_INTENSITY;
25 static const unsigned char BLACK_BASE;
26 static const unsigned char WHITE_BASE;
27 Color getRealColor(unsigned c, const std::vector<Color> &palette) const;
28 public:
29 explicit ColorReference(unsigned color) : m_baseColor(color), m_modifiedColor(color) { }
30 ColorReference(unsigned baseColor, unsigned modifiedColor) : m_baseColor(baseColor), m_modifiedColor(modifiedColor) { }
31 Color getFinalColor(const std::vector<Color> &palette) const;
32 public:
33 friend bool operator==(const libmspub::ColorReference &, const libmspub::ColorReference &);
34 };
35 }
36
37 #endif /* INCLUDED_COLORREFERENCE_H */
38 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libmspub::Color::r
unsigned char r
Definition: MSPUBTypes.h:203
libmspub::ColorReference::ColorReference
ColorReference(unsigned color)
Definition: ColorReference.h:29
libmspub::Color::g
unsigned char g
Definition: MSPUBTypes.h:203
libmspub
Definition: Arrow.h:14
ColorReference.h
MSPUBTypes.h
libmspub::ColorReference::getFinalColor
Color getFinalColor(const std::vector< Color > &palette) const
Definition: ColorReference.cpp:28
libmspub::ColorReference::ColorReference
ColorReference(unsigned baseColor, unsigned modifiedColor)
Definition: ColorReference.h:30
libmspub::ColorReference::getRealColor
Color getRealColor(unsigned c, const std::vector< Color > &palette) const
Definition: ColorReference.cpp:15
libmspub::ColorReference::m_baseColor
unsigned m_baseColor
Definition: ColorReference.h:21
libmspub::operator==
bool operator==(const ColorReference &l, const ColorReference &r)
Definition: ColorReference.cpp:52
libmspub::ColorReference::operator==
friend bool operator==(const libmspub::ColorReference &, const libmspub::ColorReference &)
Definition: ColorReference.cpp:52
libmspub::ColorReference::CHANGE_INTENSITY
static const unsigned char CHANGE_INTENSITY
Definition: ColorReference.h:24
libmspub::Color
Definition: MSPUBTypes.h:200
libmspub::ColorReference
Definition: ColorReference.h:20
libmspub::ColorReference::WHITE_BASE
static const unsigned char WHITE_BASE
Definition: ColorReference.h:26
libmspub::Color::b
unsigned char b
Definition: MSPUBTypes.h:203
libmspub::ColorReference::BLACK_BASE
static const unsigned char BLACK_BASE
Definition: ColorReference.h:25
libmspub::ColorReference::m_modifiedColor
unsigned m_modifiedColor
Definition: ColorReference.h:22