1 /* 2 * Copyright (c) 2022 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 API_RENDER_NODECONTEXT_IRENDER_POST_PROCESS_H 17 #define API_RENDER_NODECONTEXT_IRENDER_POST_PROCESS_H 18 19 #include <base/containers/array_view.h> 20 #include <base/util/uid.h> 21 #include <core/plugin/intf_interface.h> 22 #include <core/property/intf_property_handle.h> 23 #include <render/namespace.h> 24 25 RENDER_BEGIN_NAMESPACE() 26 27 class IRenderNodeContextManager; 28 class IRenderCommandList; 29 30 /** @ingroup group_render_IRenderPostProcess */ 31 /** 32 * Provides interface to access post process properties. 33 * Not thread-safe generally. 34 * The data is fetched in rendering front-end, and the property data set is not dynamic. 35 */ 36 class IRenderPostProcess : public CORE_NS::IInterface { 37 public: 38 static constexpr auto UID = BASE_NS::Uid("f0a2ac94-f117-4abe-a564-362b37251e26"); 39 40 using Ptr = BASE_NS::refcnt_ptr<IRenderPostProcess>; 41 42 /** Get property handle for built-in properties for this effect. Check the pointer always. 43 * These properties are global values which are usually set once or changed sparingly. 44 * For example quality parameters for the post process. 45 * @return Pointer to property handle if properties present, nullptr otherwise. 46 */ 47 virtual CORE_NS::IPropertyHandle* GetProperties() = 0; 48 49 /** Return UID of the render post process node implementation. 50 * Based on this new instances are created per render node. 51 * @return UID of the render post process node. 52 */ 53 virtual BASE_NS::Uid GetRenderPostProcessNodeUid() = 0; 54 55 /** Set the full property data set. (Faster update without properties) 56 * This will overwrite all the properties. 57 * If the data size does not match the data should not be updated. 58 */ 59 virtual void SetData(BASE_NS::array_view<const uint8_t> data) = 0; 60 61 /** Get the full property data set. (Faster data setup e.g. during the rendering) 62 * @return Array view to full property data. 63 */ 64 virtual BASE_NS::array_view<const uint8_t> GetData() const = 0; 65 66 protected: 67 IRenderPostProcess() = default; 68 virtual ~IRenderPostProcess() = default; 69 70 IRenderPostProcess(const IRenderPostProcess&) = delete; 71 IRenderPostProcess& operator=(const IRenderPostProcess&) = delete; 72 IRenderPostProcess(IRenderPostProcess&&) = delete; 73 IRenderPostProcess& operator=(IRenderPostProcess&&) = delete; 74 }; 75 RENDER_END_NAMESPACE() 76 77 #endif // API_RENDER_NODECONTEXT_IRENDER_POST_PROCESS_H 78