Function to print pixel_position to stream.
This commit is contained in:
parent
0b1c983d40
commit
5115658ecc
1 changed files with 17 additions and 0 deletions
|
@ -22,6 +22,9 @@
|
|||
#ifndef MAPNIK_PIXEL_POSITION_HPP
|
||||
#define MAPNIK_PIXEL_POSITION_HPP
|
||||
|
||||
// stl
|
||||
#include <iomanip>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
||||
|
@ -65,6 +68,20 @@ inline pixel_position operator* (double factor, pixel_position const& pos)
|
|||
return pixel_position(factor * pos.x, factor * pos.y);
|
||||
}
|
||||
|
||||
template <class charT, class traits>
|
||||
inline std::basic_ostream<charT,traits>&
|
||||
operator << (std::basic_ostream<charT,traits>& out,
|
||||
const pixel_position& e)
|
||||
{
|
||||
std::basic_ostringstream<charT,traits> s;
|
||||
s.copyfmt(out);
|
||||
s.width(0);
|
||||
s << '(' << std::fixed << std::setprecision(16)
|
||||
<< e.x << ", " << e.y << ')';
|
||||
out << s.str();
|
||||
return out;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue