Ocean
Optimizer.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_OPTIMIZER_H
9 #define META_OCEAN_CV_SYNTHESIS_OPTIMIZER_H
10 
13 
14 namespace Ocean
15 {
16 
17 namespace CV
18 {
19 
20 namespace Synthesis
21 {
22 
23 /**
24  * This class is the base class for all synthesis optimizers.
25  * An optimizer tries to improve a given synthesis mapping to provide a more optimal synthesis result.<br>
26  * The optimizer should not be applied before the mapping has been initialized.
27  * @ingroup cvsynthesis
28  */
29 class Optimizer : virtual public Operator
30 {
31  public:
32 
33  /**
34  * Invokes the operator.
35  * @param radii Number of improvement radii during one optimization iteration for each mapping position
36  * @param iterations Number of optimization iterations that will be applied
37  * @param maxSpatialCost Maximal spatial cost
38  * @param worker Optional worker object to distribute the computation
39  * @param applyInitialMapping True, to apply the initial mapping before the optimization starts
40  * @return True, if succeeded
41  */
42  virtual bool invoke(const unsigned int radii, const unsigned int iterations = 5u, const unsigned int maxSpatialCost = 0xFFFFFFFFu, Worker* worker = nullptr, const bool applyInitialMapping = true) const = 0;
43 
44  protected:
45 
46  /**
47  * Creates a new operator object.
48  * @param layer The layer for that this operator is applied
49  */
50  inline Optimizer(Layer& layer);
51 
52  protected:
53 
54  /// Optimizer layer.
56 };
57 
58 inline Optimizer::Optimizer(Layer& layer) :
59  layer_(layer)
60 {
61 
62 }
63 
64 }
65 
66 }
67 
68 }
69 
70 #endif // META_OCEAN_CV_SYNTHESIS_OPTIMIZER_H
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 is the base class for all synthesis optimizers.
Definition: Optimizer.h:30
Optimizer(Layer &layer)
Creates a new operator object.
Definition: Optimizer.h:58
virtual bool invoke(const unsigned int radii, const unsigned int iterations=5u, const unsigned int maxSpatialCost=0xFFFFFFFFu, Worker *worker=nullptr, const bool applyInitialMapping=true) const =0
Invokes the operator.
Layer & layer_
Optimizer layer.
Definition: Optimizer.h:55
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