Code

Use g_base64_encode_step when importing images via drag and drop.
[inkscape.git] / src / display / nr-filter-utils.cpp
1 #include "nr-filter-utils.h"
3 namespace Inkscape {
4 namespace Filters {
6 int clamp(int const val) {
7     if (val < 0) return 0;
8     if (val > 255) return 255;
9     return val;
10 }
12 int clamp3(int const val) {
13     if (val < 0) return 0;
14     if (val > 16581375) return 16581375;
15     return val;
16 }
18 int clamp_alpha(int const val, int const alpha) {
19     if (val < 0) return 0;
20     if (val > alpha) return alpha;
21     return val;
22 }
24 } /* namespace Filters */
25 } /* namespace Inkscape */
27 /*
28   Local Variables:
29   mode:c++
30   c-file-style:"stroustrup"
31   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
32   indent-tabs-mode:nil
33   fill-column:99
34   End:
35 */
36 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :