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

Method constrain

src/Frame.cpp:678–687  ·  view source on GitHub ↗

Constrain a color value from 0 to 255

Source from the content-addressed store, hash-verified

676
677// Constrain a color value from 0 to 255
678int Frame::constrain(int color_value)
679{
680 // Constrain new color from 0 to 255
681 if (color_value < 0)
682 color_value = 0;
683 else if (color_value > 255)
684 color_value = 255;
685
686 return color_value;
687}
688
689void Frame::AddColor(int new_width, int new_height, std::string new_color)
690{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected