summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 800e9c0)
raw | patch | inline | side by side (parent: 800e9c0)
author | kiirala <kiirala@users.sourceforge.net> | |
Sun, 5 Apr 2009 15:49:17 +0000 (15:49 +0000) | ||
committer | kiirala <kiirala@users.sourceforge.net> | |
Sun, 5 Apr 2009 15:49:17 +0000 (15:49 +0000) |
src/display/nr-filter-displacement-map.cpp | patch | blob | history |
diff --git a/src/display/nr-filter-displacement-map.cpp b/src/display/nr-filter-displacement-map.cpp
index d2b1c2a0bdb3093503a569f8feec815ce00aee4f..3c59d70e748ee6e8f8a96c019e3f73be49a411e6 100644 (file)
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#include <cmath>
+#if defined (SOLARIS) && (SOLARIS == 8)
+#include "round.h"
+using Inkscape::round;
+#endif
+
#include "display/nr-filter-displacement-map.h"
#include "display/nr-filter-types.h"
#include "display/nr-filter-units.h"
unsigned int const sfl = 8u;
unsigned int const sf = 1u<<sfl;
unsigned int const sf2h = 1u<<(2u*sfl-1);
- int xi = (int)floor(x), yi = (int)floor(y);
- unsigned int xf = static_cast<unsigned int>(floor(sf*(x-xi)+.5)), yf = static_cast<unsigned int>(floor(sf*(y-yi)+.5));
- pixel_t p00 = pixelValue(pb, xi+0, yi+0);
- pixel_t p01 = pixelValue(pb, xi+1, yi+0);
- pixel_t p10 = pixelValue(pb, xi+0, yi+1);
- pixel_t p11 = pixelValue(pb, xi+1, yi+1);
+ int xi = (int)round(x), yi = (int)round(y);
+ unsigned int xf = static_cast<unsigned int>(round(sf * (x - (xi - 0.5)))),
+ yf = static_cast<unsigned int>(round(sf * (y - (yi - 0.5))));
+ pixel_t p00 = pixelValue(pb, xi-1, yi-1);
+ pixel_t p01 = pixelValue(pb, xi-0, yi-1);
+ pixel_t p10 = pixelValue(pb, xi-1, yi-0);
+ pixel_t p11 = pixelValue(pb, xi-0, yi-0);
/* It's a good idea to interpolate premultiplied colors:
*