Boost.UI
User Interface Boost library
Classes | Public Types | Public Member Functions | Friends | List of all members
boost::ui::painter Class Reference

2D graphics rendering painter More...

Classes

class  state_saver
 Saves state in the constructor and restores it in the destructor. More...
 

Public Types

typedef double gcoord_type
 Graphics coordinates signed number type.
 
typedef void * native_handle_type
 Implementation-defined painter type.
 

Public Member Functions

paintersave ()
 Push state.
 
painterrestore ()
 Pop state.
 
painterscale (gcoord_type x, gcoord_type y)
 Adds scaling transformation.
 
painterrotate (gcoord_type angle)
 Adds rotation transformation.
 
painterfill_color (const color &c)
 Sets the current color used for filling shapes.
 
painterstroke_color (const color &c)
 Sets the current color used for filling shapes.
 
painterbegin_path ()
 Resets the current path.
 
painterfill ()
 Fills the current path.
 
painterstroke ()
 Strokes the current path.
 
painterline_width (gcoord_type width)
 Sets line width (default is 1)
 
painterline_cap (ui::line_cap lc)
 Sets type of line endings, default value is butt.
 
painterline_join (ui::line_join lj)
 Sets type of line join, default value is miter.
 
painterfont (const ui::font &f)
 Sets font.
 
ui::font font () const
 Returns font.
 
painterclose_path ()
 Connects the last point to the first point in the subpath.
 
paintertranslate (gcoord_type x, gcoord_type y)
 Adds translation transformation.
 
template<class T >
paintertranslate (const basic_point< T > &p)
 Adds translation transformation.
 
painterclear_rect (gcoord_type x, gcoord_type y, gcoord_type width, gcoord_type height)
 Clears all pixels on the painter in the given rectangle to transparent black.
 
template<class T >
painterclear_rect (const basic_rect< T > &r)
 Clears all pixels on the painter in the given rectangle to transparent black.
 
template<class T >
painterclear_rect (const basic_point< T > &point, const basic_size< T > &size)
 Clears all pixels on the painter in the given rectangle to transparent black.
 
template<class T >
painterclear_rect (const basic_point< T > &point1, const basic_point< T > &point2)
 Clears all pixels on the painter in the given rectangle to transparent black.
 
painterfill_rect (gcoord_type x, gcoord_type y, gcoord_type width, gcoord_type height)
 Paints the given rectangle onto the painter, using the current fill style.
 
template<class T >
painterfill_rect (const basic_rect< T > &r)
 Paints the given rectangle onto the painter, using the current fill style.
 
template<class T >
painterfill_rect (const basic_point< T > &point, const basic_size< T > &size)
 Paints the given rectangle onto the painter, using the current fill style.
 
template<class T >
painterfill_rect (const basic_point< T > &point1, const basic_point< T > &point2)
 Paints the given rectangle onto the painter, using the current fill style.
 
painterstroke_rect (gcoord_type x, gcoord_type y, gcoord_type width, gcoord_type height)
 Paints the box that outlines the given rectangle onto the painter, using the current stroke style.
 
template<class T >
painterstroke_rect (const basic_rect< T > &r)
 Paints the box that outlines the given rectangle onto the painter, using the current stroke style.
 
template<class T >
painterstroke_rect (const basic_point< T > &point, const basic_size< T > &size)
 Paints the box that outlines the given rectangle onto the painter, using the current stroke style.
 
template<class T >
painterstroke_rect (const basic_point< T > &point1, const basic_point< T > &point2)
 Paints the box that outlines the given rectangle onto the painter, using the current stroke style.
 
painterfill_text (const uistring &text, gcoord_type x, gcoord_type y)
 Fills the given text at the given position.
 
template<class T >
painterfill_text (const uistring &text, const basic_point< T > &p)
 Fills the given text at the given position.
 
painterdraw_image (const image &img, gcoord_type dx, gcoord_type dy)
 Draws the given image onto the painter.
 
template<class T >
painterdraw_image (const image &img, const basic_point< T > &p)
 Draws the given image onto the painter.
 
template<class Iterator >
painterline_dash (Iterator first, Iterator last)
 Sets line dashes.
 
template<class Range >
painterline_dash (const Range &r)
 Sets line dashes.
 
template<class T >
painterline_dash (std::initializer_list< T > list)
 Sets line dashes.
 
painterline_dash (nullopt_t)
 Resets line dashes.
 
painterreset_line_dash ()
 Resets line dashes.
 
paintermove_to (gcoord_type x, gcoord_type y)
 Creates a new subpath with the specified point as its first (and only) point.
 
template<class T >
paintermove_to (const basic_point< T > &p)
 Creates a new subpath with the specified point as its first (and only) point.
 
painterline_to (gcoord_type x, gcoord_type y)
 Connects the last point in the subpath to the specified point using a straight line.
 
template<class T >
painterline_to (const basic_point< T > &p)
 Connects the last point in the subpath to the specified point using a straight line.
 
painterquadratic_curve_to (gcoord_type cpx, gcoord_type cpy, gcoord_type x, gcoord_type y)
 Creates quadratic Bezier curve with control point (cpx, cpy)
 
template<class T >
painterquadratic_curve_to (const basic_point< T > &cp, const basic_point< T > &p)
 Creates quadratic Bezier curve with control point (cpx, cpy)
 
painterbezier_curve_to (gcoord_type cp1x, gcoord_type cp1y, gcoord_type cp2x, gcoord_type cp2y, gcoord_type x, gcoord_type y)
 Creates cubic Bezier curve with control points (cp1x, cp1y) and (cp2x, cp2y)
 
template<class T >
painterbezier_curve_to (const basic_point< T > &cp1, const basic_point< T > &cp2, const basic_point< T > &p)
 Creates cubic Bezier curve with control points (cp1x, cp1y) and (cp2x, cp2y)
 
painterarc (gcoord_type x, gcoord_type y, gcoord_type radius, gcoord_type start_angle, gcoord_type end_angle, bool anticlockwise=false)
 Creates an arc.
 
template<class T >
painterarc (const basic_point< T > &p, gcoord_type radius, gcoord_type start_angle, gcoord_type end_angle, bool anticlockwise=false)
 Creates an arc.
 
painterrect (gcoord_type x, gcoord_type y, gcoord_type w, gcoord_type h)
 Creates rectangular closed subpath.
 
template<class T >
painterrect (const basic_rect< T > &r)
 Creates rectangular closed subpath.
 
template<class T >
painterrect (const basic_point< T > &point, const basic_size< T > &size)
 Creates rectangular closed subpath.
 
template<class T >
painterrect (const basic_point< T > &point1, const basic_point< T > &point2)
 Creates rectangular closed subpath.
 
native_handle_type native_handle ()
 Returns the implementation-defined underlying painter handle.
 

Friends

class canvas
 

Detailed Description

2D graphics rendering painter

See also
2D computer graphics (Wikipedia)
HTML Canvas 2D Context, Level 1 (W3C)
HTML Canvas 2D Context, Level 2 (W3C)

The documentation for this class was generated from the following file: