1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef LOADER_RENDER_DATA_CONFIGURATION_LOADER_H 17 #define LOADER_RENDER_DATA_CONFIGURATION_LOADER_H 18 19 #include <base/containers/string.h> 20 #include <base/containers/string_view.h> 21 #include <core/namespace.h> 22 #include <render/datastore/render_data_store_render_pods.h> 23 #include <render/device/pipeline_state_desc.h> 24 #include <render/loader/intf_render_data_configuration_loader.h> 25 #include <render/namespace.h> 26 27 CORE_BEGIN_NAMESPACE() 28 class IFileManager; 29 CORE_END_NAMESPACE() RENDER_BEGIN_NAMESPACE()30RENDER_BEGIN_NAMESPACE() 31 /** 32 * Render data configuration loader. 33 * A class that can be used to load vertex input declaration from json structure. 34 */ 35 class RenderDataConfigurationLoader final { 36 public: 37 /** Load PostProcessConfiguration. 38 * @return A post process configuration, as defined in the json file. 39 */ 40 static IRenderDataConfigurationLoader::LoadedPostProcess LoadPostProcess(BASE_NS::string_view jsonString); 41 static IRenderDataConfigurationLoader::LoadedPostProcess LoadPostProcess( 42 CORE_NS::IFileManager& fileManager, BASE_NS::string_view uri); 43 }; 44 45 class RenderDataConfigurationLoaderImpl final : public IRenderDataConfigurationLoader { 46 public: 47 LoadedPostProcess LoadPostProcess(BASE_NS::string_view jsonString) override; 48 LoadedPostProcess LoadPostProcess(CORE_NS::IFileManager& fileManager, BASE_NS::string_view uri) override; 49 50 const IInterface* GetInterface(const BASE_NS::Uid& uid) const override; 51 IInterface* GetInterface(const BASE_NS::Uid& uid) override; 52 53 void Ref() override; 54 void Unref() override; 55 }; 56 RENDER_END_NAMESPACE() 57 58 #endif // LOADER_RENDER_DATA_CONFIGURATION_LOADER_H 59