Changeset 1681
- Timestamp:
- 03/11/10 18:19:12 (5 months ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
include/mapnik/global.hpp (modified) (1 diff)
-
include/mapnik/graphics.hpp (modified) (2 diffs)
-
include/mapnik/image_util.hpp (modified) (2 diffs)
-
src/agg_renderer.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/mapnik/global.hpp
r1445 r1681 160 160 return val; 161 161 } 162 163 #ifdef _WINDOWS 164 // msvc doesn't have rint in <cmath> 165 inline int rint( double val) 166 { 167 return int(floor(val + 0.5)); 168 } 169 #endif 170 162 171 } 163 172 -
trunk/include/mapnik/graphics.hpp
r1495 r1681 370 370 unsigned b0 = (rgba0 >> 8) & 0xff; 371 371 372 r0 = uint8_t(((r1 - r0) * a1 + (r0 << 8)) >> 8);373 g0 = uint8_t(((g1 - g0) * a1 + (g0 << 8)) >> 8);374 b0 = uint8_t(((b1 - b0) * a1 + (b0 << 8)) >> 8);375 a0 = uint8_t((a1 + a0) - ((a1 * a0 + 255) >> 8));372 r0 = byte(((r1 - r0) * a1 + (r0 << 8)) >> 8); 373 g0 = byte(((g1 - g0) * a1 + (g0 << 8)) >> 8); 374 b0 = byte(((b1 - b0) * a1 + (b0 << 8)) >> 8); 375 a0 = byte((a1 + a0) - ((a1 * a0 + 255) >> 8)); 376 376 377 377 row_to[x] = (a0)| (b0 << 8) | (g0 << 16) | (r0 << 24) ; … … 388 388 unsigned b0 = (rgba0 >> 16) & 0xff; 389 389 390 r0 = uint8_t(((r1 - r0) * a1 + (r0 << 8)) >> 8);391 g0 = uint8_t(((g1 - g0) * a1 + (g0 << 8)) >> 8);392 b0 = uint8_t(((b1 - b0) * a1 + (b0 << 8)) >> 8);393 a0 = uint8_t((a1 + a0) - ((a1 * a0 + 255) >> 8));390 r0 = byte(((r1 - r0) * a1 + (r0 << 8)) >> 8); 391 g0 = byte(((g1 - g0) * a1 + (g0 << 8)) >> 8); 392 b0 = byte(((b1 - b0) * a1 + (b0 << 8)) >> 8); 393 a0 = byte((a1 + a0) - ((a1 * a0 + 255) >> 8)); 394 394 395 395 row_to[x] = (a0 << 24)| (b0 << 16) | (g0 << 8) | (r0) ; -
trunk/include/mapnik/image_util.hpp
r1656 r1681 233 233 int tw2 = target_width/2; 234 234 int th2 = target_height/2; 235 int offs_x = int(round((source_width-target_width-x_off_f*2*source_width)/2));236 int offs_y = int(round((source_height-target_height-y_off_f*2*source_height)/2));235 int offs_x = rint((source_width-target_width-x_off_f*2*source_width)/2); 236 int offs_y = rint((source_height-target_height-y_off_f*2*source_height)/2); 237 237 unsigned yprt, yprt1, xprt, xprt1; 238 238 … … 320 320 int tw2 = target_width/2; 321 321 int th2 = target_height/2; 322 int offs_x = int(round((source_width-target_width-x_off_f*2*source_width)/2));323 int offs_y = int(round((source_height-target_height-y_off_f*2*source_height)/2));322 int offs_x = rint((source_width-target_width-x_off_f*2*source_width)/2); 323 int offs_y = rint((source_height-target_height-y_off_f*2*source_height)/2); 324 324 unsigned yprt, yprt1, xprt, xprt1; 325 325 -
trunk/src/agg_renderer.cpp
r1657 r1681 76 76 #include <iostream> 77 77 #endif 78 79 #include <cmath> 78 80 79 81 namespace mapnik … … 596 598 { 597 599 //pixmap_.set_rectangle_alpha(px,py,*data); 598 pixmap_.set_rectangle_alpha2(*(*data),px,py, sym.get_opacity());600 pixmap_.set_rectangle_alpha2(*(*data),px,py,float(sym.get_opacity())); 599 601 box2d<double> dim = ren.prepare_glyphs(&text_placement.placements[0]); 600 602 ren.render(x,y); … … 750 752 box2d<double> ext=t_.forward(raster->ext_); 751 753 752 int start_x = int(round(ext.minx()));753 int start_y = int(round(ext.miny()));754 int raster_width = int(round(ext.width()));755 int raster_height = int(round(ext.height()));754 int start_x = rint(ext.minx()); 755 int start_y = rint(ext.miny()); 756 int raster_width = rint(ext.width()); 757 int raster_height = rint(ext.height()); 756 758 int end_x = start_x + raster_width; 757 759 int end_y = start_y + raster_height;
