X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fimage-loader%2Fasync-image-loader-devel.h;h=ce91e09e7cae10e4cf3460c4023e91e1d161cb84;hb=df88ef210c240cab1fdef98dcd6b2c07e6940eb7;hp=2af2be97791102bd3869eb4484f536f566ea1cfc;hpb=d26f555fd84d43b0a3e650c66a0e626e841dd9c6;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/devel-api/image-loader/async-image-loader-devel.h b/dali-toolkit/devel-api/image-loader/async-image-loader-devel.h index 2af2be9..ce91e09 100644 --- a/dali-toolkit/devel-api/image-loader/async-image-loader-devel.h +++ b/dali-toolkit/devel-api/image-loader/async-image-loader-devel.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_DEVEL_API_IMAGE_LOADER_ASYNC_IMAGE_LOADER_DEVEL_H /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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,8 +17,12 @@ * limitations under the License. */ -#include +// EXTERNAL HEADER +#include #include +#include + +// INTERNAL HEADER #include namespace Dali @@ -27,17 +31,78 @@ namespace Toolkit { namespace DevelAsyncImageLoader { +typedef Signal&)> PixelBufferLoadedSignalType; + +/** + * @brief Whether to multiply alpha into color channels on load + */ +enum class PreMultiplyOnLoad +{ + OFF = 0, ///< Don't modify the image + ON ///< Multiply alpha into color channels on load +}; -typedef Signal< void ( uint32_t, Devel::PixelBuffer ) > PixelBufferLoadedSignalType; +/** + * @brief Starts an animated image loading task. + * @REMARK_INTERNET + * @REMARK_STORAGE + * @param[in] asyncImageLoader The ayncImageLoader + * @param[in] animatedImageLoading The AnimatedImageLoading to load animated image + * @param[in] frameIndex The frame index of a frame to be loaded frame + * @return The loading task id + */ +DALI_TOOLKIT_API uint32_t LoadAnimatedImage(AsyncImageLoader asyncImageLoader, + Dali::AnimatedImageLoading animatedImageLoading, + uint32_t frameIndex); + +/** + * @brief Starts an image loading task. + * @REMARK_INTERNET + * @REMARK_STORAGE + * @param[in] asyncImageLoader The ayncImageLoader + * @param[in] url The URL of the image file to load + * @param[in] dimensions The width and height to fit the loaded image to + * @param[in] fittingMode The method used to fit the shape of the image before loading to the shape defined by the size parameter + * @param[in] samplingMode The filtering method used when sampling pixels from the input image while fitting it to desired size + * @param[in] orientationCorrection Reorient the image to respect any orientation metadata in its header + * @param[in] preMultiplyOnLoad ON if the image color should be multiplied by it's alpha. Set to OFF if there is no alpha or if the image need to be applied alpha mask. + * @return The loading task id + */ +DALI_TOOLKIT_API uint32_t Load(AsyncImageLoader asyncImageLoader, + const std::string& url, + ImageDimensions dimensions, + FittingMode::Type fittingMode, + SamplingMode::Type samplingMode, + bool orientationCorrection, + DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad); + +/** + * @brief Starts an mask applying task. + * @REMARK_INTERNET + * @REMARK_STORAGE + * @param[in] asyncImageLoader The ayncImageLoader + * @param[in] pixelBuffer Pointer to raw pixel data to be masked + * @param[in] maskPixelBuffer Pointer to raw masking data + * @param[in] contentScale The factor to scale the content + * @param[in] cropToMask Whether to crop the content to the mask size + * @param[in] preMultiplyOnLoad ON if the image color should be multiplied by it's alpha. Set to OFF if there is no alpha. + * @return The masking task id + */ +DALI_TOOLKIT_API uint32_t ApplyMask(AsyncImageLoader asyncImageLoader, + Devel::PixelBuffer pixelBuffer, + Devel::PixelBuffer maskPixelBuffer, + float contentScale, + bool cropToMask, + DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad); /** * Connect to this signal if you want to load a PixelBuffer instead of a PixelData. * @note Connecting to this signal prevents the emission of the ImageLoadedSignal. */ -DALI_IMPORT_API PixelBufferLoadedSignalType& PixelBufferLoadedSignal( AsyncImageLoader asyncImageLoader ); +DALI_TOOLKIT_API PixelBufferLoadedSignalType& PixelBufferLoadedSignal(AsyncImageLoader asyncImageLoader); -} -} // Toolkit -} // Dali +} // namespace DevelAsyncImageLoader +} // namespace Toolkit +} // namespace Dali #endif