agg::trans_affine transform(box2d<double> & bbox) const
 {
     bbox *= image_tr_;
     coord<double, 2> c = bbox.center();
     agg::trans_affine mtx = agg::trans_affine_translation(
         0.5 * bbox.width() - c.x,
         0.5 * bbox.height() - c.y);
     return image_tr_ * mtx;
 }
Exemple #2
0
    void split_box(box2d<double> const& node_extent,box2d<double> * ext)
    {
        coord2d c=node_extent.center();

        double width=node_extent.width();
        double height=node_extent.height();
            
        double lox=node_extent.minx();
        double loy=node_extent.miny();
        double hix=node_extent.maxx();
        double hiy=node_extent.maxy();
            
        ext[0]=box2d<double>(lox,loy,lox + width * ratio_,loy + height * ratio_);
        ext[1]=box2d<double>(hix - width * ratio_,loy,hix,loy + height * ratio_);
        ext[2]=box2d<double>(lox,hiy - height*ratio_,lox + width * ratio_,hiy);
        ext[3]=box2d<double>(hix - width * ratio_,hiy - height*ratio_,hix,hiy);
    }