1 #ifndef RT_AnnotationBaseDefines_H_
2 #define RT_AnnotationBaseDefines_H_
28 tagRect() :left(0), top(0), right(0), bottom(0) {}
29 tagRect(
int left,
int top,
int right,
int bottom) :left(left), top(top), right(right), bottom(bottom) {}
30 bool isRectEmpty()
const {
return (left == right || top == bottom); }
34 bool pointIn(
int x,
int y)
const {
return x >= left && right >= x && y >= top && bottom >= y; }
35 void moveY(
int y) {
int h =
height(); top = y; bottom = top + h; }
36 void moveX(
int x) {
int w =
width(); left = x; right = left + w; }
45 tagColor(
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a)
46 :color(((r | ((unsigned long)g << 8)) | (((unsigned long)b) << 16)) | (((unsigned long)a) << 24)) {}
47 unsigned char r()
const {
return color & 0xFF; }
48 unsigned char g()
const {
return (color >> 8) & 0xFF; }
49 unsigned char b()
const {
return (color >> 16) & 0xFF; }
50 unsigned char a()
const {
return (color >> 24) & 0xFF; }
51 unsigned long rgb()
const {
return color & 0xFFFFFF; }
52 unsigned long argb()
const {
return ((
b() | ((
unsigned long)
g() << 8)) | (((
unsigned long)
r()) << 16)) | (((
unsigned long)
a()) << 24); }
53 void setR(
unsigned char r) { color = (color & 0xFFFFFF00) | ((
unsigned long)r & 0xFF); }
54 void setG(
unsigned char g) { color = (color & 0xFFFF00FF) | (((
unsigned long)g & 0xFF) << 8); }
55 void setB(
unsigned char b) { color = (color & 0xFF00FFFF) | (((
unsigned long)b & 0xFF) << 16); }
56 void setA(
unsigned char a) { color = (color & 0x00FFFFFF) | (((
unsigned long)a & 0xFF) << 24); }
61 #endif //RT_AnnotationBaseDefines_H_
tagPoint()
Definition: annotationbasedefines.h:14
tagColor()
Definition: annotationbasedefines.h:43
unsigned long argb() const
Definition: annotationbasedefines.h:52
Definition: annotationbasedefines.h:23
bool operator==(const tagRect &other) const
Definition: annotationbasedefines.h:38
int x
Definition: annotationbasedefines.h:12
tagPoint(int x, int y)
Definition: annotationbasedefines.h:15
void setA(unsigned char a)
Definition: annotationbasedefines.h:56
int height() const
Definition: annotationbasedefines.h:32
bool isRectEmpty() const
Definition: annotationbasedefines.h:30
int width() const
Definition: annotationbasedefines.h:31
struct rtcimp::tagColor Color
void moveY(int y)
Definition: annotationbasedefines.h:35
void moveX(int x)
Definition: annotationbasedefines.h:36
std::list< Point > PointArray
Definition: annotationbasedefines.h:18
int top
Definition: annotationbasedefines.h:25
bool pointIn(const Point &p) const
Definition: annotationbasedefines.h:33
void moveXY(int x, int y)
Definition: annotationbasedefines.h:37
unsigned long color
Definition: annotationbasedefines.h:42
int left
Definition: annotationbasedefines.h:24
int right
Definition: annotationbasedefines.h:26
tagRect(int left, int top, int right, int bottom)
Definition: annotationbasedefines.h:29
unsigned long rgb() const
Definition: annotationbasedefines.h:51
bool operator!=(const tagRect &other) const
Definition: annotationbasedefines.h:39
Definition: annotationbasedefines.h:41
Definition: annotationbasedefines.h:7
tagColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Definition: annotationbasedefines.h:45
bool pointIn(int x, int y) const
Definition: annotationbasedefines.h:34
tagColor(unsigned long val)
Definition: annotationbasedefines.h:44
struct rtcimp::tagRect Rect
void setG(unsigned char g)
Definition: annotationbasedefines.h:54
tagRect()
Definition: annotationbasedefines.h:28
unsigned char b() const
Definition: annotationbasedefines.h:49
unsigned char r() const
Definition: annotationbasedefines.h:47
int y
Definition: annotationbasedefines.h:13
void set(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Definition: annotationbasedefines.h:57
struct rtcimp::tagPoint Point
unsigned char a() const
Definition: annotationbasedefines.h:50
unsigned char g() const
Definition: annotationbasedefines.h:48
int bottom
Definition: annotationbasedefines.h:27
Definition: annotationbasedefines.h:11
void setB(unsigned char b)
Definition: annotationbasedefines.h:55
void setR(unsigned char r)
Definition: annotationbasedefines.h:53