[NUI] Added NPatch visual properties for auxiliary image 99/162399/3
authorDavid Steele <david.steele@samsung.com>
Thu, 30 Nov 2017 18:14:42 +0000 (18:14 +0000)
committerxb.teng <xb.teng@samsung.com>
Tue, 5 Dec 2017 07:28:44 +0000 (15:28 +0800)
Change-Id: Ie7bfc825c9ff4f34983c2540f2920b2819d8634a

src/Tizen.NUI/src/internal/NDalic.cs
src/Tizen.NUI/src/internal/NDalicPINVOKE.cs
src/Tizen.NUI/src/public/NUIConstants.cs
src/Tizen.NUI/src/public/VisualMaps.cs

index 1b62c0a..25e5c57 100755 (executable)
@@ -889,6 +889,8 @@ namespace Tizen.NUI
         internal static readonly int IMAGE_VISUAL_RELEASE_POLICY = NDalicPINVOKE.IMAGE_VISUAL_RELEASE_POLICY_get();
         internal static readonly int IMAGE_VISUAL_LOAD_POLICY = NDalicPINVOKE.IMAGE_VISUAL_LOAD_POLICY_get();
         internal static readonly int IMAGE_VISUAL_ORIENTATION_CORRECTION = NDalicPINVOKE.IMAGE_VISUAL_ORIENTATION_CORRECTION_get();
+        internal static readonly int IMAGE_VISUAL_AUXILIARY_IMAGE_URL = NDalicPINVOKE.IMAGE_VISUAL_AUXILIARY_IMAGE_URL_get();
+        internal static readonly int IMAGE_VISUAL_AUXILIARY_IMAGE_ALPHA = NDalicPINVOKE.IMAGE_VISUAL_AUXILIARY_IMAGE_ALPHA_get();
         internal static readonly int MESH_VISUAL_OBJECT_URL = NDalicPINVOKE.MESH_VISUAL_OBJECT_URL_get();
         internal static readonly int MESH_VISUAL_MATERIAL_URL = NDalicPINVOKE.MESH_VISUAL_MATERIAL_URL_get();
         internal static readonly int MESH_VISUAL_TEXTURES_PATH = NDalicPINVOKE.MESH_VISUAL_TEXTURES_PATH_get();
index 61cb7ba..560092a 100755 (executable)
@@ -6640,6 +6640,12 @@ class NDalicPINVOKE {
   [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint ="CSharp_Dali_IMAGE_VISUAL_ORIENTATION_CORRECTION_get")]
   public static extern int IMAGE_VISUAL_ORIENTATION_CORRECTION_get();
 
+  [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint ="CSharp_Dali_IMAGE_VISUAL_AUXILIARY_IMAGE_URL_get")]
+  public static extern int IMAGE_VISUAL_AUXILIARY_IMAGE_URL_get();
+
+  [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint ="CSharp_Dali_IMAGE_VISUAL_AUXILIARY_IMAGE_ALPHA_get")]
+  public static extern int IMAGE_VISUAL_AUXILIARY_IMAGE_ALPHA_get();
+
   [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_MESH_VISUAL_OBJECT_URL_get")]
   public static extern int MESH_VISUAL_OBJECT_URL_get();
 
index edf0883..90375d7 100755 (executable)
@@ -1270,6 +1270,16 @@ namespace Tizen.NUI
         /// </summary>
         /// <since_tizen> 5 </since_tizen>
         public static readonly int OrientationCorrection = NDalic.IMAGE_VISUAL_ORIENTATION_CORRECTION;
+        /// <summary>
+        /// Overlays the auxiliary image on top of an NPatch image.
+        /// </summary>
+        /// <since_tizen> 5 </since_tizen>
+        public static readonly int AuxiliaryImageURL = NDalic.IMAGE_VISUAL_AUXILIARY_IMAGE_URL;
+        /// <summary>
+        /// Alpha value for the auxiliary image, without affecting the underlying NPatch image
+        /// </summary>
+        /// <since_tizen> 5 </since_tizen>
+        public static readonly int AuxiliaryImageAlpha = NDalic.IMAGE_VISUAL_AUXILIARY_IMAGE_ALPHA;
     }
 
     /// <summary>
index 2368c55..4dc5420 100755 (executable)
@@ -624,6 +624,7 @@ namespace Tizen.NUI
 
         private string _url = null;
         private string _alphaMaskUrl = null;
+        private string _auxiliaryImageUrl = null;
         private FittingModeType? _fittingMode = null;
         private SamplingModeType? _samplingMode = null;
         private int? _desiredWidth = null;
@@ -633,6 +634,7 @@ namespace Tizen.NUI
         private Vector4 _pixelArea = null;
         private WrapModeType? _wrapModeU = null;
         private WrapModeType? _wrapModeV = null;
+        private float? _auxiliaryImageAlpha = null;
         private float? _maskContentScale = null;
         private bool? _cropToMask = null;
         private ReleasePolicyType? _releasePolicy = null;
@@ -677,6 +679,24 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Overlays the auxiliary iamge on top of an NPatch image.
+        /// The resulting visual image will be at least as large as the smallest possible n-patch or the auxiliary image, whichever is larger.
+        /// </summary>
+        /// <since_tizen> 5 </since_tizen>
+        public string AuxiliaryImageURL
+        {
+            get
+            {
+                return _auxiliaryImageUrl;
+            }
+            set
+            {
+                _auxiliaryImageUrl = value;
+                UpdateVisual();
+            }
+        }
+
+        /// <summary>
         /// Gets or sets fitting options used when resizing images to fit the desired dimensions.<br />
         /// If not supplied, the default is FittingModeType.ShrinkToFit.<br />
         /// For normal quad images only.<br />
@@ -895,6 +915,22 @@ namespace Tizen.NUI
             }
         }
 
+        /// <summary>
+        ///  An alpha value for mixing between the masked main NPatch image and the auxiliary image.
+        /// </summary>
+        /// <since_tizen> 5 </since_tizen>
+        public float AuxiliaryImageAlpha
+        {
+            get
+            {
+                return _auxiliaryImageAlpha ?? 1.0f;
+            }
+            set
+            {
+                _auxiliaryImageAlpha = value;
+                UpdateVisual();
+            }
+        }
 
         /// <summary>
         /// Get or set the Image Visual release policy<br />
@@ -966,6 +1002,7 @@ namespace Tizen.NUI
                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
                 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
                 if (_alphaMaskUrl != null ) { _outputVisualMap.Add(ImageVisualProperty.AlphaMaskURL, new PropertyValue(_alphaMaskUrl)); }
+                if (_auxiliaryImageUrl != null ) { _outputVisualMap.Add(ImageVisualProperty.AuxiliaryImageURL, new PropertyValue(_auxiliaryImageUrl)); }
                 if (_fittingMode != null) { _outputVisualMap.Add(ImageVisualProperty.FittingMode, new PropertyValue((int)_fittingMode)); }
                 if (_samplingMode != null) { _outputVisualMap.Add(ImageVisualProperty.SamplingMode, new PropertyValue((int)_samplingMode)); }
                 if (_desiredWidth != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredWidth, new PropertyValue((int)_desiredWidth)); }
@@ -981,6 +1018,7 @@ namespace Tizen.NUI
                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
                 if (_maskContentScale != null) { _outputVisualMap.Add((int)ImageVisualProperty.MaskContentScale, new PropertyValue((float)_maskContentScale)); }
                 if (_cropToMask != null) { _outputVisualMap.Add((int)ImageVisualProperty.CropToMask, new PropertyValue((bool)_cropToMask)); }
+                if (_auxiliaryImageAlpha != null) { _outputVisualMap.Add((int)ImageVisualProperty.AuxiliaryImageAlpha, new PropertyValue((float)_auxiliaryImageAlpha)); }
                 if (_releasePolicy != null) { _outputVisualMap.Add( ImageVisualProperty.ReleasePolicy , new PropertyValue((int)_releasePolicy)); }
                 if (_loadPolicy != null) { _outputVisualMap.Add( ImageVisualProperty.LoadPolicy, new PropertyValue((int)_loadPolicy)); }
                 if (_orientationCorrection != null) { _outputVisualMap.Add( ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)_orientationCorrection)); }