Changeset 1676
- Timestamp:
- 03/11/10 10:20:04 (5 months ago)
- Location:
- branches/0.7.1-dev
- 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
-
branches/0.7.1-dev/include/mapnik/global.hpp
r1445 r1676 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 -
branches/0.7.1-dev/include/mapnik/graphics.hpp
r1492 r1676 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) ; -
branches/0.7.1-dev/include/mapnik/image_util.hpp
r1655 r1676 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 … … 407 407 int tw2 = target_width/2; 408 408 int th2 = target_height/2; 409 int offs_x = int(round((source_width-target_width-x_off_f*2*source_width)/2));410 int offs_y = int(round((source_height-target_height-y_off_f*2*source_height)/2));409 int offs_x = rint((source_width-target_width-x_off_f*2*source_width)/2); 410 int offs_y = rint((source_height-target_height-y_off_f*2*source_height)/2); 411 411 unsigned yprt, yprt1, xprt, xprt1; 412 412 -
branches/0.7.1-dev/src/agg_renderer.cpp
r1655 r1676 74 74 #include <iostream> 75 75 #endif 76 77 #include <cmath> 76 78 77 79 namespace mapnik … … 571 573 { 572 574 //pixmap_.set_rectangle_alpha(px,py,*data); 573 pixmap_.set_rectangle_alpha2(*data,px,py, sym.get_opacity());575 pixmap_.set_rectangle_alpha2(*data,px,py,float(sym.get_opacity())); 574 576 Envelope<double> dim = ren.prepare_glyphs(&text_placement.placements[0]); 575 577 ren.render(x,y); … … 715 717 { 716 718 Envelope<double> ext=t_.forward(raster->ext_); 717 int start_x = int(round(ext.minx()));718 int start_y = int(round(ext.miny()));719 int raster_width = int(round(ext.width()));720 int raster_height = int(round(ext.height()));719 int start_x = rint(ext.minx()); 720 int start_y = rint(ext.miny()); 721 int raster_width = rint(ext.width()); 722 int raster_height = rint(ext.height()); 721 723 int end_x = start_x + raster_width; 722 724 int end_y = start_y + raster_height;
