MCPcopy Create free account
hub / github.com/awawa-dev/HyperHDR / getImage

Method getImage

sources/effects/Animation4Music_StereoWhite.cpp:55–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53};
54
55bool Animation4Music_StereoWhite::getImage(Image<ColorRgb>& newImage)
56{
57 if (hasResult == nullptr)
58 return false;
59
60 bool newData = false;
61 auto r = hasResult(this, _internalIndex, NULL, NULL, &newData, &_oldMulti);
62
63 if (r == nullptr || !newData)
64 return false;
65
66 int value = r->getValue(_oldMulti);
67
68 if (value < 0)
69 return false;
70
71 newImage.clear();
72
73 int hm = (newImage.height() / 2);
74 int h = std::min((hm * value) / 255, 255);
75 int h1 = std::max(hm - h, 0);
76 int h2 = std::min(hm + h, (int)newImage.height() - 1);
77
78 if (h2 > h1)
79 {
80 int width = newImage.width() * 0.04;
81
82 ColorRgb selected(255, 255, 255);
83
84 newImage.gradientVBox(0, h1, width, h2, selected.Red(), selected.Green(), selected.Blue());
85 newImage.gradientVBox(newImage.width() - 1 - width, h1, newImage.width() - 1, h2, selected.Red(), selected.Green(), selected.Blue());
86 }
87
88 return true;
89};
90
91bool Animation4Music_StereoWhite::isRegistered = hyperhdr::effects::REGISTER_EFFECT(Animation4Music_StereoWhite::getDefinition());

Callers

nothing calls this directly

Calls 8

getValueMethod · 0.80
RedMethod · 0.80
GreenMethod · 0.80
BlueMethod · 0.80
clearMethod · 0.45
heightMethod · 0.45
widthMethod · 0.45
gradientVBoxMethod · 0.45

Tested by

no test coverage detected