1 #ifndef __DALI_TIZEN_PLATFORM_IMAGE_LOADER_H__
2 #define __DALI_TIZEN_PLATFORM_IMAGE_LOADER_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 #include <dali/public-api/images/image-operations.h>
22 #include <dali/integration-api/resource-cache.h>
23 #include <dali/integration-api/resource-types.h>
24 #include <dali/integration-api/bitmap.h>
27 #include "resource-loading-client.h"
31 namespace TizenPlatform
36 * Convert a file stream into a bitmap.
37 * @param[in] resourceType The type of resource to convert.
38 * @param[in] path The path to the resource.
39 * @param[in] fp File Pointer. Closed on exit.
40 * @param[in] client The component that is initiating the conversion.
41 * @param[out] bitmap Pointer to write bitmap to
42 * @return true on success, false on failure
44 bool ConvertStreamToBitmap( const Integration::ResourceType& resourceType, std::string path, FILE * const fp, const ResourceLoadingClient& client, Integration::BitmapPtr& ptr);
47 * Convert a bitmap and write to a file stream.
48 * @param[in] path The path to the resource.
49 * @param[in] fp File Pointer. Closed on exit.
50 * @param[out] bitmap Pointer from which to read bitmap
51 * @return true on success, false on failure
53 bool ConvertBitmapToStream( std::string path, FILE * const fp, Integration::BitmapPtr& ptr );
56 Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath );
58 ImageDimensions GetClosestImageSize( const std::string& filename,
60 FittingMode::Type fittingMode,
61 SamplingMode::Type samplingMode,
62 bool orientationCorrection );
64 ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
66 FittingMode::Type fittingMode,
67 SamplingMode::Type samplingMode,
68 bool orientationCorrection );
74 #endif // __DALI_TIZEN_PLATFORM_IMAGE_LOADER_H__