Ocean
LayerF1.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_1_H
9 #define META_OCEAN_CV_SYNTHESIS_LAYER_F_1_H
10 
15 
17 
18 #include <vector>
19 
20 namespace Ocean
21 {
22 
23 namespace CV
24 {
25 
26 namespace Synthesis
27 {
28 
29 // Forward declaration.
30 class LayerF1;
31 
32 /**
33  * Definition of a vector holding one-frame sub-pixel layer objects.
34  * @see LayerF1.
35  * @ingroup cvsynthesis
36  */
37 typedef std::vector<LayerF1> LayersF1;
38 
39 /**
40  * This class implements a single layer for pixel synthesis within one frame and sub-pixel accuracy.
41  * @ingroup cvsynthesis
42  */
43 class OCEAN_CV_SYNTHESIS_EXPORT LayerF1 : public LayerF
44 {
45  public:
46 
47  /**
48  * Creates an empty synthesis layer.
49  */
51 
52  /**
53  * Copy constructor.
54  * @param layer The layer to be copied
55  */
56  LayerF1(const LayerF1& layer);
57 
58  /**
59  * Move constructor.
60  * @param layer The layer to be moved
61  */
62  LayerF1(LayerF1&& layer) noexcept;
63 
64  /**
65  * Creates a new synthesis layer.
66  * @param frame The frame of the synthesis layer
67  * @param mask The mask of the synthesis layer, must have the same frame dimension as the frame
68  * @param boundingBox Optional bounding box to focus the computation
69  */
70  LayerF1(Frame& frame, const Frame& mask, const PixelBoundingBox& boundingBox = PixelBoundingBox());
71 
72  /**
73  * Returns the mapping of this layer.
74  * @see Layer::mapping().
75  */
76  const MappingF1& mapping() const override;
77 
78  /**
79  * Returns the mapping of this layer.
80  * @see Layer::mapping().
81  */
82  MappingF1& mapping() override;
83 
84  /**
85  * Returns the mapping of this layer.
86  * @return Layer mapping
87  */
88  inline const MappingF1& mappingF1() const;
89 
90  /**
91  * Returns the mapping of this layer.
92  * @return Layer mapping
93  */
94  inline MappingF1& mappingF1();
95 
96  /**
97  * Assign operator.
98  * @param layer The layer to be copied
99  * @return The reference to this layer
100  */
101  LayerF1& operator=(const LayerF1& layer);
102 
103  /**
104  * Assigns a layer with integer accuracy to this layer and converts the mapping accordingly.
105  * @param layer The layer to be assigned
106  * @return The reference to this layer
107  */
108  LayerF1& operator=(const LayerI1& layer);
109 
110  /**
111  * Move operator.
112  * @param layer The layer to be moved
113  * @return The reference to this layer
114  */
115  LayerF1& operator=(LayerF1&& layer) noexcept;
116 
117  private:
118 
119  /// Layer synthesis mapping.
121 };
122 
123 inline const MappingF1& LayerF1::mappingF1() const
124 {
125  return mapping_;
126 }
127 
129 {
130  return mapping_;
131 }
132 
133 }
134 
135 }
136 
137 }
138 
139 #endif // META_OCEAN_CV_SYNTHESIS_LAYER_F_1_H
This class implements a single layer for pixel synthesis within one frame and sub-pixel accuracy.
Definition: LayerF1.h:44
LayerF1()
Creates an empty synthesis layer.
LayerF1 & operator=(const LayerI1 &layer)
Assigns a layer with integer accuracy to this layer and converts the mapping accordingly.
LayerF1(Frame &frame, const Frame &mask, const PixelBoundingBox &boundingBox=PixelBoundingBox())
Creates a new synthesis layer.
MappingF1 mapping_
Layer synthesis mapping.
Definition: LayerF1.h:120
const MappingF1 & mappingF1() const
Returns the mapping of this layer.
Definition: LayerF1.h:123
LayerF1(const LayerF1 &layer)
Copy constructor.
LayerF1 & operator=(const LayerF1 &layer)
Assign operator.
LayerF1 & operator=(LayerF1 &&layer) noexcept
Move operator.
const MappingF1 & mapping() const override
Returns the mapping of this layer.
LayerF1(LayerF1 &&layer) noexcept
Move constructor.
MappingF1 & mapping() override
Returns the mapping of this layer.
This class implements the base class for all synthesis layers with float accuracy.
Definition: LayerF.h:29
This class implements a single layer for pixel synthesis within one frame and pixel accuracy.
Definition: LayerI1.h:41
Cost function:
Definition: MappingF1.h:52
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
std::vector< LayerF1 > LayersF1
Definition of a vector holding one-frame sub-pixel layer objects.
Definition: LayerF1.h:30
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15