| 199 | // ------------------------------------------------------------------------------------ |
| 200 | |
| 201 | inline point_transform_affine normalizing_tform ( |
| 202 | const rectangle& rect |
| 203 | ) |
| 204 | /*! |
| 205 | ensures |
| 206 | - returns a transform that maps rect.tl_corner() to (0,0) and rect.br_corner() |
| 207 | to (1,1). |
| 208 | !*/ |
| 209 | { |
| 210 | std::vector<vector<float,2> > from_points, to_points; |
| 211 | from_points.push_back(rect.tl_corner()); to_points.push_back(point(0,0)); |
| 212 | from_points.push_back(rect.tr_corner()); to_points.push_back(point(1,0)); |
| 213 | from_points.push_back(rect.br_corner()); to_points.push_back(point(1,1)); |
| 214 | return find_affine_transform(from_points, to_points); |
| 215 | } |
| 216 | |
| 217 | // ------------------------------------------------------------------------------------ |
| 218 | |