resonance 1.0.1
Loading...
Searching...
No Matches
normalkey.h
Go to the documentation of this file.
1#pragma once
2
3#include <math.h>
4#include <vector>
5
6struct Color;
7
17class NormalKey {
18public:
32 NormalKey(float flRed, float flGreen, float flBlue);
33
46 static void InsertUniqueNormalKey(std::vector<NormalKey> &keys, const Color &color);
47
56 float RatioDistance(const NormalKey &other) const {
57 return fabsf(mRed - other.mRed) + fabsf(mGreen - other.mGreen) + fabsf(mBlue - other.mBlue);
58 }
59
60 float mScale;
61 float mRed;
62 float mGreen;
63 float mBlue;
64};
65
Colour recorded as its brightest channel and the three channels divided by it.
Definition normalkey.h:17
float mRed
Definition normalkey.h:61
float mGreen
Definition normalkey.h:62
static void InsertUniqueNormalKey(std::vector< NormalKey > &keys, const Color &color)
Add the key of a colour to a set of keys unless the set already has its hue.
float RatioDistance(const NormalKey &other) const
Sum of the absolute differences between this key's ratios and another's.
Definition normalkey.h:56
NormalKey(float flRed, float flGreen, float flBlue)
Build the key of one colour.
float mScale
Definition normalkey.h:60
float mBlue
Definition normalkey.h:63
NormalKey g_normalKeyUnused
Key the unit's static initialiser constructs from (16, 0, 0).
Linear colour with four float components.
Definition color.h:10