author | Francesco Abbate <francesco.bbt@gmail.com> | 2012年09月14日 18:16:50 +0200 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2012年10月15日 00:16:41 +0200 |
commit | e46aa3980de06ac7b03eea246c0c15abd8b70c50 (patch) | |
tree | f576bf83574a5ce0ba2548dd11eea0be159c1d6e /agg-plot/utils.cpp | |
parent | 909a55f830086edad64577b7c0f1386c42fd32ea (diff) | |
download | gsl-shell-e46aa3980de06ac7b03eea246c0c15abd8b70c50.tar.gz |
-rw-r--r-- | agg-plot/utils.cpp | 7 |
diff --git a/agg-plot/utils.cpp b/agg-plot/utils.cpp index 7f6f8697..eb0e908a 100644 --- a/agg-plot/utils.cpp +++ b/agg-plot/utils.cpp @@ -14,3 +14,10 @@ trans_affine_compose (agg::trans_affine& a, const agg::trans_affine& b) a.tx = b.sx * a_tx + b.shx * a_ty + b.tx; a.ty = b.shy * a_tx + b.sy * a_ty + b.ty; } + +agg::trans_affine affine_matrix(const agg::rect_i& r) +{ + double w = r.x2 - r.x1, h = r.y2 - r.y1; + double tx = r.x1, ty = r.y1; + return agg::trans_affine(w, 0.0, 0.0, h, tx, ty); +} |