* For transformation added Point and Bounds MirrorX/Y 4.x-dev

Mon, 12 Jul 2021 17:40:10 +0300

author
dogukangulyasar
date
Mon, 12 Jul 2021 17:40:10 +0300
branch
4.x-dev
changeset 1711
847f51ca989f
parent 1709
8c097aad12ae
child 1712
b22cbfdcae87

* For transformation added Point and Bounds MirrorX/Y

Source/Gorgon/Geometry/Bounds.h file | annotate | diff | comparison | revisions
Source/Gorgon/Geometry/Point.h file | annotate | diff | comparison | revisions
Source/Gorgon/Graphics/Bitmap.h file | annotate | diff | comparison | revisions
--- 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;

mercurial