X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=platform-abstractions%2Ftizen%2Fimage-loaders%2Fimage-loader.h;h=d619a305c832b875375b75619619e9d284c49a02;hb=7da91338489ff54813539c8abca8d93afc3e94a6;hp=ea7b3a558c60d4a0f01558865b604dcb472a4b09;hpb=e54d4d1af5dfd8eeaa591f177367cff25cfeb8b2;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/platform-abstractions/tizen/image-loaders/image-loader.h b/platform-abstractions/tizen/image-loaders/image-loader.h index ea7b3a5..d619a30 100644 --- a/platform-abstractions/tizen/image-loaders/image-loader.h +++ b/platform-abstractions/tizen/image-loaders/image-loader.h @@ -2,7 +2,7 @@ #define __DALI_TIZEN_PLATFORM_IMAGE_LOADER_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,47 +17,69 @@ * limitations under the License. */ -#include +// EXTERNAL INCLUDES +#include #include #include -#include "resource-loading-client.h" +#include +#include +#include namespace Dali { +namespace Integration +{ +typedef IntrusivePtr ResourcePointer; +} // Integration + namespace TizenPlatform { namespace ImageLoader { /** * Convert a file stream into a bitmap. - * @param[in] resourceType The type of resource to convert. + * @param[in] resource The resource to convert. * @param[in] path The path to the resource. * @param[in] fp File Pointer. Closed on exit. - * @param[in] client The component that is initiating the conversion. * @param[out] bitmap Pointer to write bitmap to * @return true on success, false on failure */ -bool ConvertStreamToBitmap( const Integration::ResourceType& resourceType, std::string path, FILE * const fp, const ResourceLoadingClient& client, Integration::BitmapPtr& ptr); +bool ConvertStreamToBitmap( const Integration::BitmapResourceType& resource, std::string path, FILE * const fp, Dali::Devel::PixelBuffer& pixelBuffer ); /** * Convert a bitmap and write to a file stream. * @param[in] path The path to the resource. * @param[in] fp File Pointer. Closed on exit. - * @param[out] bitmap Pointer from which to read bitmap + * @param[out] pixelData Reference to PixelData object. * @return true on success, false on failure */ -bool ConvertBitmapToStream( std::string path, FILE * const fp, Integration::BitmapPtr& ptr ); - +bool ConvertBitmapToStream( std::string path, FILE * const fp, Dali::Devel::PixelBuffer& pixelBuffer ); -Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath ); +/** + * Loads an image synchronously + * @param resource details of the image + * @param path to the image + * @return bitmap + */ +Integration::ResourcePointer LoadImageSynchronously( const Integration::BitmapResourceType& resource, const std::string& path ); -void GetClosestImageSize( const std::string& filename, - const ImageAttributes& attributes, - Vector2 &closestSize ); +/** + * @returns the closest image size + */ +ImageDimensions GetClosestImageSize( const std::string& filename, + ImageDimensions size, + FittingMode::Type fittingMode, + SamplingMode::Type samplingMode, + bool orientationCorrection ); -void GetClosestImageSize( Integration::ResourcePointer resourceBuffer, - const ImageAttributes& attributes, - Vector2 &closestSize ); +/** + * @returns the closest image size + */ +ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer, + ImageDimensions size, + FittingMode::Type fittingMode, + SamplingMode::Type samplingMode, + bool orientationCorrection ); } // ImageLoader } // TizenPlatform