Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class painter

boost::ui::painter — 2D graphics rendering painter

Synopsis

// In header: <boost/ui/painter.hpp>


class painter {
public:
  // types
  typedef double gcoord_type;         // Graphics coordinates signed number type. 
  typedef void * native_handle_type;  // Implementation-defined painter type. 

  // member classes/structs/unions

  // Saves state in the constructor and restores it in the destructor.

  class state_saver : private noncopyable {
  public:
    // construct/copy/destruct
    state_saver(painter &);
    ~state_saver();
  };

  // construct/copy/destruct
  painter(unspecified);

  // private member functions
  void save_raw();
  void restore_raw();
  void scale_raw(gcoord_type, gcoord_type);
  void rotate_raw(gcoord_type);
  void translate_raw(gcoord_type, gcoord_type);
  void fill_color_raw(const color &);
  void stroke_color_raw(const color &);
  void clear_rect_raw(gcoord_type, gcoord_type, gcoord_type, gcoord_type);
  void fill_rect_raw(gcoord_type, gcoord_type, gcoord_type, gcoord_type);
  void stroke_rect_raw(gcoord_type, gcoord_type, gcoord_type, gcoord_type);
  void fill_text_raw(const uistring &, gcoord_type, gcoord_type);
  void draw_image_raw(const image &, gcoord_type, gcoord_type);
  void begin_path_raw();
  void fill_raw();
  void stroke_raw();
  void line_width_raw(gcoord_type);
  void line_cap_raw(ui::line_cap);
  void line_join_raw(ui::line_join);
  void line_dash_raw(const std::vector< gcoord_type > &);
  void reset_line_dash_raw();
  void font_raw(const ui::font &);
  void close_path_raw();
  void move_to_raw(gcoord_type, gcoord_type);
  void line_to_raw(gcoord_type, gcoord_type);
  void quadratic_curve_to_raw(gcoord_type, gcoord_type, gcoord_type, 
                              gcoord_type);
  void bezier_curve_to_raw(gcoord_type, gcoord_type, gcoord_type, gcoord_type, 
                           gcoord_type, gcoord_type);
  void arc_raw(gcoord_type, gcoord_type, gcoord_type, gcoord_type, 
               gcoord_type, bool);
  void rect_raw(gcoord_type, gcoord_type, gcoord_type, gcoord_type);

  // public member functions
  painter & save();
  painter & restore();
  painter & scale(gcoord_type, gcoord_type);
  painter & rotate(gcoord_type);
  painter & fill_color(const color &);
  painter & stroke_color(const color &);
  painter & begin_path();
  painter & fill();
  painter & stroke();
  painter & line_width(gcoord_type);
  painter & line_cap(ui::line_cap);
  painter & line_join(ui::line_join);
  painter & font(const ui::font &);
  ui::font font() const;
  painter & close_path();
};

Description

See Also:

2D computer graphics (Wikipedia)

See Also:

HTML Canvas 2D Context, Level 1 (W3C)

See Also:

HTML Canvas 2D Context, Level 2 (W3C)

painter public construct/copy/destruct

  1. painter(unspecified impl);

painter private member functions

  1. void save_raw();
  2. void restore_raw();
  3. void scale_raw(gcoord_type x, gcoord_type y);
  4. void rotate_raw(gcoord_type angle);
  5. void translate_raw(gcoord_type x, gcoord_type y);
  6. void fill_color_raw(const color & c);
  7. void stroke_color_raw(const color & c);
  8. void clear_rect_raw(gcoord_type x, gcoord_type y, gcoord_type width, 
                        gcoord_type height);
  9. void fill_rect_raw(gcoord_type x, gcoord_type y, gcoord_type width, 
                       gcoord_type height);
  10. void stroke_rect_raw(gcoord_type x, gcoord_type y, gcoord_type width, 
                         gcoord_type height);
  11. void fill_text_raw(const uistring & text, gcoord_type x, gcoord_type y);
  12. void draw_image_raw(const image & img, gcoord_type dx, gcoord_type dy);
  13. void begin_path_raw();
  14. void fill_raw();
  15. void stroke_raw();
  16. void line_width_raw(gcoord_type width);
  17. void line_cap_raw(ui::line_cap lc);
  18. void line_join_raw(ui::line_join lj);
  19. void line_dash_raw(const std::vector< gcoord_type > & segments);
  20. void reset_line_dash_raw();
  21. void font_raw(const ui::font & f);
  22. void close_path_raw();
  23. void move_to_raw(gcoord_type x, gcoord_type y);
  24. void line_to_raw(gcoord_type x, gcoord_type y);
  25. void quadratic_curve_to_raw(gcoord_type cpx, gcoord_type cpy, gcoord_type x, 
                                gcoord_type y);
  26. void bezier_curve_to_raw(gcoord_type cp1x, gcoord_type cp1y, gcoord_type cp2x, 
                             gcoord_type cp2y, gcoord_type x, gcoord_type y);
  27. void arc_raw(gcoord_type x, gcoord_type y, gcoord_type radius, 
                 gcoord_type start_angle, gcoord_type end_angle, 
                 bool anticlockwise);
  28. void rect_raw(gcoord_type x, gcoord_type y, gcoord_type w, gcoord_type h);

painter public member functions

  1. painter & save();
    Push state.
  2. painter & restore();
    Pop state.
  3. painter & scale(gcoord_type x, gcoord_type y);
    Adds scaling transformation.
  4. painter & rotate(gcoord_type angle);
    Adds rotation transformation.
  5. painter & fill_color(const color & c);
    Sets the current color used for filling shapes.
  6. painter & stroke_color(const color & c);
    Sets the current color used for filling shapes.
  7. painter & begin_path();
    Resets the current path.
  8. painter & fill();
    Fills the current path.
  9. painter & stroke();
    Strokes the current path.
  10. painter & line_width(gcoord_type width);
    Sets line width (default is 1)
  11. painter & line_cap(ui::line_cap lc);
    Sets type of line endings, default value is butt.
  12. painter & line_join(ui::line_join lj);
    Sets type of line join, default value is miter.
  13. painter & font(const ui::font & f);
    Sets font.
  14. ui::font font() const;
    Returns font.
  15. painter & close_path();
    Connects the last point to the first point in the subpath.

PrevUpHomeNext