• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 SCENE_SRC_POSTPROCESS_POSTPROCESS_H
17 #define SCENE_SRC_POSTPROCESS_POSTPROCESS_H
18 
19 #include <scene/ext/intf_create_entity.h>
20 #include <scene/interface/intf_postprocess.h>
21 #include <scene/interface/resource/types.h>
22 
23 #include <meta/api/resource/derived_from_resource.h>
24 #include <meta/ext/implementation_macros.h>
25 #include <meta/ext/object.h>
26 #include <meta/ext/resource/resource.h>
27 
28 #include "component/postprocess_component.h"
29 
SCENE_BEGIN_NAMESPACE()30 SCENE_BEGIN_NAMESPACE()
31 
32 class PostProcess : public META_NS::IntroduceInterfaces<META_NS::DerivedFromResource, NamedSceneObject, IPostProcess,
33                         ICreateEntity, META_NS::Resource> {
34     META_OBJECT(PostProcess, SCENE_NS::ClassId::PostProcess, IntroduceInterfaces)
35 public:
36     PostProcess() : Super(ClassId::PostProcessResourceTemplate) {}
37 
38     META_BEGIN_STATIC_DATA()
39     SCENE_STATIC_DYNINIT_PROPERTY_DATA(IPostProcess, ITonemap::Ptr, Tonemap, "")
40     SCENE_STATIC_DYNINIT_PROPERTY_DATA(IPostProcess, IBloom::Ptr, Bloom, "")
41     META_END_STATIC_DATA()
42 
43     META_IMPLEMENT_READONLY_PROPERTY(ITonemap::Ptr, Tonemap)
44     META_IMPLEMENT_READONLY_PROPERTY(IBloom::Ptr, Bloom)
45 
46     CORE_NS::Entity CreateEntity(const IInternalScene::Ptr& scene) override;
47     bool InitDynamicProperty(const META_NS::IProperty::Ptr& p, BASE_NS::string_view path) override;
48 
49     bool SetEcsObject(const IEcsObject::Ptr&) override;
50     IEcsObject::Ptr GetEcsObject() const override;
51 
52     CORE_NS::ResourceType GetResourceType() const override
53     {
54         return ClassId::PostProcessResource.Id().ToUid();
55     }
56 
57 private:
58     IInternalPostProcess::Ptr pp_;
59 };
60 
61 SCENE_END_NAMESPACE()
62 
63 #endif