Mon, 12 Jul 2021 17:40:10 +0300
* For transformation added Point and Bounds MirrorX/Y
--- a/Source/Gorgon/Geometry/Bounds.h Sun Jul 11 10:14:45 2021 +0300 +++ b/Source/Gorgon/Geometry/Bounds.h Mon Jul 12 17:40:10 2021 +0300 @@ -807,6 +807,14 @@ bounds.Bottom= T_( bounds.Bottom+ (bounds.Left -origin.X)*rate ); } } + template <class T_> + void MirrorX(basic_Bounds<T_> &bounds){ + bounds.Right = -bounds.Right; + } + template <class T_> + void MirrorY(basic_Bounds<T_> &bounds){ + bounds.Bottom = -bounds.Bottom; + } /// @see basic_Bounds typedef basic_Bounds<Float> Boundsf;
--- a/Source/Gorgon/Geometry/Point.h Sun Jul 11 10:14:45 2021 +0300 +++ b/Source/Gorgon/Geometry/Point.h Mon Jul 12 17:40:10 2021 +0300 @@ -549,16 +549,16 @@ void SkewY(basic_Point<T_> &point, const O_ &rate, const basic_Point<T_> &origin) { point.Y += T_((point.X-origin.X)*rate); } - + /// Reflects the given point along the X axis template<class T_> - void ReflectX(basic_Point<T_> &point) { + void MirrorX(basic_Point<T_> &point) { point.Y = -point.Y; } /// Reflects the given point along the Y axis template<class T_> - void ReflectY(basic_Point<T_> &point) { + void MirrorY(basic_Point<T_> &point) { point.X = -point.X; }
--- a/Source/Gorgon/Graphics/Bitmap.h Sun Jul 11 10:14:45 2021 +0300 +++ b/Source/Gorgon/Graphics/Bitmap.h Mon Jul 12 17:40:10 2021 +0300 @@ -19,7 +19,7 @@ * Some operations are inplace while others create new Bitmaps. This is done for performance reasons and both * can be used to create a new image: `newimage = cur.Duplicate.Grayscale();` or inplace: `cur = cur.Blur();` */ - class Bitmap : + class Bitmap : public virtual Graphics::RectangularAnimationProvider, public virtual Graphics::Image, public virtual Graphics::RectangularAnimation, protected virtual Graphics::Texture, public virtual Graphics::TextureSource { @@ -719,7 +719,7 @@ } /// Rotates this bitmap as a new one using the supplied interpolation method. - Bitmap Rotate(Float ang, const Geometry::Pointf &origin, Containers::InterpolationMethod method = Containers::InterpolationMethod::Cubic) const { + Bitmap Rotate(Float ang, const Geometry::Pointf &origin, Containers::InterpolationMethod method = Containers::InterpolationMethod::Cubic) const { ASSERT(data, "Bitmap data is not set"); Bitmap ret;