1 #ifndef DALI_SCENE3D_LOADER_LOAD_SCENE_METADATA_H_
\r
2 #define DALI_SCENE3D_LOADER_LOAD_SCENE_METADATA_H_
\r
4 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
\r
6 * Licensed under the Apache License, Version 2.0 (the "License");
\r
7 * you may not use this file except in compliance with the License.
\r
8 * You may obtain a copy of the License at
\r
10 * http://www.apache.org/licenses/LICENSE-2.0
\r
12 * Unless required by applicable law or agreed to in writing, software
\r
13 * distributed under the License is distributed on an "AS IS" BASIS,
\r
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
15 * See the License for the specific language governing permissions and
\r
16 * limitations under the License.
\r
20 // EXTERNAL INCLUDES
\r
21 #include <dali/public-api/images/image-operations.h>
\r
23 #include <unordered_map>
\r
25 // INTERNAL INCLUDES
\r
26 #include <dali-scene3d/public-api/api.h>
\r
28 namespace Dali::Scene3D::Loader
\r
31 * @brief Defines the matadata for an image.
\r
33 struct ImageMetadata
\r
35 ImageDimensions mMinSize{}; ///< The minimum required image size for rendering
\r
36 SamplingMode::Type mSamplingMode{SamplingMode::BOX_THEN_LINEAR}; ///< The sampling mode used to resize the image
\r
40 * @brief Stores the metadata for a scene.
\r
42 * @note The supported format is the following:
\r
44 * "images": (optional) [ {
\r
45 * "uri": name of the image file,
\r
46 * "minWidth": minimum width required for rendering,
\r
47 * "minHeight": minimum height required for rendering.
\r
48 * "samplingMode": sampling mode used to resize the image (@see Dali::SamplingMode). (optional)
\r
52 struct SceneMetadata
\r
54 std::unordered_map<std::string, ImageMetadata> mImageMetadata{}; ///< The container of image metadata (i.e. the pairs of image URI and image metadata)
\r
58 * @brief Attempts to load and process a json file specifying scene metadata
\r
59 * for pre-processing the scene resources: e.g. the minimum size required for rendering images, etc.
\r
60 * @note Will fail quietly if the file is not present.
\r
62 DALI_SCENE3D_API void LoadSceneMetadata(const std::string& url, SceneMetadata& sceneMetadata);
\r
64 } // namespace Dali::Scene3D::Loader
\r
66 #endif // DALI_SCENE3D_LOADER_LOAD_SCENE_METADATA_H_
\r