2 * Copyright(c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 using System.ComponentModel;
23 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
24 [EditorBrowsable(EditorBrowsableState.Never)]
25 public class Matrix3 : Disposable
27 internal Matrix3(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
31 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
33 Interop.Matrix.DeleteMatrix3(swigCPtr);
36 public static Matrix3 IDENTITY
40 global::System.IntPtr cPtr = Interop.Matrix.Matrix3IdentityGet();
41 Matrix3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Matrix3(cPtr, false);
42 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
47 public Matrix3() : this(Interop.Matrix.NewMatrix3(), true)
49 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
52 public Matrix3(Matrix3 m) : this(Interop.Matrix.NewMatrix3(Matrix3.getCPtr(m)), true)
54 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
57 public Matrix3(Matrix m) : this(Interop.Matrix.NewMatrix3Matrix(Matrix.getCPtr(m)), true)
59 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
62 public Matrix3(float s00, float s01, float s02, float s10, float s11, float s12, float s20, float s21, float s22) : this(Interop.Matrix.NewMatrix3(s00, s01, s02, s10, s11, s12, s20, s21, s22), true)
64 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
67 public Matrix3 Assign(Matrix3 matrix)
69 Matrix3 ret = new Matrix3(Interop.Matrix.Matrix3Assign(SwigCPtr, Matrix3.getCPtr(matrix)), false);
70 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
74 public Matrix3 Assign(Matrix matrix)
76 Matrix3 ret = new Matrix3(Interop.Matrix.Matrix3AssignMatrix(SwigCPtr, Matrix.getCPtr(matrix)), false);
77 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
81 public float this[uint index]
85 SetValueAtIndex(index, value);
89 return ValueOfIndex(index);
93 public static Vector3 operator *(Matrix3 arg1, Vector3 arg2)
95 return arg1?.Multiply(arg2);
98 public static Matrix3 operator *(Matrix3 arg1, Matrix3 arg2)
100 return arg1?.Multiply(arg2);
103 public override int GetHashCode()
105 return SwigCPtr.Handle.GetHashCode();
108 public bool EqualTo(Matrix3 rhs)
110 bool ret = Interop.Matrix.Matrix3EqualTo(SwigCPtr, Matrix3.getCPtr(rhs));
111 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115 public bool NotEqualTo(Matrix3 rhs)
117 bool ret = Interop.Matrix.Matrix3NotEqualTo(SwigCPtr, Matrix3.getCPtr(rhs));
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
122 public void SetIdentity()
124 Interop.Matrix.Matrix3SetIdentity(SwigCPtr);
125 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
130 bool ret = Interop.Matrix.Matrix3Invert(SwigCPtr);
131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 public bool Transpose()
137 bool ret = Interop.Matrix.Matrix3Transpose(SwigCPtr);
138 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
142 public void Scale(float scale)
144 Interop.Matrix.Matrix3Scale(SwigCPtr, scale);
145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
148 public float Magnitude()
150 float ret = Interop.Matrix.Matrix3Magnitude(SwigCPtr);
151 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155 public bool ScaledInverseTranspose()
157 bool ret = Interop.Matrix.Matrix3ScaledInverseTranspose(SwigCPtr);
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 public static void Multiply(Matrix3 result, Matrix3 lhs, Matrix3 rhs)
164 Interop.Matrix.Matrix3Multiply(Matrix3.getCPtr(result), Matrix3.getCPtr(lhs), Matrix3.getCPtr(rhs));
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 public Vector3 Multiply(Vector3 rhs)
170 Vector3 ret = new Vector3(Interop.Matrix.Matrix3MultiplyVector3(SwigCPtr, Vector3.getCPtr(rhs)), true);
171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175 public Matrix3 Multiply(Matrix3 rhs)
177 Matrix3 ret = new Matrix3(Interop.Matrix.Matrix3Multiply(SwigCPtr, Matrix3.getCPtr(rhs)), true);
178 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182 public void MultiplyAssign(Matrix3 rhs)
184 Interop.Matrix.Matrix3MultiplyAssign(SwigCPtr, Matrix3.getCPtr(rhs));
185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188 public float ValueOfIndex(uint index)
190 float ret = Interop.Matrix.Matrix3ValueOfIndex(SwigCPtr, index);
191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 public float ValueOfIndex(uint indexRow, uint indexColumn)
197 float ret = Interop.Matrix.Matrix3ValueOfIndex(SwigCPtr, indexRow, indexColumn);
198 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
202 public void SetValueAtIndex(uint index, float val)
204 Interop.Matrix.Matrix3SetValueAtIndex(SwigCPtr, index, val);
205 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208 public void SetValueAtIndex(uint indexRow, uint indexColumn, float val)
210 Interop.Matrix.Matrix3SetValueAtIndex(SwigCPtr, indexRow, indexColumn, val);
211 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();