[NUI] Revert "Sync with dalihub & API5 branch (#631)" (#635)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / PixelBuffer.cs
index 5c922f1..79d977a 100755 (executable)
@@ -1,18 +1,19 @@
-/** Copyright (c) 2017 Samsung Electronics Co., Ltd.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+/*
+ * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 using System.ComponentModel;
 
 namespace Tizen.NUI
@@ -20,18 +21,18 @@ namespace Tizen.NUI
 
     /// <summary>
     /// The PixelBuffer object holds a pixel buffer.
-    /// The PixelBuffer keeps ownership of it's initial buffer however, the
-    /// user is free to modify the pixel data, either directly, or via image operations.
+    /// The PixelBuffer keeps ownership of its initial buffer. However, the
+    /// user is free to modify the pixel data, either directly or via image operations.
     ///
-    /// In order to upload the pixel data to texture memory, there are two
-    /// possibilities - either convert it back to a PixelData object, which
+    /// In order to upload the pixel data to the texture memory, there are two
+    /// possibilities, either convert it back to a PixelData object, which
     /// releases the PixelBuffer object, leaving the user with an empty handle
-    /// (ideal for one-time indirect image manipulation), or create a new
+    /// (ideal for one-time indirect image manipulation) or create a new
     /// PixelData object from this object, leaving the buffer intact (ideal
-    /// for continuous manipulation)
+    /// for continuous manipulation).
     /// </summary>
     /// <since_tizen> 5 </since_tizen>
-    /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+    /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
     [EditorBrowsable(EditorBrowsableState.Never)]
     public class PixelBuffer : BaseHandle
     {
@@ -60,7 +61,7 @@ namespace Tizen.NUI
 
             if (type == DisposeTypes.Explicit)
             {
-                //Called by User
+                //Called by User.
                 //Release your own managed resources here.
                 //You should release all of your own disposable objects here.
 
@@ -68,7 +69,7 @@ namespace Tizen.NUI
 
             //Release your own unmanaged resources here.
             //You should not access any managed member here except static instance.
-            //because the execution order of Finalizes is non-deterministic.
+            //Because the execution order of Finalizes is non-deterministic.
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
@@ -83,13 +84,13 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Create a PixelBuffer with it's own data buffer.
+        /// Create a PixelBuffer with its own data buffer.
         /// </summary>
-        /// <param name="width">The pixel buffer width</param>
-        /// <param name="height">The pixel buffer height</param>
-        /// <param name="pixelFormat">The pixel format</param>
+        /// <param name="width">The pixel buffer width.</param>
+        /// <param name="height">The pixel buffer height.</param>
+        /// <param name="pixelFormat">The pixel format.</param>
         /// <since_tizen> 5 </since_tizen>
-        /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+        /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public PixelBuffer(uint width, uint height, PixelFormat pixelFormat) : this(NDalicPINVOKE.PixelBuffer_New(width, height, (int)pixelFormat), true)
         {
@@ -109,15 +110,15 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Convert to a pixel data and release the pixelBuffer's object.
+        /// Convert to a pixel data and release the object of the pixelBuffer.
         /// This handle is left empty.
         /// Any other handles that keep a reference to this object
-        /// will be left with no buffer, trying to access it will return NULL.
+        /// will be left with no buffer. Trying to access it will return NULL.
         /// </summary>
-        /// <param name="pixelBuffer">A pixel buffer</param>
-        /// <returns>A new PixelData which takes ownership of the PixelBuffer's buffer.</returns>
+        /// <param name="pixelBuffer">A pixel buffer.</param>
+        /// <returns>A new PixelData that takes ownership of the buffer of the pixelBuffer.</returns>
         /// <since_tizen> 5 </since_tizen>
-        /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+        /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static PixelData Convert(PixelBuffer pixelBuffer)
         {
@@ -132,7 +133,7 @@ namespace Tizen.NUI
         /// </summary>
         /// <returns>The pixel data.</returns>
         /// <since_tizen> 5 </since_tizen>
-        /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+        /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public PixelData CreatePixelData()
         {
@@ -154,7 +155,7 @@ namespace Tizen.NUI
         /// </summary>
         /// <returns>The width of the buffer in pixels.</returns>
         /// <since_tizen> 5 </since_tizen>
-        /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+        /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public uint GetWidth()
         {
@@ -168,7 +169,7 @@ namespace Tizen.NUI
         /// </summary>
         /// <returns>The height of the buffer in pixels.</returns>
         /// <since_tizen> 5 </since_tizen>
-        /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+        /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public uint GetHeight()
         {
@@ -182,7 +183,7 @@ namespace Tizen.NUI
         /// </summary>
         /// <returns>The pixel format.</returns>
         /// <since_tizen> 5 </since_tizen>
-        /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+        /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public PixelFormat GetPixelFormat()
         {
@@ -192,21 +193,21 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Apply the mask to this pixel data, and return a new pixel data containing
-        /// the masked image. If this PixelBuffer doesn't have an alpha channel, then
+        /// Apply the mask to this pixel data and return a new pixel data that contains
+        /// the masked image. If this PixelBuffer does not have an alpha channel, then
         /// the resultant PixelBuffer will be converted to a format that supports at
         /// least the width of the color channels and the alpha channel from the mask.
         ///
-        /// If cropToMask is set to true, then the contentScale is applied first to
+        /// If cropToMask is set to <c>true</c>, then the contentScale is applied first to
         /// this buffer, and the target buffer is cropped to the size of the mask. If
-        /// it's set to false, then the mask is scaled to match this buffer's size
+        /// it is set to <c>false</c>, then the mask is scaled to match the size of this buffer
         /// before the mask is applied.
         /// </summary>
         /// <param name="mask">The mask to apply.</param>
         /// <param name="contentScale">The scaling factor to apply to the content.</param>
         /// <param name="cropToMask">Whether to crop the output to the mask size (true) or scale the mask to the content size (false).</param>
         /// <since_tizen> 5 </since_tizen>
-        /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+        /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public void ApplyMask(PixelBuffer mask, float contentScale, bool cropToMask)
         {
@@ -215,20 +216,20 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Apply the mask to this pixel data, and return a new pixel data containing
-        /// the masked image. If this PixelBuffer doesn't have an alpha channel, then
+        /// Apply the mask to this pixel data and return a new pixel data containing
+        /// the masked image. If this PixelBuffer does not have an alpha channel, then
         /// the resultant PixelBuffer will be converted to a format that supports at
         /// least the width of the color channels and the alpha channel from the mask.
         ///
-        /// If cropToMask is set to true, then the contentScale is applied first to
+        /// If cropToMask is set to <c>true</c>, then the contentScale is applied first to
         /// this buffer, and the target buffer is cropped to the size of the mask. If
-        /// it's set to false, then the mask is scaled to match this buffer's size
+        /// it is set to <c>false</c>, then the mask is scaled to match the size of this buffer
         /// before the mask is applied.
         /// </summary>
         /// <param name="mask">The mask to apply.</param>
         /// <param name="contentScale">The scaling factor to apply to the content.</param>
         /// <since_tizen> 5 </since_tizen>
-        /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+        /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public void ApplyMask(PixelBuffer mask, float contentScale)
         {
@@ -237,19 +238,19 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Apply the mask to this pixel data, and return a new pixel data containing
-        /// the masked image. If this PixelBuffer doesn't have an alpha channel, then
+        /// Apply the mask to this pixel data and return a new pixel data containing
+        /// the masked image. If this PixelBuffer does not have an alpha channel, then
         /// the resultant PixelBuffer will be converted to a format that supports at
         /// least the width of the color channels and the alpha channel from the mask.
         ///
-        /// If cropToMask is set to true, then the contentScale is applied first to
+        /// If cropToMask is set to <c>true</c>, then the contentScale is applied first to
         /// this buffer, and the target buffer is cropped to the size of the mask. If
-        /// it's set to false, then the mask is scaled to match this buffer's size
+        /// it is set to <c>false</c>, then the mask is scaled to match the size of this buffer
         /// before the mask is applied.
         /// </summary>
         /// <param name="mask">The mask to apply.</param>
         /// <since_tizen> 5 </since_tizen>
-        /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+        /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public void ApplyMask(PixelBuffer mask)
         {
@@ -263,7 +264,7 @@ namespace Tizen.NUI
         /// </summary>
         /// <param name="blurRadius">The radius for Gaussian blur. A value of 0 or negative value indicates no blur.</param>
         /// <since_tizen> 5 </since_tizen>
-        /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+        /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public void ApplyGaussianBlur(float blurRadius)
         {
@@ -279,7 +280,7 @@ namespace Tizen.NUI
         /// <param name="width">The crop width.</param>
         /// <param name="height">The crop height.</param>
         /// <since_tizen> 5 </since_tizen>
-        /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+        /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public void Crop(ushort x, ushort y, ushort width, ushort height)
         {
@@ -293,7 +294,7 @@ namespace Tizen.NUI
         /// <param name="width">The new width.</param>
         /// <param name="height">The new height.</param>
         /// <since_tizen> 5 </since_tizen>
-        /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+        /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public void Resize(ushort width, ushort height)
         {
@@ -301,11 +302,6 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        internal PixelBuffer(SWIGTYPE_p_unsigned_char pointer) : this(NDalicPINVOKE.new_PixelBuffer__SWIG_2(SWIGTYPE_p_unsigned_char.getCPtr(pointer)), true)
-        {
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
-
     }
 
 }