Commit baf193a5 authored by Davis King's avatar Davis King

Made rectangle implicitly convertible to a chip_details.

parent 5f7007cf
...@@ -1500,6 +1500,7 @@ namespace dlib ...@@ -1500,6 +1500,7 @@ namespace dlib
struct chip_details struct chip_details
{ {
chip_details() : angle(0), rows(0), cols(0) {} chip_details() : angle(0), rows(0), cols(0) {}
chip_details(const rectangle& rect_) : rect(rect_),angle(0), rows(rect_.height()), cols(rect_.width()) {}
chip_details(const drectangle& rect_) : rect(rect_),angle(0), rows(rect_.height()), cols(rect_.width()) {} chip_details(const drectangle& rect_) : rect(rect_),angle(0), rows(rect_.height()), cols(rect_.width()) {}
chip_details(const drectangle& rect_, unsigned long size) : rect(rect_),angle(0) chip_details(const drectangle& rect_, unsigned long size) : rect(rect_),angle(0)
{ compute_dims_from_size(size); } { compute_dims_from_size(size); }
......
...@@ -934,6 +934,18 @@ namespace dlib ...@@ -934,6 +934,18 @@ namespace dlib
- #cols == rect_.width() - #cols == rect_.width()
!*/ !*/
chip_details(
const rectangle& rect_
);
/*!
ensures
- #rect == rect_
- #size() == rect_.area()
- #angle == 0
- #rows == rect_.height()
- #cols == rect_.width()
!*/
chip_details( chip_details(
const drectangle& rect_, const drectangle& rect_,
unsigned long size_ unsigned long size_
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment