• 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_INTERFACE_POSTPROCESS_IBLOOM_H
17 #define SCENE_INTERFACE_POSTPROCESS_IBLOOM_H
18 
19 #include <scene/base/types.h>
20 #include <scene/interface/intf_bitmap.h>
21 #include <scene/interface/postprocess/intf_postprocess_effect.h>
22 
23 SCENE_BEGIN_NAMESPACE()
24 
25 /** Bloom type enum */
26 enum class BloomType {
27     /** Normal, smooth to every direction */
28     NORMAL = 0,
29     /** Blurred/Blooms more in horizontal direction */
30     HORIZONTAL = 1,
31     /** Blurred/Blooms more in vertical direction */
32     VERTICAL = 2,
33     /** Bilateral filter, uses depth if available */
34     BILATERAL = 3,
35 };
36 
37 class IBloom : public IPostProcessEffect {
38     META_INTERFACE(IPostProcessEffect, IBloom, "8020311e-8724-4a20-be99-e46cf667b505")
39 public:
40     /**
41      * @brief Camera postprocessing settings, bloom type
42      * @return
43      */
44     META_PROPERTY(BloomType, Type)
45     /**
46      * @brief Camera postprocessing settings, bloom quality type
47      * @return
48      */
49     META_PROPERTY(EffectQualityType, Quality)
50     /**
51      * @brief Camera postprocessing settings, bloom threshold hard
52      * @return
53      */
54     META_PROPERTY(float, ThresholdHard)
55     /**
56      * @brief Camera postprocessing settings, bloom threshold soft
57      * @return
58      */
59     META_PROPERTY(float, ThresholdSoft)
60     /**
61      * @brief Camera postprocessing settings, bloom amount coefficient
62      * @return
63      */
64     META_PROPERTY(float, AmountCoefficient)
65     /**
66      * @brief Camera postprocessing settings
67      * @return
68      */
69     META_PROPERTY(float, DirtMaskCoefficient)
70     /**
71      * @brief Camera postprocessing settings
72      * @return
73      */
74     META_PROPERTY(IBitmap::Ptr, DirtMaskImage)
75     /**
76      * @brief Camera postprocessing settings
77      * @return
78      */
79     META_PROPERTY(bool, UseCompute)
80     /**
81      * @brief Scatter (amount of bloom spread). (1.0 full spread / default)
82      * @return
83      */
84     META_PROPERTY(float, Scatter)
85     /** @brief Scaling factor. Controls the amount of scaling and bloom spread
86      * Reduces the downscale and upscale steps
87      * Values 0 - 1. Value of 0.5 halves the scale steps
88      * @return
89      */
90     META_PROPERTY(float, ScaleFactor)
91 };
92 
93 META_REGISTER_CLASS(Bloom, "6718b07d-c3d1-4036-bd0f-88d1380b846a", META_NS::ObjectCategoryBits::NO_CATEGORY)
94 
95 SCENE_END_NAMESPACE()
96 
97 META_TYPE(SCENE_NS::BloomType)
98 META_INTERFACE_TYPE(SCENE_NS::IBloom)
99 
100 #endif
101