1 #ifndef DALI_SCENE3D_ENVIRONMENT_MAP_LOAD_TASK_H
2 #define DALI_SCENE3D_ENVIRONMENT_MAP_LOAD_TASK_H
5 * Copyright (c) 2023 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/common/intrusive-ptr.h>
22 #include <dali/public-api/images/pixel-data.h>
23 #include <dali/public-api/adaptor-framework/async-task-manager.h>
27 #include <dali-scene3d/public-api/loader/load-result.h>
28 #include <dali-scene3d/public-api/loader/scene-definition.h>
29 #include <dali-scene3d/public-api/common/environment-map.h>
30 #include <dali-scene3d/public-api/loader/environment-map-data.h>
38 class EnvironmentMapLoadTask;
39 typedef IntrusivePtr<EnvironmentMapLoadTask> EnvironmentMapLoadTaskPtr;
41 class EnvironmentMapLoadTask : public AsyncTask
46 * @param[in] environmentMapUrl The url of the environment map image file.
47 * @param[in] callback The callback that is called when the operation is completed.
49 EnvironmentMapLoadTask(const std::string& environmentMapUrl, Dali::Scene3D::EnvironmentMapType environmentMapType, CallbackBase* callback);
54 ~EnvironmentMapLoadTask();
59 void Process() override;
62 * Whether the task is ready to process.
63 * @return True if the task is ready to process.
65 bool IsReady() override;
68 * Whether the task has succeeded.
69 * @return True if the task has succeeded.
71 bool HasSucceeded() const;
74 * Retrieves loaded Ibl Texture
75 * @return Texture that is loaded from url.
76 * @note Do not call this method in worker thread.
78 Dali::Texture GetLoadedTexture();
82 EnvironmentMapLoadTask(const EnvironmentMapLoadTask& task) = delete;
85 EnvironmentMapLoadTask& operator=(const EnvironmentMapLoadTask& task) = delete;
88 std::string mEnvironmentMapUrl;
89 Dali::Scene3D::Loader::EnvironmentMapData mEnvironmentMapData;
90 Dali::Scene3D::EnvironmentMapType mEnvironmentMapType{Dali::Scene3D::EnvironmentMapType::AUTO};
96 } // namespace Internal
98 } // namespace Scene3D
102 #endif // DALI_SCENE3D_ENVIRONMENT_MAP_LOAD_TASK_H