X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fpath.h;fp=src%2Fpath.h;h=ac6956c45806ae866d35787b53c2ea0f0590f3aa;hp=0000000000000000000000000000000000000000;hb=3172dd5af487e0f8a6e5cd5439dea594b9cbd7c9;hpb=67fbce330b046b1f0d63222f04d83410dc1b2faa diff --git a/src/path.h b/src/path.h new file mode 100644 index 0000000..ac6956c --- /dev/null +++ b/src/path.h @@ -0,0 +1,47 @@ +#ifndef _PATH_H +#define _PATH_H + +#include +#include +#include "rect.h" +#include "real.h" + +namespace IPDF +{ + + struct Colour + { + float r; float g; float b; float a; + Colour() = default; + Colour(float _r, float _g, float _b, float _a) : r(_r), g(_g), b(_b), a(_a) {} + bool operator==(const Colour & c) const + { + return (r == c.r && g == c.g && b == c.b && a == c.a); + } + bool operator!=(const Colour & c) const {return !this->operator==(c);} + }; + + class Objects; + + struct Path + { + Path(const Objects & objects, unsigned _start, unsigned _end, const Colour & _fill = Colour(0.8,0.8,0.8,1)); + + Rect SolveBounds(const Objects & objects) const; + + + + unsigned m_start; // First bounding Bezier index + unsigned m_end; // Last (inclusive) '' '' + unsigned m_index; // index into Objects array + + std::pair m_top; + std::pair m_bottom; + std::pair m_left; + std::pair m_right; + + Colour m_fill; // colour to fill with + }; + +} +#endif //_PATH_H