Tizen 2.4.0 rev3 SDK Public Release
[framework/graphics/dali.git] / dali / public-api / math / vector4.h
index 9383ad4..131037a 100644 (file)
@@ -66,10 +66,10 @@ struct DALI_IMPORT_API Vector4
    * @brief Conversion constructor from four floats.
    *
    * @since_tizen 2.4
-   * @param [in] x (or r/s) component
-   * @param [in] y (or g/t) component
-   * @param [in] z (or b/p) component
-   * @param [in] w (or a/q) component
+   * @param [in] x x or r/s component
+   * @param [in] y y or g/t component
+   * @param [in] z z or b/p component
+   * @param [in] w w or a/q component
    */
   explicit Vector4(float x, float y, float z, float w)
   : x(x),
@@ -84,7 +84,7 @@ struct DALI_IMPORT_API Vector4
    * @brief Conversion constructor from an array of four floats.
    *
    * @since_tizen 2.4
-   * @param [in] array of either xyzw/rgba/stpq
+   * @param [in] array Array of either xyzw/rgba/stpq
    */
   explicit Vector4(const float* array)
   : x(array[0]),
@@ -98,7 +98,7 @@ struct DALI_IMPORT_API Vector4
    * @brief Conversion constructor from Vector2.
    *
    * @since_tizen 2.4
-   * @param [in] vec2 to copy from, z and w are initialized to 0
+   * @param [in] vec2 Vector2 to copy from, z and w are initialized to 0
    */
   explicit Vector4( const Vector2& vec2 );
 
@@ -106,7 +106,7 @@ struct DALI_IMPORT_API Vector4
    * @brief Conversion constructor from Vector3.
    *
    * @since_tizen 2.4
-   * @param [in] vec3 to copy from, w is initialized to 0
+   * @param [in] vec3 to Vector3 copy from, w is initialized to 0
    */
   explicit Vector4( const Vector3& vec3 );
 
@@ -123,8 +123,8 @@ struct DALI_IMPORT_API Vector4
    * @brief Assignment operator.
    *
    * @since_tizen 2.4
-   * @param [in] array of floats
-   * @return itself
+   * @param [in] array Array of floats
+   * @return Itself
    */
   Vector4& operator=(const float* array)
   {
@@ -141,8 +141,8 @@ struct DALI_IMPORT_API Vector4
    *
    * Only sets x and y. z and w are left as they were
    * @since_tizen 2.4
-   * @param [in] vec2 to assign from.
-   * @return itself
+   * @param [in] vec2 A reference to assign from.
+   * @return Itself
    */
   Vector4& operator=(const Vector2& vec2 );
 
@@ -151,8 +151,8 @@ struct DALI_IMPORT_API Vector4
    *
    * Only sets x and y and z. w is left as it was
    * @since_tizen 2.4
-   * @param [in] vec3 to assign from
-   * @return itself
+   * @param [in] vec3 A reference to assign from
+   * @return Itself
    */
   Vector4& operator=(const Vector3& vec3 );
 
@@ -160,7 +160,7 @@ struct DALI_IMPORT_API Vector4
    * @brief Addition operator.
    *
    * @since_tizen 2.4
-   * @param[in] rhs vector to add.
+   * @param[in] rhs Vector to add.
    * @return A vector containing the result of the addition
    */
   Vector4 operator+(const Vector4 & rhs) const
@@ -174,8 +174,8 @@ struct DALI_IMPORT_API Vector4
    * @brief Addition assignment operator.
    *
    * @since_tizen 2.4
-   * @param[in] rhs vector to add.
-   * @return itself
+   * @param[in] rhs Vector to add.
+   * @return Itself
    */
   Vector4& operator+=(const Vector4& rhs)
   {
@@ -191,7 +191,7 @@ struct DALI_IMPORT_API Vector4
    * @brief Subtraction operator.
    *
    * @since_tizen 2.4
-   * @param[in] rhs  the vector to subtract
+   * @param[in] rhs  The vector to subtract
    * @return A vector containing the result of the subtraction
    */
   Vector4 operator-(const Vector4& rhs) const
@@ -207,8 +207,8 @@ struct DALI_IMPORT_API Vector4
    * @brief Subtraction assignment operator.
    *
    * @since_tizen 2.4
-   * @param[in] rhs the vector to subtract
-   * @return itself
+   * @param[in] rhs The vector to subtract
+   * @return Itself
    */
   Vector4& operator-=(const Vector4& rhs)
   {
@@ -224,7 +224,7 @@ struct DALI_IMPORT_API Vector4
    * @brief Multiplication operator.
    *
    * @since_tizen 2.4
-   * @param[in] rhs the vector to multiply
+   * @param[in] rhs The vector to multiply
    * @return A vector containing the result of the multiplication
    */
   Vector4 operator*(const Vector4& rhs) const
@@ -238,7 +238,7 @@ struct DALI_IMPORT_API Vector4
    * @brief Multiplication operator.
    *
    * @since_tizen 2.4
-   * @param[in] rhs the float value to scale the vector
+   * @param[in] rhs The float value to scale the vector
    * @return A vector containing the result of the scaling
    */
   Vector4 operator*(float rhs) const
@@ -250,8 +250,8 @@ struct DALI_IMPORT_API Vector4
    * @brief Multiplication assignment operator.
    *
    * @since_tizen 2.4
-   * @param[in] rhs the vector to multiply
-   * @return itself
+   * @param[in] rhs The vector to multiply
+   * @return Itself
    */
   Vector4& operator*=(const Vector4& rhs)
   {
@@ -267,8 +267,8 @@ struct DALI_IMPORT_API Vector4
    * @brief Multiplication assignment operator.
    *
    * @since_tizen 2.4
-   * @param[in] rhs the float value to scale the vector
-   * @return itself
+   * @param[in] rhs The float value to scale the vector
+   * @return Itself
    */
   Vector4& operator*=(float rhs)
   {
@@ -284,7 +284,7 @@ struct DALI_IMPORT_API Vector4
    * @brief Division operator.
    *
    * @since_tizen 2.4
-   * @param[in] rhs the vector to divide
+   * @param[in] rhs The vector to divide
    * @return A vector containing the result of the division
    */
   Vector4 operator/(const Vector4 & rhs) const
@@ -311,8 +311,8 @@ struct DALI_IMPORT_API Vector4
    * @brief Division assignment operator.
    *
    * @since_tizen 2.4
-   * @param[in] rhs the vector to divide
-   * @return itself
+   * @param[in] rhs The vector to divide
+   * @return Itself
    */
   Vector4& operator/=(const Vector4& rhs)
   {
@@ -328,8 +328,8 @@ struct DALI_IMPORT_API Vector4
    * @brief Division assignment operator.
    *
    * @since_tizen 2.4
-   * @param[in] rhs the float value to scale the vector by
-   * @return itself
+   * @param[in] rhs The float value to scale the vector by
+   * @return Itself
    */
   Vector4& operator/=(float rhs)
   {
@@ -346,7 +346,7 @@ struct DALI_IMPORT_API Vector4
    * @brief Unary negation operator.
    *
    * @since_tizen 2.4
-   * @return the negative value
+   * @return The negative value
    */
   Vector4 operator-() const
   {
@@ -362,7 +362,7 @@ struct DALI_IMPORT_API Vector4
    *
    * @since_tizen 2.4
    * @param[in] rhs The vector to test against
-   * @return true if the vectors are equal
+   * @return True if the vectors are equal
    */
   bool operator==(const Vector4 &rhs) const;
 
@@ -385,7 +385,7 @@ struct DALI_IMPORT_API Vector4
    *
    * Asserts if index is out of range. Should be 0, 1, 2 or 3
    * @since_tizen 2.4
-   * @param[in] index Subscript
+   * @param[in] index Subscript index
    * @return    The float at the given index
    */
   const float& operator[](const unsigned int index) const
@@ -417,8 +417,8 @@ struct DALI_IMPORT_API Vector4
    * This is great for lighting, threshold testing the angle between two unit vectors,
    * calculating the distance between two points in a particular direction.
    * @since_tizen 2.4
-   * @param [in] other     the other vector
-   * @return               the dot product
+   * @param [in] other     The other vector
+   * @return               The dot product
    */
   float Dot(const Vector3& other) const;
 
@@ -429,8 +429,8 @@ struct DALI_IMPORT_API Vector4
    * This is great for lighting, threshold testing the angle between two unit vectors,
    * calculating the distance between two points in a particular direction.
    * @since_tizen 2.4
-   * @param [in] other     the other vector
-   * @return               the dot product
+   * @param [in] other     The other vector
+   * @return               The dot product
    */
   float Dot(const Vector4& other) const;
 
@@ -438,8 +438,8 @@ struct DALI_IMPORT_API Vector4
    * @brief Returns the 4d dot product of this vector and another vector.
    *
    * @since_tizen 2.4
-   * @param [in] other     the other vector
-   * @return          the dot product
+   * @param [in] other     The other vector
+   * @return          The dot product
    */
   float Dot4(const Vector4& other) const;
 
@@ -450,7 +450,7 @@ struct DALI_IMPORT_API Vector4
    * two vectors. This is great for calculating normals and making matrices orthogonal.
    *
    * @since_tizen 2.4
-   * @param [in] other    the other vector
+   * @param [in] other    The other vector
    * @return A vector containing the cross product
    */
   Vector4 Cross(const Vector4& other) const;
@@ -459,7 +459,7 @@ struct DALI_IMPORT_API Vector4
    * @brief Returns the length of the vector.
    *
    * @since_tizen 2.4
-   * @return the length.
+   * @return The length.
    */
   float Length() const;
 
@@ -469,7 +469,7 @@ struct DALI_IMPORT_API Vector4
    * This is faster than using Length() when performing
    * threshold checks as it avoids use of the square root.
    * @since_tizen 2.4
-   * @return the length of the vector squared.
+   * @return The length of the vector squared.
    */
   float LengthSquared() const;
 
@@ -485,36 +485,46 @@ struct DALI_IMPORT_API Vector4
    * @brief Clamps the vector between minimum and maximum vectors.
    *
    * @since_tizen 2.4
-   * @param [in] min the minimum vector
-   * @param [in] max the maximum vector
+   * @param [in] min The minimum vector
+   * @param [in] max The maximum vector
    */
   void Clamp( const Vector4& min, const Vector4& max );
 
   /**
    * @brief Returns the contents of the vector as an array of 4 floats.
    *
+   * @code
+   *
    * The order of the values in this array are as follows:
    * 0: x (or r, or s)
    * 1: y (or g, or t)
    * 2: z (or b, or p)
    * 3: w (or a, or q)
+   *
+   * @endcode
+   *
    * @since_tizen 2.4
-   * @return the vector contents as an array of 4 floats.
-   * @note inlined for performance reasons (generates less code than a function call)
+   * @return The vector contents as an array of 4 floats.
+   * @note Inlined for performance reasons (generates less code than a function call)
    */
   const float* AsFloat() const {return &x;}
 
   /**
    * @brief Returns the contents of the vector as an array of 4 floats.
    *
+   * @code
+   *
    * The order of the values in this array are as follows:
    * 0: x (or r, or s)
    * 1: y (or g, or t)
    * 2: z (or b, or p)
    * 3: w (or a, or q)
+   *
+   * @endcode
+   *
    * @since_tizen 2.4
-   * @return the vector contents as an array of 4 floats.
-   * @note inlined for performance reasons (generates less code than a function call)
+   * @return The vector contents as an array of 4 floats.
+   * @note Inlined for performance reasons (generates less code than a function call)
    */
   float* AsFloat() {return &x;}
 
@@ -566,9 +576,9 @@ DALI_IMPORT_API std::ostream& operator<<(std::ostream& o, const Vector4& vector)
  *
  * If a=0,1,2,3 and b=4,0,1,2  returns a vector of 0,0,1,2
  * @since_tizen 2.4
- * @param [in] a     a vector
- * @param [in] b     a vector
- * @return      a vector containing the minimum of each component from a and b
+ * @param [in] a     A vector
+ * @param [in] b     A vector
+ * @return      A vector containing the minimum of each component from a and b
  */
 inline Vector4 Min( const Vector4& a, const Vector4& b )
 {
@@ -583,9 +593,9 @@ inline Vector4 Min( const Vector4& a, const Vector4& b )
  *
  * If a=0,1,2,3 and b=4,0,1,2  returns a vector of 4,1,2,3
  * @since_tizen 2.4
- * @param [in] a     a vector
- * @param [in] b     a vector
- * @return      a vector containing the maximum of each component from a and b
+ * @param [in] a     A vector
+ * @param [in] b     A vector
+ * @return      A vector containing the maximum of each component from a and b
  */
 inline Vector4 Max( const Vector4& a, const Vector4& b )
 {
@@ -599,10 +609,10 @@ inline Vector4 Max( const Vector4& a, const Vector4& b )
  * @brief Clamps each of vector v's components between minimum and maximum values.
  *
  * @since_tizen 2.4
- * @param [in] v     a vector
- * @param [in] min the minimum value
- * @param [in] max the maximum value
- * @return     a vector containing the clamped components of v
+ * @param [in] v     A vector
+ * @param [in] min The minimum value
+ * @param [in] max The maximum value
+ * @return     A vector containing the clamped components of v
  */
 DALI_IMPORT_API Vector4 Clamp( const Vector4& v, const float& min, const float& max );