053245119f04027a79f6b43c0a0aad7825b8587b
[platform/core/uifw/dali-core.git] / dali / integration-api / resource-types.h
1 #ifndef DALI_INTEGRATION_RESOURCE_TYPES_H
2 #define DALI_INTEGRATION_RESOURCE_TYPES_H
3
4 /*
5  * Copyright (c) 2019 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 #include <stdint.h>
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/images/image-operations.h>
26 #include <dali/public-api/math/uint-16-pair.h>
27
28 namespace Dali
29 {
30
31 typedef Uint16Pair ImageDimensions;
32
33 namespace Integration
34 {
35
36 /**
37  * BitmapResourceType describes a bitmap resource.
38  */
39 struct BitmapResourceType
40 {
41   /**
42    * Constructor.
43    * @param[in] size The requested size for the bitmap.
44    * @param[in] scalingMode The method to use to map the source bitmap to the desired
45    * dimensions.
46    * @param[in] samplingMode The filter to use if the bitmap needs to be downsampled
47    * to the requested size.
48    * @param[in] orientationCorrection Whether to use bitmap metadata to rotate or
49    * flip the bitmap, e.g., from portrait to landscape.
50    */
51   BitmapResourceType( ImageDimensions size = ImageDimensions( 0, 0 ),
52                       FittingMode::Type scalingMode = FittingMode::DEFAULT,
53                       SamplingMode::Type samplingMode = SamplingMode::DEFAULT,
54                       bool orientationCorrection = true )
55   : size( size ),
56     scalingMode( scalingMode ),
57     samplingMode( samplingMode ),
58     orientationCorrection( orientationCorrection )
59   {}
60
61   /**
62    * Destructor.
63    */
64   ~BitmapResourceType()
65   {}
66
67   /**
68    * Attributes are copied from the request.
69    */
70   ImageDimensions size;
71   FittingMode::Type scalingMode;
72   SamplingMode::Type samplingMode;
73   bool orientationCorrection;
74
75 private:
76
77   // Undefined copy constructor.
78   BitmapResourceType(const BitmapResourceType& typePath);
79
80   // Undefined assignment operator.
81   BitmapResourceType& operator=(const BitmapResourceType& rhs);
82
83 };
84
85 } // namespace Integration
86
87 } // namespace Dali
88
89 #endif // DALI_INTEGRATION_RESOURCE_TYPES_H