![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
colors in QPixmap More...
#include <Swaps>
Inheritance diagram for freeciv::colorizer:
Collaboration diagram for freeciv::colorizer:Public Member Functions | |
| colorizer (const QPixmap &base, int hue_to_replace, QObject *parent=nullptr) | |
| Creates a colorizer that will replace every pixel of the given hue. More... | |
| virtual | ~colorizer ()=default |
| QPixmap | base () const |
| Returns the base pixmap used by this colorizer. More... | |
| const QPixmap * | pixmap (const QColor &color) const |
| Returns a pixmap with some pixels changed to the target color. More... | |
Private Attributes | |
| QPixmap | m_base |
| QImage | m_base_image |
| int | m_hue_to_replace |
| std::map< QRgb, QPixmap > | m_cache |
colors in QPixmap
Starting from a base pixmap, this class generates new pixmaps with one color replaced (for instance, all pink pixels changed to green).
Definition at line 17 of file colorizer.h.
|
explicit |
Creates a colorizer that will replace every pixel of the given hue.
Passing a negative hue disables colorization.
Definition at line 25 of file colorizer.cpp.
|
virtualdefault |
|
inline |
Returns the base pixmap used by this colorizer.
Definition at line 26 of file colorizer.h.
| const QPixmap * freeciv::colorizer::pixmap | ( | const QColor & | color | ) | const |
Returns a pixmap with some pixels changed to the target color.
The pixmap is cached for later use.
Definition at line 36 of file colorizer.cpp.
|
private |
Definition at line 31 of file colorizer.h.
|
private |
Definition at line 32 of file colorizer.h.
Referenced by pixmap().
|
mutableprivate |
Definition at line 34 of file colorizer.h.
Referenced by pixmap().
|
private |
Definition at line 33 of file colorizer.h.
Referenced by pixmap().