2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FApp_AppResourceBitmapUtil.h
20 * @brief This is the header file of the _AppResourceBitmapUtil.
23 #ifndef _FAPP_INTERNAL_APP_RESOURCE_BITMAP_UTIL_H_
24 #define _FAPP_INTERNAL_APP_RESOURCE_BITMAP_UTIL_H_
26 #include <FBaseString.h>
28 #include <FGrpBitmap.h>
29 #include <FGrp_BitmapImpl.h>
30 #include <FGrp_CoordinateSystem.h>
32 namespace Tizen { namespace Graphics
38 namespace Tizen { namespace Media
43 namespace Tizen { namespace App
45 class _AppResourceBitmapUtil
46 : public Tizen::Base::Object
62 // This is the default constructor for this class.
64 _AppResourceBitmapUtil(void);
67 * This is the destructor for this class.
69 virtual ~_AppResourceBitmapUtil(void);
71 result Construct(void);
73 result Construct(const Tizen::Base::String& appId);
75 // Generates the directory path from the specified resolution.
76 bool GetDirectoryPath(_Density resourceDirectory, Tizen::Base::String& dirPath) const;
78 bool GetDirectoryPath(_Density resourceDirectory, Tizen::Base::String& dirPath, const Tizen::Base::String& appId) const;
80 // Generates the real path using a pseudo-path and the specified resolution.
81 bool GetFilePath(const Tizen::Base::String& directoryPath, const Tizen::Base::String& fileName, Tizen::Base::String& filePath) const;
83 // The normalized path starts with and is divided by '/'.
84 // ex. L"/Dir1/Dir2/Dir3/File"
85 Tizen::Base::String NormalizePath(const Tizen::Base::String& path) const;
87 // Generates the real path and examine whether the size of the resource is logical or physical by processing the input path.
88 result GetResourcePath(const Tizen::Base::String& fileName, Tizen::Base::String& resourcePath, _Density& resourceDensity, bool& imageScaling) const;
90 // Create Bitmap from real image path
91 Tizen::Graphics::Bitmap* GetBitmapN(const Tizen::Base::String& resourcePath, _Density resourceDensity,
92 Tizen::Graphics::BitmapPixelFormat pixelFormat, bool imageScaling, const Tizen::Graphics::Color* pChromaKeyColor = null) const;
95 static const int DPI_FOR_XHIGH = 290;
96 static const int DPI_FOR_HIGH = 200;
97 static const int DPI_FOR_MIDDLE = 150;
98 static const int DPI_FOR_LOW = 0;
100 Tizen::Graphics::Dimension __physicalResolutionDim;
101 Tizen::Graphics::_BaseScreenSize __physicalBaseScreenSize;
103 // resource directory path for only device's resolution.
104 Tizen::Base::String __resolutionDirectories;
107 * Index information of __sortedDensity & __sortedDensityDirectories.
108 * '0' is for screen density matched device's DPI.
109 * '1', '2', '3' is for screen density with fall back system.
111 _Density __sortedDensity[DENSITY_MAX];
112 Tizen::Base::String __sortedDensityDirectories[DENSITY_MAX];
114 }; // _AppResourceBitmapUtil
118 #endif // _FAPP_INTERNAL_APP_RESOURCE_BITMAP_UTIL_H_