gaze  0.1.0
Perform gaze tracking with common webcams.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
Public Member Functions | Protected Attributes | List of all members
gaze::PipelineStep Class Referenceabstract

Abstract base class for PipelineSteps. Must be inherited from. More...

#include "gaze/pipeline_step.h"

Inheritance diagram for gaze::PipelineStep:
gaze::pipeline::EyeLike gaze::pipeline::FaceLandmarks gaze::pipeline::FallbackStep gaze::pipeline::GazeCapture gaze::pipeline::GazePointCalculation gaze::pipeline::HeadPoseEstimation gaze::pipeline::PupilLocalization gaze::pipeline::SourceCapture

Public Member Functions

 PipelineStep ()
 
std::string get_name ()
 
Inheriting from PipelineStep

To inherit from PipelineStep, i.e. create a new step, follow these steps:

  • Create include/gaze/pipeline_steps/my_step.h.
    #ifndef INCLUDE_GAZE_PIPELINE_STEPS_MY_STEP_H_
    #define INCLUDE_GAZE_PIPELINE_STEPS_MY_STEP_H_
    #include "gaze/gui/visualizeable.h"
    #include "gaze/pipeline_step.h"
    #include "gaze/util/data.h"
    namespace gaze {
    namespace pipeline {
    class MyStep final
    : public PipelineStep,
    public gui::LabelVisualizeable {
    public:
    MyStep();
    void process(util::Data& data) override;
    void visualize(util::Data& data) override;
    };
    } // namespace pipeline
    } // namespace gaze
    #endif // INCLUDE_GAZE_PIPELINE_STEPS_MY_STEP_H_
  • Create src/gaze/pipeline_steps/my_step.cpp where you implement MyStep::MyStep(), MyStep::process(util::Data&), (and MyStep::visualize(util::Data&) if applicable)
  • Add an #include to include/gaze/pipeline_steps.h
  • Add the *.cpp file to src/gaze/CMakeLists.txt
  • Add a case to init_pipeline() in src/gaze/gaze_tracker.cpp
  • If you use a new widget, add traits to include/gaze/gui/visualizeable.h
virtual ~PipelineStep ()=default
 
virtual void process (util::Data &data)=0
 

Protected Attributes

int number
 
std::string name
 

Detailed Description

Abstract base class for PipelineSteps. Must be inherited from.

Custom PipelineSteps must implement their own process(util::Data* data) method. They should only add data to fields which were not written before.

Definition at line 18 of file pipeline_step.h.

Constructor & Destructor Documentation

gaze::PipelineStep::PipelineStep ( )

Increments the PipelineStep counter.

Definition at line 10 of file pipeline_step.cpp.

11  : number(++PipelineStep::counter),
12  name("Step " + std::to_string(number)) {
13 }
std::string name
Definition: pipeline_step.h:31
virtual gaze::PipelineStep::~PipelineStep ( )
virtualdefault

Override this method if you need more destruction control.

Member Function Documentation

std::string gaze::PipelineStep::get_name ( )

Returns the name of this step. If this is not overridden, names it Step # where # is a number starting at 0 and increasing with each step.

Returns
This step's name.

Definition at line 15 of file pipeline_step.cpp.

References name.

15  {
16  return this->name;
17 }
std::string name
Definition: pipeline_step.h:31
virtual void gaze::PipelineStep::process ( util::Data data)
pure virtual

This function must be overwritten by each PipelineStep. It should process the data object and write back its own results. While it is not forbidden to override values, this should be done with caution.

Parameters
dataThe data object to be updated.
Returns
via data the modified data object.

Implemented in gaze::pipeline::GazePointCalculation, gaze::pipeline::PupilLocalization, gaze::pipeline::HeadPoseEstimation, gaze::pipeline::SourceCapture, gaze::pipeline::GazeCapture, gaze::pipeline::FaceLandmarks, gaze::pipeline::EyeLike, and gaze::pipeline::FallbackStep.

Member Data Documentation

std::string gaze::PipelineStep::name
protected

The name of this PipelineStep. Should be unique if possible. By default "Step #" is assigned.

Definition at line 31 of file pipeline_step.h.

Referenced by gaze::pipeline::FallbackStep::FallbackStep(), get_name(), and gaze::pipeline::SourceCapture::SourceCapture().

int gaze::PipelineStep::number
protected

The number of the pipeline step.

Definition at line 25 of file pipeline_step.h.

Referenced by gaze::pipeline::FallbackStep::FallbackStep(), and gaze::pipeline::SourceCapture::SourceCapture().


The documentation for this class was generated from the following files: