Ocean
LayerF.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_CV_SYNTHESIS_LAYER_F_H
9 #define META_OCEAN_CV_SYNTHESIS_LAYER_F_H
10 
14 
15 namespace Ocean
16 {
17 
18 namespace CV
19 {
20 
21 namespace Synthesis
22 {
23 
24 /**
25  * This class implements the base class for all synthesis layers with float accuracy.
26  * @ingroup cvsynthesis
27  */
28 class LayerF : public Layer
29 {
30  public:
31 
32  /**
33  * Returns the mapping of this synthesis layer.
34  * @return Synthesis mapping
35  */
36  virtual const MappingF& mapping() const = 0;
37 
38  /**
39  * Returns the mapping of this synthesis layer.
40  * @return Synthesis mapping
41  */
42  virtual MappingF& mapping() = 0;
43 
44  protected:
45 
46  /**
47  * Creates an empty layer object.
48  */
49  inline LayerF();
50 
51  /**
52  * Copy constructor.
53  * @param layer The layer to be copied
54  */
55  inline LayerF(const LayerF& layer);
56 
57  /**
58  * Move constructor.
59  * @param layer The layer to be moved
60  */
61  inline LayerF(LayerF&& layer) noexcept;
62 
63  /**
64  * Creates a new inpainting layer by a given frame and corresponding mask.
65  * @param frame Inpainting frame for this layer
66  * @param mask Inpainting mask of this layer
67  * @param boundingBox Optional inpainting bounding box covering all mask pixels, if defined
68  */
70 
71  /**
72  * Assign operator.
73  * @param layer The layer to be copied
74  * @return The reference to this layer
75  */
76  inline LayerF& operator=(const LayerF& layer);
77 
78  /**
79  * Move operator.
80  * @param layer The layer to be moved
81  * @return The reference to this layer
82  */
83  inline LayerF& operator=(LayerF&& layer) noexcept;
84 };
85 
86 inline LayerF::LayerF() :
87  Layer()
88 {
89  // nothing to do here
90 }
91 
92 inline LayerF::LayerF(const LayerF& layer) :
93  Layer(layer)
94 {
95  // nothing to do here
96 }
97 
98 inline LayerF::LayerF(LayerF&& layer) noexcept :
99  Layer(std::move(layer))
100 {
101  // nothing to do here
102 }
103 
104 inline LayerF::LayerF(Frame& frame, const Frame& mask, const PixelBoundingBox& boundingBox) :
105  Layer(frame, mask, boundingBox)
106 {
107  // nothing to do here
108 }
109 
110 inline LayerF& LayerF::operator=(const LayerF& layer)
111 {
112  Layer::operator=(layer);
113  return *this;
114 }
115 
116 inline LayerF& LayerF::operator=(LayerF&& layer) noexcept
117 {
118  if (this != &layer)
119  {
120  Layer::operator=(std::move(layer));
121  }
122 
123  return *this;
124 }
125 
126 }
127 
128 }
129 
130 }
131 
132 #endif // META_OCEAN_CV_SYNTHESIS_LAYER_I_H
This class implements the base class for all synthesis layers with float accuracy.
Definition: LayerF.h:29
virtual MappingF & mapping()=0
Returns the mapping of this synthesis layer.
virtual const MappingF & mapping() const =0
Returns the mapping of this synthesis layer.
LayerF()
Creates an empty layer object.
Definition: LayerF.h:86
LayerF & operator=(const LayerF &layer)
Assign operator.
Definition: LayerF.h:110
This class implements the base class for all inpainting layers.
Definition: Layer.h:35
const Frame & mask() const
Returns the mask of this layer.
Definition: Layer.h:184
Layer & operator=(const Layer &layer)
Assign operator.
const Frame & frame() const
Returns the frame of this layer.
Definition: Layer.h:174
const PixelBoundingBox & boundingBox() const
Returns the optional bounding box of this layer.
Definition: Layer.h:194
This class implements a mapping with float accuracy.
Definition: MappingF.h:30
This class implements Ocean's image class.
Definition: Frame.h:1792
PixelBoundingBoxT< unsigned int > PixelBoundingBox
Definition of the default PixelBoundingBox object with data type allowing only positive coordinate va...
Definition: PixelBoundingBox.h:21
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15