e87af5d76a056cbd80f9bd04338c269c7d3125fc
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / visuals / image-visual-properties-devel.h
1 #ifndef DALI_TOOLKIT_DEVEL_API_VISUALS_IMAGE_VISUAL_PROPERTIES_DEVEL_H
2 #define DALI_TOOLKIT_DEVEL_API_VISUALS_IMAGE_VISUAL_PROPERTIES_DEVEL_H
3
4 /*
5  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/visuals/image-visual-properties.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 namespace DevelImageVisual
31 {
32
33 /**
34  * @brief The policy determining if the image is loaded when the visual is staged or created.
35  */
36 namespace LoadPolicy
37 {
38
39 /**
40  * @brief The available named elements that define the LoadPolicy.
41  */
42 enum Type
43 {
44   IMMEDIATE = 0,  ///< The image is loaded when the ImageVisual is created.
45   ATTACHED        ///< The image is loaded when the ImageVisual is attached to the stage.
46 };
47
48 } // namespace LoadPolicy
49
50 /**
51  * @brief The policy determining when a image is deleted from the cache in relation to the ImageVisual lifetime.
52  * @note If the texture is being shared by another visual it persist if still required.
53  */
54 namespace ReleasePolicy
55 {
56
57 /**
58  * @brief The available named elements that define the ReleasePolicy.
59  */
60 enum Type
61 {
62   DETACHED = 0,  ///<  Image deleted from cache when ImageVisual detached from stage.
63   DESTROYED,     ///<  Image deleted from cache when ImageVisual destroyed.
64   NEVER          ///<  Image is never deleted, will survive the lifetime of the application.
65 };
66
67 } // namespace ReleasePolicy;
68
69 namespace Property
70 {
71
72 enum Type
73 {
74   URL                 = Dali::Toolkit::ImageVisual::Property::URL,
75   FITTING_MODE        = Dali::Toolkit::ImageVisual::Property::FITTING_MODE,
76   SAMPLING_MODE       = Dali::Toolkit::ImageVisual::Property::SAMPLING_MODE,
77   DESIRED_WIDTH       = Dali::Toolkit::ImageVisual::Property::DESIRED_WIDTH,
78   DESIRED_HEIGHT      = Dali::Toolkit::ImageVisual::Property::DESIRED_HEIGHT,
79   SYNCHRONOUS_LOADING = Dali::Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING,
80   BORDER_ONLY         = Dali::Toolkit::ImageVisual::Property::BORDER_ONLY,
81   PIXEL_AREA          = Dali::Toolkit::ImageVisual::Property::PIXEL_AREA,
82   WRAP_MODE_U         = Dali::Toolkit::ImageVisual::Property::WRAP_MODE_U,
83   WRAP_MODE_V         = Dali::Toolkit::ImageVisual::Property::WRAP_MODE_V,
84   BORDER              = Dali::Toolkit::ImageVisual::Property::BORDER,
85   ATLASING            = Dali::Toolkit::ImageVisual::Property::ATLASING,
86   ALPHA_MASK_URL      = Dali::Toolkit::ImageVisual::Property::ALPHA_MASK_URL,
87   BATCH_SIZE          = Dali::Toolkit::ImageVisual::Property::BATCH_SIZE,
88   CACHE_SIZE          = Dali::Toolkit::ImageVisual::Property::CACHE_SIZE,
89   FRAME_DELAY         = Dali::Toolkit::ImageVisual::Property::FRAME_DELAY,
90   MASK_CONTENT_SCALE  = Dali::Toolkit::ImageVisual::Property::MASK_CONTENT_SCALE,
91   CROP_TO_MASK        = Dali::Toolkit::ImageVisual::Property::CROP_TO_MASK,
92
93   /**
94    * @brief The policy to determine when an image should be loaded.
95    * @details Name "loadPolicy",  Type LoadPolicy::Type (Property::INTEGER)or Property::STRING.
96    * @note Default LoadPolicy::ATTACHED
97    * @see LoadPolicy::Type
98    */
99   LOAD_POLICY = CROP_TO_MASK + 1,
100
101   /**
102    * @brief The policy to determine when an image should no longer be cached.
103    * @details Name "releasePolicy", Type ReleasePolicy::Type (Property::INTEGER) or Property::STRING
104    * @note Default ReleasePolicy::DESTROYED
105    * @see ReleasePolicy::Type
106    */
107   RELEASE_POLICY = CROP_TO_MASK + 2,
108
109   /**
110    * @brief Determines if image orientation should be corrected so the image displays as it was intended.
111    * @details Name "orientationCorrection", Type Property::BOOLEAN, if true the image's orientation will be corrected.
112    * @note Default true
113    */
114   ORIENTATION_CORRECTION = CROP_TO_MASK + 3,
115
116   /**
117    * @brief Overlays the auxiliary iamge on top of an NPatch image.
118    *
119    * The resulting visual image will be at least as large as the
120    * smallest possible n-patch or the auxiliary image, whichever is
121    * larger.
122    *
123    * @details Name "auxiliaryImage", Type Property::STRING, URL of the image.
124    * @note Default true
125    */
126   AUXILIARY_IMAGE = CROP_TO_MASK + 4,
127
128   /**
129    * @brief An alpha value for mixing between the masked main NPatch image and the auxiliary image
130    * @details Name "auxiliaryImageAlpha", Type Property::FLOAT, between 0 and 1
131    * @note Default 0
132    */
133   AUXILIARY_IMAGE_ALPHA = CROP_TO_MASK + 5,
134
135 };
136
137 } //namespace Property
138
139 } // namespace DevelImageVisual
140
141 } // namespace Toolkit
142
143 } // namespace Dali
144
145 #endif // DALI_TOOLKIT_DEVEL_API_VISUALS_IMAGE_VISUAL_PROPERTIES_DEVEL_H