示例#1
0
geometry::Range2d<int>
Renderer_gles1::world_to_pixel(const geometry::Range2d<float>& wb) const
{
    if (wb.isNull() || wb.isWorld()) return wb;
    
    int xmin, ymin, xmax, ymax;
    
    world_to_pixel(xmin, ymin, wb.getMinX(), wb.getMinY());
    world_to_pixel(xmax, ymax, wb.getMaxX(), wb.getMaxY());
    
    return geometry::Range2d<int>(xmin, ymin, xmax, ymax);
}
示例#2
0
void
SWFMatrix::transform(geometry::Range2d<boost::int32_t>& r) const
{
    const boost::int32_t xmin = r.getMinX();
    const boost::int32_t xmax = r.getMaxX();
    const boost::int32_t ymin = r.getMinY();
    const boost::int32_t ymax = r.getMaxY();

    point p0(xmin, ymin);
    point p1(xmin, ymax);
    point p2(xmax, ymax);
    point p3(xmax, ymin);

    transform(p0);
    transform(p1);
    transform(p2);
    transform(p3);

    r.setTo(p0.x, p0.y);
    r.expandTo(p1.x, p1.y);
    r.expandTo(p2.x, p2.y);
    r.expandTo(p3.x, p3.y);
}