MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / FadeToColorImageOperation

Method FadeToColorImageOperation

source/core/StarImageProcessing.cpp:48–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48FadeToColorImageOperation::FadeToColorImageOperation(Vec3B color, float amount) {
49 this->color = color;
50 this->amount = amount;
51
52 auto fcl = Color::rgb(color).toLinear();
53 for (int i = 0; i <= 255; ++i) {
54 auto r = Color::rgb(Vec3B(i, i, i)).toLinear().mix(fcl, amount).toSRGB().toRgb();
55 rTable[i] = r[0];
56 gTable[i] = r[1];
57 bTable[i] = r[2];
58 }
59}
60
61ImageOperation imageOperationFromString(StringView string) {
62 try {

Callers

nothing calls this directly

Calls 4

toLinearMethod · 0.80
toRgbMethod · 0.80
toSRGBMethod · 0.80
mixMethod · 0.45

Tested by

no test coverage detected