Changeset 16 in flair-src for trunk/demos/Sinus/src/MeanFilter.h


Ignore:
Timestamp:
Apr 8, 2016, 3:48:40 PM (5 years ago)
Author:
Bayard Gildas
Message:

Reformatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/demos/Sinus/src/MeanFilter.h

    r14 r16  
    1515#define MEANFILTER_H
    1616
    17 //we fix the max number of elements to compute the mean
    18 //this is a simple example, it should be dynamical
     17// we fix the max number of elements to compute the mean
     18// this is a simple example, it should be dynamical
    1919#define MAX_NUMBER_OF_ELEMENTS 200
    2020
    21 //necessary include, as IODevice is a base of our class
     21// necessary include, as IODevice is a base of our class
    2222#include <IODevice.h>
    2323
    24 //forward declaration for other classes
     24// forward declaration for other classes
    2525namespace flair {
    26     namespace core {
    27         class cvmatrix;
    28     }
    29     namespace gui {
    30         class LayoutPosition;
    31         class GroupBox;
    32         class SpinBox;
    33     }
     26namespace core {
     27class cvmatrix;
     28}
     29namespace gui {
     30class LayoutPosition;
     31class GroupBox;
     32class SpinBox;
     33}
    3434}
    3535
    36 //MeanFilter is a class computing a mean
     36// MeanFilter is a class computing a mean
    3737// based on a parametrizable number of elements
    3838// it derives on IODevice as it as an input and an output
    3939// it is a filter, we extend the namespace
    40 namespace flair { namespace filter {
    41     class MeanFilter : public core::IODevice {
     40namespace flair {
     41namespace filter {
     42class MeanFilter : public core::IODevice {
    4243
    43         public:
    44             /*!
    45             * \brief Constructor
    46             *
    47             * Builds a mean filter. \n
    48             * After calling this function, position will be deleted as it is no longer usefull. \n
    49             *
    50             * \param parent IODevice to use as parent
    51             * \param position where to place settings
    52             * \param name name of the object
    53             */
    54             MeanFilter(const core::IODevice* parent,const gui::LayoutPosition* position,std::string name);
     44public:
     45  /*!
     46  * \brief Constructor
     47  *
     48  * Builds a mean filter. \n
     49  * After calling this function, position will be deleted as it is no longer
     50  *usefull. \n
     51  *
     52  * \param parent IODevice to use as parent
     53  * \param position where to place settings
     54  * \param name name of the object
     55  */
     56  MeanFilter(const core::IODevice *parent, const gui::LayoutPosition *position,
     57             std::string name);
    5558
    56             /*!
    57             * \brief Destructor
    58             */
    59             ~MeanFilter();
     59  /*!
     60  * \brief Destructor
     61  */
     62  ~MeanFilter();
    6063
    61             /*!
    62             * \brief Output matrix
    63             *
    64             * allows to access output matrix, to get signal value or to put it in a graph.  \n
    65             *
    66             * \return pointer to the output matrix
    67             */
    68             core::cvmatrix *GetMatrix(void) const;
     64  /*!
     65  * \brief Output matrix
     66  *
     67  * allows to access output matrix, to get signal value or to put it in a graph.
     68  *\n
     69  *
     70  * \return pointer to the output matrix
     71  */
     72  core::cvmatrix *GetMatrix(void) const;
    6973
    70             /*!
    71             * \brief Value
    72             *
    73             * this method is equivalent to GetMatrix()->Value(0,0)
    74             *
    75             * \return actual mean value
    76             */
    77             float GetValue(void) const;
     74  /*!
     75  * \brief Value
     76  *
     77  * this method is equivalent to GetMatrix()->Value(0,0)
     78  *
     79  * \return actual mean value
     80  */
     81  float GetValue(void) const;
    7882
    79         private:
    80             //UpdateFrom method from base class IODevice
    81             void UpdateFrom(const core::io_data *data);
    82             gui::GroupBox *groupBox;
    83             gui::SpinBox *numberOfElements;
    84             core::cvmatrix *output;
    85             float previousValues[MAX_NUMBER_OF_ELEMENTS];//previous values storage
    86 
    87     };
    88 }// end namespace filter
    89 }// end namespace flair
     83private:
     84  // UpdateFrom method from base class IODevice
     85  void UpdateFrom(const core::io_data *data);
     86  gui::GroupBox *groupBox;
     87  gui::SpinBox *numberOfElements;
     88  core::cvmatrix *output;
     89  float previousValues[MAX_NUMBER_OF_ELEMENTS]; // previous values storage
     90};
     91} // end namespace filter
     92} // end namespace flair
    9093#endif // MEANFILTER_H
Note: See TracChangeset for help on using the changeset viewer.