From cb578ea22fee001d5ba24988dfc9ddd50e25465d Mon Sep 17 00:00:00 2001 From: Davis King Date: Sat, 21 Jan 2012 16:42:47 -0500 Subject: [PATCH] Simplified the add_overlay() interface for image_window. --- dlib/gui_widgets/widgets.h | 12 +++++++++++ dlib/gui_widgets/widgets_abstract.h | 32 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/dlib/gui_widgets/widgets.h b/dlib/gui_widgets/widgets.h index b5cfe5c45..2b19f1def 100644 --- a/dlib/gui_widgets/widgets.h +++ b/dlib/gui_widgets/widgets.h @@ -3479,10 +3479,22 @@ namespace dlib const overlay_rect& overlay ); + template + void add_overlay(const rectangle& r, pixel_type p) + { add_overlay(image_display::overlay_rect(r,p)); } + + template + void add_overlay(const rectangle& r, pixel_type p, const std::string& l) + { add_overlay(image_display::overlay_rect(r,p,l)); } + void add_overlay ( const overlay_line& overlay ); + template + void add_overlay(const point& p1, const point& p2, pixel_type p) + { add_overlay(image_display::overlay_line(p1,p2,p)); } + void add_overlay ( const std::vector& overlay ); diff --git a/dlib/gui_widgets/widgets_abstract.h b/dlib/gui_widgets/widgets_abstract.h index 9e131cd9b..8b7b1a686 100644 --- a/dlib/gui_widgets/widgets_abstract.h +++ b/dlib/gui_widgets/widgets_abstract.h @@ -2701,6 +2701,27 @@ namespace dlib that it will be displayed. !*/ + template + void add_overlay( + const rectangle& r, + pixel_type p + ); + /*! + ensures + - performs: add_overlay(overlay_rect(r,p)); + !*/ + + template + void add_overlay( + const rectangle& r, + pixel_type p, + const std::string& l + ); + /*! + ensures + - performs: add_overlay(overlay_rect(r,p,l)); + !*/ + void add_overlay ( const overlay_line& overlay ); @@ -2710,6 +2731,17 @@ namespace dlib that it will be displayed. !*/ + template + void add_overlay( + const point& p1, + const point& p2, + pixel_type p + ); + /*! + ensures + - performs: add_overlay(overlay_line(p1,p2,p)); + !*/ + void add_overlay ( const std::vector& overlay );