MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / constrain

Method constrain

src/EffectBase.cpp:77–86  ·  view source on GitHub ↗

Constrain a color value from 0 to 255

Source from the content-addressed store, hash-verified

75
76// Constrain a color value from 0 to 255
77int EffectBase::constrain(int color_value)
78{
79 // Constrain new color from 0 to 255
80 if (color_value < 0)
81 color_value = 0;
82 else if (color_value > 255)
83 color_value = 255;
84
85 return color_value;
86}
87
88// Generate JSON string of this object
89std::string EffectBase::Json() const {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected