ac6956c45806ae866d35787b53c2ea0f0590f3aa
[ipdf/code.git] / src / path.h
1 #ifndef _PATH_H
2 #define _PATH_H
3
4 #include <vector>
5 #include <algorithm>
6 #include "rect.h"
7 #include "real.h"
8
9 namespace IPDF
10 {
11         
12         struct Colour
13         {
14                 float r; float g; float b; float a;
15                 Colour() = default;
16                 Colour(float _r, float _g, float _b, float _a) : r(_r), g(_g), b(_b), a(_a) {}
17                 bool operator==(const Colour & c) const
18                 {
19                         return (r == c.r && g == c.g && b == c.b && a == c.a);
20                 }
21                 bool operator!=(const Colour & c) const {return !this->operator==(c);}
22         };
23         
24         class Objects;
25         
26         struct Path
27         {
28                 Path(const Objects & objects, unsigned _start, unsigned _end, const Colour & _fill = Colour(0.8,0.8,0.8,1));
29                 
30                 Rect SolveBounds(const Objects & objects) const;
31                 
32                 
33                 
34                 unsigned m_start; // First bounding Bezier index
35                 unsigned m_end; // Last (inclusive) '' ''
36                 unsigned m_index; // index into Objects array
37                 
38                 std::pair<Real,Real> m_top;
39                 std::pair<Real,Real> m_bottom;
40                 std::pair<Real,Real> m_left;
41                 std::pair<Real,Real> m_right;
42                 
43                 Colour m_fill;  // colour to fill with  
44         };
45
46 }
47 #endif //_PATH_H

UCC git Repository :: git.ucc.asn.au