[3.0] Add missed doxygen documentation
[platform/core/uifw/dali-core.git] / dali / public-api / images / image-operations.h
1 #ifndef __DALI_IMAGE_OPERATIONS_H__
2 #define __DALI_IMAGE_OPERATIONS_H__
3
4 /*
5  * Copyright (c) 2015 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 // EXTERNAL INCLUDES
22
23 // INTERNAL INCLUDES
24 #include <dali/public-api/math/uint-16-pair.h>
25
26 namespace Dali
27 {
28 /**
29  * @addtogroup dali_core_images
30  * @{
31  */
32
33 /**
34  * @brief The integer dimensions of an image or a region of an image packed into
35  *        16 bits per component.
36  *
37  * This can only be used for images of up to 65535 x 65535 pixels.
38  * @SINCE_1_0.0
39  */
40 typedef Dali::Uint16Pair ImageDimensions;
41
42 /**
43  * @brief Fitting options, used when resizing images to fit desired dimensions.
44  *
45  * A fitting mode controls the region of a loaded image to be mapped to the
46  * desired image rectangle.
47  * All fitting modes preserve the aspect ratio of the image contents.
48  * @SINCE_1_0.0
49  */
50 namespace FittingMode
51 {
52   /**
53    * @brief The type of FittingMode
54    * @SINCE_1_0.0
55    */
56   enum Type
57   {
58     SHRINK_TO_FIT, ///< Fit full image inside desired width & height, potentially not @SINCE_1_0.0
59                    ///  filling one of either the desired image width or height with
60                    ///  pixels.
61     SCALE_TO_FILL, ///< Image fills whole desired width & height with image data. The @SINCE_1_0.0
62                    ///  image is centred in the desired dimensions, exactly touching
63                    ///  in one dimension, with image regions outside the other desired
64                    ///  dimension cropped away.
65     FIT_WIDTH,     ///< Image fills whole width. Height is scaled proportionately to @SINCE_1_0.0
66                    ///  maintain aspect ratio.
67     FIT_HEIGHT     ///< Image fills whole height. Width is scaled proportionately to @SINCE_1_0.0
68                    ///  maintain aspect ratio.
69   };
70   const Type DEFAULT = SHRINK_TO_FIT;
71 }
72
73 /**
74  * @brief Filtering options, used when resizing images to sample original pixels.
75  *
76  * A SamplingMode controls how pixels in an input image are sampled and
77  * combined to generate each pixel of a destination image during a scaling.
78  *
79  * NoFilter and Box modes do not guarantee that the output pixel array
80  * exactly matches the rectangle specified by the desired dimensions and
81  * FittingMode, but all other filter modes do if the desired dimensions are
82  * `<=` the raw dimensions of the input image file.
83  * @SINCE_1_0.0
84  */
85 namespace SamplingMode
86 {
87   /**
88    * @brief The type of SamplingMode
89    * @SINCE_1_0.0
90    */
91   enum Type
92   {
93     BOX,              ///< Iteratively box filter to generate an image of 1/2, 1/4, @SINCE_1_0.0
94                       ///  1/8, etc width and height and approximately the desired
95                       ///  size. This is the default.
96     NEAREST,          ///< For each output pixel, read one input pixel. @SINCE_1_0.0
97     LINEAR,           ///< For each output pixel, read a quad of four input pixels @SINCE_1_0.0
98                       ///  and write a weighted average of them.
99     BOX_THEN_NEAREST, ///< Iteratively box filter to generate an image of 1/2, 1/4, @SINCE_1_0.0
100                       ///  1/8 etc width and height and approximately the desired
101                       ///  size, then for each output pixel, read one pixel from the
102                       ///  last level of box filtering.
103     BOX_THEN_LINEAR,  ///< Iteratively box filter to almost the right size, then for @SINCE_1_0.0
104                       ///  each output pixel, read four pixels from the last level of
105                       ///  box filtering and write their weighted average.
106     NO_FILTER,        ///< No filtering is performed. If the SCALE_TO_FILL scaling mode @SINCE_1_0.0
107                       ///  is enabled, the borders of the image may be trimmed to
108                       ///  match the aspect ratio of the desired dimensions.
109     DONT_CARE         ///< For caching algorithms where a client strongly prefers a @SINCE_1_0.0
110                       ///  cache-hit to reuse a cached image.
111   };
112   const Type DEFAULT = BOX;
113 }
114
115 /**
116  * @}
117  */
118 } // namespace Dali
119
120 #endif // __DALI_IMAGE_OPERATIONS_H__