licornea_tools
border.h
Go to the documentation of this file.
1 #ifndef LICORNEA_BORDER_H_
2 #define LICORNEA_BORDER_H_
3 
4 #include "json.h"
5 
6 namespace tlz {
7 
8 struct border {
9  int top = 0;
10  int left = 0;
11  int right = 0;
12  int bottom = 0;
13 
14  bool is_none() const { return (top == 0) && (left == 0) && (right == 0) && (bottom == 0); }
15  explicit operator bool () const { return ! is_none(); }
16 };
17 
18 json encode_border(const border&);
19 border decode_border(const json&);
20 
21 cv::Size add_border(const border&, const cv::Size&);
22 cv::Point add_border(const border&, const cv::Point&);
23 
24 }
25 
26 #endif
border decode_border(const json &j_bord)
Definition: border.cc:15
int left
Definition: border.h:10
int bottom
Definition: border.h:12
bool is_none() const
Definition: border.h:14
int top
Definition: border.h:9
cv::Size add_border(const border &bord, const cv::Size &sz)
Definition: border.cc:24
int right
Definition: border.h:11
json encode_border(const border &bord)
Definition: border.cc:5
nlohmann::json json
Definition: json.h:11