DALi Version 2.2.11
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / internal / common / environment-map-load-task.cpp
1 /*
2  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali-scene3d/internal/common/environment-map-load-task.h>
20
21 // INTERNAL INCLUDES
22 #include <dali-scene3d/public-api/loader/environment-map-loader.h>
23
24
25 namespace Dali
26 {
27 namespace Scene3D
28 {
29 namespace Internal
30 {
31
32 EnvironmentMapLoadTask::EnvironmentMapLoadTask(const std::string& environmentMapUrl, Dali::Scene3D::EnvironmentMapType environmentMapType, CallbackBase* callback)
33 : AsyncTask(callback),
34   mEnvironmentMapUrl(environmentMapUrl),
35   mEnvironmentMapType(environmentMapType),
36   mIsReady(true),
37   mHasSucceeded(false)
38 {
39 }
40
41 EnvironmentMapLoadTask::~EnvironmentMapLoadTask()
42 {
43 }
44
45 void EnvironmentMapLoadTask::Process()
46 {
47   mEnvironmentMapData.SetEnvironmentMapType(mEnvironmentMapType);
48   mHasSucceeded = Scene3D::Loader::LoadEnvironmentMap(mEnvironmentMapUrl, mEnvironmentMapData);
49 }
50
51 bool EnvironmentMapLoadTask::IsReady()
52 {
53   return mIsReady;
54 }
55
56 bool EnvironmentMapLoadTask::HasSucceeded() const
57 {
58   return mHasSucceeded;
59 }
60
61 Dali::Scene3D::Loader::EnvironmentMapData& EnvironmentMapLoadTask::GetEnvironmentMap()
62 {
63   return mEnvironmentMapData;
64 }
65
66 } // namespace Internal
67
68 } // namespace Scene3D
69
70 } // namespace Dali