working version for linux with usable scripting

This commit is contained in:
Hartmut Seichter 2019-01-16 15:40:37 +01:00
parent 28905d301e
commit 9d0c60c5f4
401 changed files with 90281 additions and 11 deletions

View file

@ -35,6 +35,9 @@ struct point_ {
point_() = default;
point_(T_ x_,T_ y_) : x(x_), y(y_) {}
template <typename To_>
point_<To_> cast() const { return point_<To_>(static_cast<To_>(x),static_cast<To_>(y)); }
};
typedef point_<real_t> point;

View file

@ -38,6 +38,16 @@ struct rect_ {
rect_(point_<T_> const & p,size_<T_> const & s) : size(s), position(p) {}
bool contains(const point_<T_>& p)
{
return p.x >= position.x && p.x <= position.x + size.width &&
p.y >= position.y && p.y <= position.y + size.height;
}
template <typename To_>
rect_<To_> cast() const { return rect_<To_>(position.template cast<To_>(),size.template cast<To_>()); }
};
typedef rect_<real_t> rect;

View file

@ -38,6 +38,11 @@ struct size_ {
T_ area() const { return std::abs(width * height); }
template <typename To_>
size_<To_> cast() const { return size_<To_>(static_cast<To_>(width),static_cast<To_>(height)); }
};
typedef size_<real_t> size;

View file

@ -6,7 +6,7 @@ namespace pw {
image::image(const sizei &s, image::pixel_layout t, void *ptr)
{
this->create(s,t,ptr);
}
bool image::create(const sizei &s, image::pixel_layout t, void *ptr)