Libpointing
An open-source cross-platform library to get raw events from pointing devices and master transfer functions.
Composition.h
1 /* -*- mode: c++ -*-
2  *
3  * pointing/transferfunctions/Composition.h --
4  *
5  * Initial software
6  * Authors: Nicolas Roussel
7  * Copyright � Inria
8  *
9  * http://libpointing.org/
10  *
11  * This software may be used and distributed according to the terms of
12  * the GNU General Public License version 2 or any later version.
13  *
14  */
15 
16 #ifndef Composition_h
17 #define Composition_h
18 
19 #include <pointing/transferfunctions/TransferFunction.h>
20 
21 #include <list>
22 
23 namespace pointing {
24 
35  class Composition : public TransferFunction {
36 
37  PointingDevice *input ;
38  DisplayDevice *output ;
39  std::list<TransferFunction*> functions ;
40 
41  int debugLevel ;
42 
43  public:
44 
45  Composition(URI &uri, PointingDevice* input, DisplayDevice* output) ;
46 
54  void prependFunction(std::string uri) ;
55  void prependFunction(URI &uri) ;
56  void prependFunction(TransferFunction *function) ;
58 
66  void appendFunction(std::string uri) ;
67  void appendFunction(URI &uri) ;
68  void appendFunction(TransferFunction *function) ;
70 
74  unsigned long size(void) const { return functions.size() ; }
75 
76  void clearState(void) {}
77 
78  void applyi(int dxMickey, int dyMickey, int *dxPixel, int *dyPixel,
79  TimeStamp::inttime timestamp=TimeStamp::undef) ;
80  void applyd(int dxMickey, int dyMickey, double *dxPixel, double *dyPixel,
81  TimeStamp::inttime timestamp=TimeStamp::undef) ;
82 
83  URI getURI(bool expanded=false) const ;
84 
85  ~Composition(void) ;
86 
87  } ;
88 
89 }
90 
91 #endif
unsigned long size(void) const
Definition: Composition.h:74
void prependFunction(std::string uri)
prependFunction is used to add a function to the beginning of the list so that it is called at the be...
Definition: Composition.cpp:54
The Composition class can be used to apply several transfer functions to the input.
Definition: Composition.h:35
URI getURI(bool expanded=false) const
getURI The method constructs URI corresponding to the type and parameters of the transfer function...
Definition: Composition.cpp:122
void applyd(int dxMickey, int dyMickey, double *dxPixel, double *dyPixel, TimeStamp::inttime timestamp=TimeStamp::undef)
apply The main method of the class which applies the transfer function.
Definition: Composition.cpp:104
The TransferFunction class is an abstract class that creates an object of its concrete subclasses...
Definition: TransferFunction.h:38
Definition: DummyPointingDevice.cpp:23
void applyi(int dxMickey, int dyMickey, int *dxPixel, int *dyPixel, TimeStamp::inttime timestamp=TimeStamp::undef)
apply The main method of the class which applies the transfer function.
Definition: Composition.cpp:86
The PointingDevice class is used to represent Pointing Devices connected to the computer or pseudo-de...
Definition: PointingDevice.h:35
DisplayDevice class is used to represent the displays connected to the computer.
Definition: DisplayDevice.h:31
void appendFunction(std::string uri)
appendFunction is used to add a function to the end of the list so that it is called at the after all...
Definition: Composition.cpp:70
void clearState(void)
Method which clears the current state of the device to be the default one (without any remainders or ...
Definition: Composition.h:76