X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fimage-loader%2Fimage-load-thread.h;h=cd6bd323672b24ff50f7df78d60d82c1cc56895d;hb=10caf1dca0d3b222b74ba3916a84474fbcf8834e;hp=4eddce719f4f2accc42b1d703c8ce093c33ab4d5;hpb=bd75dc4cad4ce62cc9206abf19280b40825b9726;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/image-loader/image-load-thread.h b/dali-toolkit/internal/image-loader/image-load-thread.h index 4eddce7..cd6bd32 100644 --- a/dali-toolkit/internal/image-loader/image-load-thread.h +++ b/dali-toolkit/internal/image-loader/image-load-thread.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_IMAGE_LOAD_THREAD_H__ -#define __DALI_TOOLKIT_IMAGE_LOAD_THREAD_H__ +#ifndef DALI_TOOLKIT_IMAGE_LOAD_THREAD_H +#define DALI_TOOLKIT_IMAGE_LOAD_THREAD_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -20,11 +20,15 @@ // EXTERNAL INCLUDES #include #include +#include #include #include #include -#include #include +#include +#include +#include +#include namespace Dali { @@ -42,8 +46,45 @@ struct LoadingTask { /** * Constructor. + * @param [in] id of the task + * @param [in] url The URL of the image file to load. + * @param [in] size The width and height to fit the loaded image to, 0.0 means whole image + * @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's color should be multiplied by it's alpha. */ - LoadingTask( uint32_t id, BitmapLoader loader ); + LoadingTask( uint32_t id, + const VisualUrl& url, + ImageDimensions dimensions, + FittingMode::Type fittingMode, + SamplingMode::Type samplingMode, + bool orientationCorrection, + DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad); + + /** + * Constructor. + * @param [in] id of the task + * @param [in] pixelBuffer of the to be masked image + * @param [in] maskPixelBuffer of the mask image + * @param [in] contentScale The factor to scale the content + * @param [in] cropToMask Whether to crop the content to the mask size + */ + LoadingTask( uint32_t id, + Devel::PixelBuffer pixelBuffer, + Devel::PixelBuffer maskPixelBuffer, + float contentScale, + bool cropToMask ); + + /** + * Load the image + */ + void Load(); + + /** + * Apply mask + */ + void ApplyMask(); private: @@ -55,8 +96,20 @@ private: public: - BitmapLoader loader; ///< The loader used to load the bitmap from URL - uint32_t id; ///< The id associated with this task. + Devel::PixelBuffer pixelBuffer; ///< pixelBuffer handle after successful load + ///< or pixelBuffer to be masked image in the mask task + VisualUrl url; ///< url of the image to load + uint32_t id; ///< The unique id associated with this task. + ImageDimensions dimensions; ///< dimensions to load + FittingMode::Type fittingMode; ///< fitting options + SamplingMode::Type samplingMode; ///< sampling options + bool orientationCorrection:1; ///< if orientation correction is needed + DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad; //< if the image's color should be multiplied by it's alpha + + bool isMaskTask; ///< whether this task is for mask or not + Devel::PixelBuffer maskPixelBuffer; ///< pixelBuffer of mask image + float contentScale; ///< The factor to scale the content + bool cropToMask; ///< Whether to crop the content to the mask size }; @@ -83,6 +136,8 @@ public: * Add a task in to the loading queue * * @param[in] task The task added to the queue. + * + * @note This class takes ownership of the task object */ void AddTask( LoadingTask* task ); @@ -139,10 +194,11 @@ private: Vector< LoadingTask* > mLoadQueue; /// mCompleteQueue; ///