Libpointing
An open-source cross-platform library to get raw events from pointing devices and master transfer functions.
SubPixelFunction.h
1 /* -*- mode: c++ -*-
2  *
3  * pointing/transferfunctions/SubPixelFunction.h --
4  *
5  * Initial software
6  * Authors: Izzat Mukhanov
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 SUBPIXELFUNCTION_H
17 #define SUBPIXELFUNCTION_H
18 
19 #include <pointing/transferfunctions/TransferFunction.h>
20 
21 namespace pointing
22 {
31  {
32  PointingDevice *input;
33  DisplayDevice *output;
34  // Decorator pattern is used to extend any TransferFunction
35  TransferFunction *func;
36 
37  bool isOn;
38  int cardinality;
39  int widgetSize;
40  float resUseful;
41 
42  TimeStamp::inttime lastTime;
43  double vPix, vUse, gOpt, gPix;
44 
45  void minGainAndVelocity();
46  void computeParameters();
47 
48  int debugLevel;
49 
50  URI decodeURI(URI &uri);
51  void initialize(URI &uri, URI &funcUri, PointingDevice *input, DisplayDevice *output);
52 
53  public:
54 
55  SubPixelFunction(const char* uri, PointingDevice *input, DisplayDevice *output);
56  SubPixelFunction(std::string uri, PointingDevice *input, DisplayDevice *output);
57  SubPixelFunction(URI &uri, PointingDevice *input, DisplayDevice *output);
58 
59  SubPixelFunction(URI uri, URI funcUri, PointingDevice *input, DisplayDevice *output);
60 
65  void setSubPixeling(bool subpixeling);
66 
71  bool getSubPixeling() const;
72 
78  void setHumanResolution(int humanResolution);
79 
85  int getHumanResolution() const;
86 
92  void setCardinalitySize(int cardinality, int size);
93 
99  void getCardinalitySize(int *cardinality, int *size) const;
100 
101  void clearState(void);
102 
103  void applyi(int dxMickey, int dyMickey, int *dxPixel, int *dyPixel,
104  TimeStamp::inttime timestamp=TimeStamp::undef);
105 
106  void applyd(int dxMickey, int dyMickey, double *dxPixel, double *dyPixel,
107  TimeStamp::inttime timestamp=TimeStamp::undef);
108 
109  URI getURI(bool expanded=false) const;
110 
116  URI getInnerURI(bool expanded=false) const;
117 
118  ~SubPixelFunction();
119  };
120 }
121 
122 #endif // SUBPIXELFUNCTION_H
void clearState(void)
Method which clears the current state of the device to be the default one (without any remainders or ...
Definition: SubPixelFunction.cpp:164
void getCardinalitySize(int *cardinality, int *size) const
getCardinalitySize
Definition: SubPixelFunction.cpp:158
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: SubPixelFunction.cpp:170
URI getURI(bool expanded=false) const
getURI The method constructs URI corresponding to the type and parameters of the transfer function...
Definition: SubPixelFunction.cpp:215
void setSubPixeling(bool subpixeling)
setSubPixeling Turn on or off subpixeling
Definition: SubPixelFunction.cpp:130
void setCardinalitySize(int cardinality, int size)
setCardinalitySize
Definition: SubPixelFunction.cpp:151
void setHumanResolution(int humanResolution)
setHumanResolution Sets the resolution of the pointing device at which humans have maximum pointing t...
Definition: SubPixelFunction.cpp:140
The SubPixelFunction class is the subclass of TransferFunction which can be used to extend any Transf...
Definition: SubPixelFunction.h:30
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: SubPixelFunction.cpp:175
bool getSubPixeling() const
getSubPixeling Is subpixeling activated?
Definition: SubPixelFunction.cpp:135
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
URI getInnerURI(bool expanded=false) const
getInnerURI The original transfer function URI without subpixeling
Definition: SubPixelFunction.cpp:228
int getHumanResolution() const
getHumanResolution Gets the resolution of the pointing device at which humans have maximum pointing t...
Definition: SubPixelFunction.cpp:146