1 #ifndef DALI_SCENE3D_LOADER_ENVIRONMENT_MAP_DATA_H
2 #define DALI_SCENE3D_LOADER_ENVIRONMENT_MAP_DATA_H
4 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 #include <dali/public-api/common/vector-wrapper.h>
22 #include <dali/public-api/images/pixel-data.h>
23 #include <dali/public-api/rendering/shader.h>
24 #include <dali/public-api/rendering/texture.h>
27 #include <dali-scene3d/public-api/api.h>
28 #include <dali-scene3d/public-api/common/environment-map.h>
30 namespace Dali::Scene3D::Loader
33 * @brief Stores the pixel data objects for environment map texture.
34 * EnvironmentMapData supports cube map that contains textures for 6 faces, or
35 * an equirectangular image.
37 class DALI_SCENE3D_API EnvironmentMapData
41 * @brief Retrieves environment map texture from image file
42 * @return texture for loaded environment map.
47 * @brief Sets environment map type
48 * @param[in] environmentMapType environment map type
50 void SetEnvironmentMapType(Dali::Scene3D::EnvironmentMapType environmentMapType)
52 if(mEnvironmentMapType != environmentMapType)
54 mEnvironmentMapTexture.Reset();
55 mEnvironmentMapType = environmentMapType;
60 * @brief Retrieves environment map type.
61 * @return environment map type
63 Dali::Scene3D::EnvironmentMapType GetEnvironmentMapType() const
65 return mEnvironmentMapType;
68 void SetMipmapLevels(uint32_t mipmapLevels)
70 mMipmapLevels = mipmapLevels;
73 uint32_t GetMipmapLevels()
79 std::vector<std::vector<PixelData> > mPixelData;
82 Dali::Texture mEnvironmentMapTexture;
83 Dali::Shader mEnvironmentMapShader;
84 Dali::Scene3D::EnvironmentMapType mEnvironmentMapType{Dali::Scene3D::EnvironmentMapType::AUTO};
85 uint32_t mMipmapLevels{1u};
88 } // namespace Dali::Scene3D::Loader
90 #endif // DALI_SCENE3D_LOADER_ENVIRONMENT_MAP_DATA_H