Skip to content

Commit

Permalink
added streaming operator to DrawParams
Browse files Browse the repository at this point in the history
  • Loading branch information
skramm committed Mar 29, 2024
1 parent a32c26f commit 621c952
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/homog2d_history.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ See [Release page](https://github.com/skramm/homog2d/releases).
- add some feature to be able to print coordinates with desired precision at runtime
- add `Vector` type (defined by dx,dy)

- current Work In Progress
- generalisation of bounding box of pair of objects
- polygon minimization

- current master branch
- added SVG import of `path` element, [see manual](homog2d_manual.md#svg_import_example).
- bugfixes:
- https://github.com/skramm/homog2d/issues/11
- https://github.com/skramm/homog2d/issues/10
- added stream operator to draw parameters

## Previous releases

Expand Down
11 changes: 11 additions & 0 deletions homog2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,17 @@ class DrawParams
}
};

friend std::ostream& operator << ( std::ostream& f, const DrawParams& dp )
{
f << "-" << dp._dpValues._color
<< "\n-line width=" << dp._dpValues._lineThickness
<< "\n-pointSize=" << dp._dpValues._pointSize
<< "\n-showPoints=" << dp._dpValues._showPoints
<< "\n-fontSize=" << dp._dpValues._fontSize
<< '\n';
return f;
}


public:
Dp_values _dpValues;
Expand Down
2 changes: 2 additions & 0 deletions misc/demo_opencv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1835,6 +1835,8 @@ int main( int argc, const char** argv )
Point2dD pt3;
std::cout << "double: size=" << pt3.dsize().first << "-" << pt3.dsize().second << '\n';

img::DrawParams dp;
std::cout << "Default draw parameters: " << dp;
std::vector<std::function<void(int)>> v_demo{
demo_RCP,
demo_orthSeg, // Perpendicular segment
Expand Down

0 comments on commit 621c952

Please sign in to comment.