Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

nr-filter-utils.cpp

#include "nr-filter-utils.h"

namespace NR {

00005 int clamp(int const val) {
    if (val < 0) return 0;
    if (val > 255) return 255;
    return val;
}

00011 int clamp3(int const val) {
    if (val < 0) return 0;
    if (val > 16581375) return 16581375;
    return val;
}

00017 int clamp_alpha(int const val, int const alpha) {
    if (val < 0) return 0;
    if (val > alpha) return alpha;
    return val;
}

} //namespace NR

/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :

Generated by  Doxygen 1.6.0   Back to index