#define DALI_TOOLKIT_IMAGE_LOAD_THREAD_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
/**
* Constructor.
* @param [in] id of the task
+ * @param [in] animatedImageLoading The AnimatedImageLoading to load animated image
+ * @param [in] frameIndex The frame index of a frame to be loaded frame
+ */
+ LoadingTask( uint32_t id,
+ Dali::AnimatedImageLoading animatedImageLoading,
+ uint32_t frameIndex );
+
+ /**
+ * 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.
+ * @param [in] preMultiplyOnLoad ON if the image's 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.
*/
LoadingTask( uint32_t id,
const VisualUrl& url,
FittingMode::Type fittingMode,
SamplingMode::Type samplingMode,
bool orientationCorrection,
- DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad);
+ DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad );
/**
* Constructor.
* @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
+ * @param [in] preMultiplyOnLoad ON if the image's color should be multiplied by it's alpha. Set to OFF if there is no alpha.
*/
LoadingTask( uint32_t id,
- Devel::PixelBuffer pixelBuffer,
- Devel::PixelBuffer maskPixelBuffer,
- float contentScale,
- bool cropToMask );
+ Devel::PixelBuffer pixelBuffer,
+ Devel::PixelBuffer maskPixelBuffer,
+ float contentScale,
+ bool cropToMask,
+ DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad );
/**
* Load the image
*/
void ApplyMask();
+ /**
+ * Multiply alpha
+ */
+ void MultiplyAlpha();
+
private:
// Undefined
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
+ Dali::AnimatedImageLoading animatedImageLoading;
+ uint32_t frameIndex;
};
/**
* Destructor.
*/
- virtual ~ImageLoadThread();
+ ~ImageLoadThread() override;
/**
* Add a task in to the loading queue
* The entry function of the worker thread.
* It fetches loading task from the loadQueue, loads the image and adds to the completeQueue.
*/
- virtual void Run();
+ void Run() override;
private: