Adding ImageVisual OrientationCorrection 84/157884/1
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Thu, 26 Oct 2017 16:02:05 +0000 (17:02 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Thu, 26 Oct 2017 16:11:21 +0000 (17:11 +0100)
If set true then Image will be rotated in accordance to Image exif data.
Used for JPEG images.

Change-Id: I8afaa8b5dac5e5c5e89326927965da88466d86ad

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

index 62c3f1c..d793ffd 100755 (executable)
@@ -887,7 +887,7 @@ namespace Tizen.NUI
         internal static readonly int IMAGE_VISUAL_CROP_TO_MASK = NDalicPINVOKE.IMAGE_VISUAL_CROP_TO_MASK_get();
         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 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 73ce6d8..59b0309 100755 (executable)
@@ -6570,6 +6570,9 @@ class NDalicPINVOKE {
   [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_LOAD_POLICY_get")]
   public static extern int IMAGE_VISUAL_LOAD_POLICY_get();
 
+  [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_MESH_VISUAL_OBJECT_URL_get")]
   public static extern int MESH_VISUAL_OBJECT_URL_get();
 
index 6b8e184..8a99cb3 100755 (executable)
@@ -871,6 +871,7 @@ namespace Tizen.NUI
         public static readonly int FrameDelay = NDalic.IMAGE_VISUAL_FRAME_DELAY;
         public static readonly int ReleasePolicy = NDalic.IMAGE_VISUAL_RELEASE_POLICY;
         public static readonly int LoadPolicy = NDalic.IMAGE_VISUAL_LOAD_POLICY;
+        public static readonly int OrientationCorrection = NDalic.IMAGE_VISUAL_ORIENTATION_CORRECTION;
     }
 
     /// <summary>
index da6550e..90d1e37 100755 (executable)
@@ -572,6 +572,7 @@ namespace Tizen.NUI
         private bool? _cropToMask = null;
         private ReleasePolicyType? _releasePolicy = null;
         private LoadPolicyType? _loadPolicy = null;
+        private bool? _orientationCorrection = true;
 
         /// <summary>
         /// Get or set the URL of the image.<br>
@@ -846,6 +847,25 @@ namespace Tizen.NUI
             }
         }
 
+        /// <summary>
+        /// Get or set whether to automatically correct the orientation based on exif data.<br>
+        /// If not specified, the default is true.<br>
+        /// For JPEG images only.<br>
+        /// Optional.
+        /// </summary>
+        public bool OrientationCorrection
+        {
+            get
+            {
+                return _orientationCorrection ?? (true);
+            }
+            set
+            {
+                _orientationCorrection = value;
+                UpdateVisual();
+            }
+        }
+
         protected override void ComposingPropertyMap()
         {
             if (_url != null)
@@ -871,6 +891,7 @@ namespace Tizen.NUI
                 if (_cropToMask != null) { _outputVisualMap.Add((int)ImageVisualProperty.CropToMask, new PropertyValue((bool)_cropToMask)); }
                 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)); }
             }
         }
     }