internal static readonly int IMAGE_VISUAL_FRAME_DELAY = NDalicPINVOKE.IMAGE_VISUAL_FRAME_DELAY_get();
internal static readonly int IMAGE_VISUAL_MASK_CONTENT_SCALE = NDalicPINVOKE.IMAGE_VISUAL_MASK_CONTENT_SCALE_get();
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 MESH_VISUAL_OBJECT_URL = NDalicPINVOKE.MESH_VISUAL_OBJECT_URL_get();
internal static readonly int MESH_VISUAL_MATERIAL_URL = NDalicPINVOKE.MESH_VISUAL_MATERIAL_URL_get();
[global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_CROP_TO_MASK_get")]
public static extern int IMAGE_VISUAL_CROP_TO_MASK_get();
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_RELEASE_POLICY_get")]
+ public static extern int IMAGE_VISUAL_RELEASE_POLICY_get();
+
+ [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_MESH_VISUAL_OBJECT_URL_get")]
public static extern int MESH_VISUAL_OBJECT_URL_get();
}
/// <summary>
+ /// Specifies the Release Policy types <br>
+ /// Decides if the image should be cached in different conditions
+ /// </summary>
+ public enum ReleasePolicyType
+ {
+ /// <summary>
+ /// Image is released when visual detached from scene
+ /// </summary>
+ Detached = 0,
+ /// <summary>
+ /// Image is only released when visual is destroyed
+ /// </summary>
+ Destroyed,
+ /// <summary>
+ /// Image is not released.
+ /// </summary>
+ Never
+ }
+
+ /// <summary>
+ /// Specifies the Load Policy types <br>
+ /// Decides when the image texture should be loaded
+ /// </summary>
+ public enum LoadPolicyType
+ {
+ /// <summary>
+ /// Load texture once the image source has been provided. Even if not being used yet.
+ /// </summary>
+ Immediate = 0,
+ /// <summary>
+ /// Only load texture once the visual is attached, when the image needs to be shown.
+ /// </summary>
+ Attached
+ }
+
+ /// <summary>
/// The type of coordinate system for certain attributes of the points in a gradient.
/// </summary>
public enum GradientVisualUnitsType
public static readonly int BatchSize = NDalic.IMAGE_VISUAL_BATCH_SIZE;
public static readonly int CacheSize = NDalic.IMAGE_VISUAL_CACHE_SIZE;
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;
}
/// <summary>
private WrapModeType? _wrapModeV = null;
private float? _maskContentScale = null;
private bool? _cropToMask = null;
+ private ReleasePolicyType? _releasePolicy = null;
+ private LoadPolicyType? _loadPolicy = null;
/// <summary>
/// Get or set the URL of the image.<br>
}
}
+ /// <summary>
+ /// Get or set the Image Visual release policy<br>
+ /// It decides if a texture should be released from the cache or kept to reduce loading time <br>
+ /// </summary>
+ public ReleasePolicyType ReleasePolicy
+ {
+ get
+ {
+ return _releasePolicy ?? (ReleasePolicyType.Destroyed );
+ }
+ set
+ {
+ _releasePolicy = value;
+ UpdateVisual();
+ }
+ }
+
+
+ /// <summary>
+ /// Get or set the Image Visual image loading policy<br>
+ /// It decides if a texture should be loaded immediately after source set or only after visual is added to window <br>
+ /// </summary>
+ public LoadPolicyType LoadPolicy
+ {
+ get
+ {
+ return _loadPolicy ?? (LoadPolicyType.Attached);
+ }
+ set
+ {
+ _loadPolicy = value;
+ UpdateVisual();
+ }
+ }
+
protected override void ComposingPropertyMap()
{
if (_url != null)
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 (_releasePolicy != null) { _outputVisualMap.Add( ImageVisualProperty.ReleasePolicy , new PropertyValue((int)_releasePolicy)); }
+ if (_loadPolicy != null) { _outputVisualMap.Add( ImageVisualProperty.LoadPolicy, new PropertyValue((int)_loadPolicy)); }
}
}
}