2 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali-scene3d/internal/common/environment-map-load-task.h>
22 #include <dali-scene3d/public-api/loader/cube-map-loader.h>
32 EnvironmentMapLoadTask::EnvironmentMapLoadTask(const std::string& environmentMapUrl, CallbackBase* callback)
33 : AsyncTask(callback),
34 mEnvironmentMapUrl(environmentMapUrl),
40 EnvironmentMapLoadTask::~EnvironmentMapLoadTask()
44 void EnvironmentMapLoadTask::Process()
46 mHasSucceeded = Scene3D::Loader::LoadCubeMapData(mEnvironmentMapUrl, mEnvironmentMapPixelData);
49 bool EnvironmentMapLoadTask::IsReady()
54 bool EnvironmentMapLoadTask::HasSucceeded() const
59 Dali::Scene3D::Loader::CubeData EnvironmentMapLoadTask::GetEnvironmentMap() const
61 Dali::Scene3D::Loader::CubeData environmentMapPixelData;
62 if(mIsReady && mHasSucceeded && !mEnvironmentMapPixelData.data.empty())
64 environmentMapPixelData = mEnvironmentMapPixelData;
66 return environmentMapPixelData;
69 } // namespace Internal
71 } // namespace Scene3D