Libpointing
An open-source cross-platform library to get raw events from pointing devices and master transfer functions.
SigmoidFunction.h
1 /* -*- mode: c++ -*-
2  *
3  * pointing/transferfunctions/SigmoidFunction.h --
4  *
5  * Initial software
6  * Authors: Géry Casiez, 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 SigmoidFunction_h
17 #define SigmoidFunction_h
18 
19 #include <pointing/transferfunctions/TransferFunction.h>
20 #include <pointing/utils/URI.h>
21 
22 /*
23  The sigmoid function is designed in the pointing
24  device speed, gain space
25 
26 Gain /\
27  |
28  |
29  Gmax + -----------------------
30  | /
31  | /
32  Gmin +----/
33  |
34  +----+--+-----------------------
35  V1 V2 MouseSpeed (m/s)
36  */
37 
38 namespace pointing {
39 
50 
51  private:
52 
53  float Gmin;
54  float Gmax;
55  float V1; // m/s
56  float V2; // m/s
57 
58  bool disableSubPixelation;
59 
60  int previousMouseRawX;
61  int previousMouseRawY;
62  float previousMouseXRemainder;
63  float previousMouseYRemainder;
64 
65  PointingDevice* pointingDevice;
66  DisplayDevice* displayDevice;
67 
68  public:
69 
70  SigmoidFunction(URI &uri, PointingDevice* input, DisplayDevice* output);
71 
72  void clearState(void) ;
73  void applyi(int dxMickey, int dyMickey, int *dxPixel, int *dyPixel,
74  TimeStamp::inttime timestamp=TimeStamp::undef) ;
75  void applyd(int dxMickey, int dyMickey, double *dxPixel, double *dyPixel,
76  TimeStamp::inttime timestamp=TimeStamp::undef) ;
77 
78  URI getURI(bool expanded=false) const ;
79 
80  ~SigmoidFunction() {}
81 
82  };
83 
84 }
85 
86 #endif
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: SigmoidFunction.cpp:76
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: SigmoidFunction.cpp:113
URI getURI(bool expanded=false) const
getURI The method constructs URI corresponding to the type and parameters of the transfer function...
Definition: SigmoidFunction.cpp:135
The SigmoidFunction class implements the transfer function which is an discrete approximation of the ...
Definition: SigmoidFunction.h:49
The TransferFunction class is an abstract class that creates an object of its concrete subclasses...
Definition: TransferFunction.h:38
Definition: DummyPointingDevice.cpp:23
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 clearState(void)
Method which clears the current state of the device to be the default one (without any remainders or ...
Definition: SigmoidFunction.cpp:68