Ocean
Initializer.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_INITIALIZER_H
9 #define META_OCEAN_CV_SYNTHESIS_INITIALIZER_H
10 
13 
14 namespace Ocean
15 {
16 
17 namespace CV
18 {
19 
20 namespace Synthesis
21 {
22 
23 /**
24  * This class implements the base class for all synthesis initializers.
25  * An initializer provides the initial mapping for a synthesis layer.<br>
26  * The initializer holds only references to e.g. the synthesis layers or any other input or output information.<br>
27  * Each initialization object is a simple container that gathers all objects that are necessary for the initialization directly when it is created.<br>
28  * Once the initializer has been created it should be invoked.<br>
29  * A initializer should not be invoked twice.
30  * @see Initializer::invoke().
31  * @ingroup cvsynthesis
32  */
33 class Initializer : virtual public Operator
34 {
35  public:
36 
37  /**
38  * Invokes the initializer.
39  * @param worker Optional worker object to distribute the computation.
40  * @return True, if succeeded
41  */
42  virtual bool invoke(Worker* worker = nullptr) const = 0;
43 
44  protected:
45 
46  /**
47  * Creates a new initializer object.
48  * @param layer The layer for that the initial mapping has to be provided
49  */
50  inline Initializer(Layer& layer);
51 
52  protected:
53 
54  /// Synthesis layer that has to be initialized.
56 };
57 
59  layer_(layer)
60 {
61  // nothing to do here
62 }
63 
64 }
65 
66 }
67 
68 }
69 
70 #endif // META_OCEAN_CV_SYNTHESIS_INITIALIZER_H
This class implements the base class for all synthesis initializers.
Definition: Initializer.h:34
virtual bool invoke(Worker *worker=nullptr) const =0
Invokes the initializer.
Layer & layer_
Synthesis layer that has to be initialized.
Definition: Initializer.h:55
Initializer(Layer &layer)
Creates a new initializer object.
Definition: Initializer.h:58
This class implements the base class for all inpainting layers.
Definition: Layer.h:35
This class is the base class for all image synthesis operators.
Definition: Operator.h:28
This class implements a worker able to distribute function calls over different threads.
Definition: Worker.h:33
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15