nr-filter-utils.cpp revision 9e48bcf8c4a1baf69228357a2921b48a6bb72b93
5418N/A#include "nr-filter-utils.h"
5418N/A
5418N/Anamespace NR {
5858N/A
5858N/Aint clamp(int const val) {
5858N/A if (val < 0) return 0;
5418N/A if (val > 255) return 255;
5418N/A return val;
5418N/A}
5418N/A
5418N/Aint clamp3(int const val) {
5418N/A if (val < 0) return 0;
5418N/A if (val > 16581375) return 16581375;
return val;
}
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 :