1 #ifndef DALI_TOOLKIT_ASYNC_IMAGE_LOADER_IMPL_H
2 #define DALI_TOOLKIT_ASYNC_IMAGE_LOADER_IMPL_H
5 * Copyright (c) 2016 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/pixel-data.h>
22 #include <dali/public-api/object/base-object.h>
25 #include <dali-toolkit/public-api/image-loader/async-image-loader.h>
26 #include <dali-toolkit/internal/image-loader/image-load-thread.h>
37 class AsyncImageLoader : public BaseObject
47 * @copydoc Toolkit::AsyncImageLoader::New()
49 static IntrusivePtr<AsyncImageLoader> New();
52 * @copydoc Toolkit::AsyncImageLoader::Load( const std::string&, ImageDimensions, FittingMode::Type, SamplingMode::Type, bool )
54 uint32_t Load( const VisualUrl& url,
55 ImageDimensions dimensions,
56 FittingMode::Type fittingMode,
57 SamplingMode::Type samplingMode,
58 bool orientationCorrection );
61 * @copydoc Toolkit::AsyncImageLoader::ImageLoadedSignal
63 Toolkit::AsyncImageLoader::ImageLoadedSignalType& ImageLoadedSignal();
66 * @copydoc Toolkit::AsyncImageLoader::Cancel
68 bool Cancel( uint32_t loadingTaskId );
71 * @copydoc Toolkit::AsyncImageLoader::CancelAll
76 * Process the completed loading task from the worker thread.
78 void ProcessLoadedImage();
88 Toolkit::AsyncImageLoader::ImageLoadedSignalType mLoadedSignal;
90 ImageLoadThread mLoadThread;
92 bool mIsLoadThreadStarted;
95 } // namespace Internal
97 inline const Internal::AsyncImageLoader& GetImplementation( const Toolkit::AsyncImageLoader& handle )
99 DALI_ASSERT_ALWAYS( handle && "AsyncImageLoader handle is empty" );
101 const BaseObject& object = handle.GetBaseObject();
103 return static_cast<const Internal::AsyncImageLoader&>( object );
106 inline Internal::AsyncImageLoader& GetImplementation( Toolkit::AsyncImageLoader& handle )
108 DALI_ASSERT_ALWAYS( handle && "AsyncImageLoader handle is empty" );
110 BaseObject& object = handle.GetBaseObject();
112 return static_cast<Internal::AsyncImageLoader&>( object );
115 } // namespace Toolkit
119 #endif // DALI_TOOLKIT_ASYNC_IMAGE_LOADER_IMPL_H