Libpointing
An open-source cross-platform library to get raw events from pointing devices and master transfer functions.
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
pointing::TransferFunction Class Referenceabstract

The TransferFunction class is an abstract class that creates an object of its concrete subclasses. More...

#include <TransferFunction.h>

Inheritance diagram for pointing::TransferFunction:
pointing::Composition pointing::ConstantFunction pointing::Interpolation pointing::NaiveConstantFunction pointing::SigmoidFunction pointing::SubPixelFunction

Public Member Functions

virtual void clearState (void)=0
 Method which clears the current state of the device to be the default one (without any remainders or previous data).
 
virtual void applyi (int dxMickey, int dyMickey, int *dxPixel, int *dyPixel, TimeStamp::inttime timestamp=TimeStamp::undef)=0
 apply The main method of the class which applies the transfer function. More...
 
virtual void applyd (int dxMickey, int dyMickey, double *dxPixel, double *dyPixel, TimeStamp::inttime timestamp=TimeStamp::undef)=0
 apply The main method of the class which applies the transfer function. More...
 
virtual URI getURI (bool expanded=false) const =0
 getURI The method constructs URI corresponding to the type and parameters of the transfer function. More...
 
virtual void setDebugLevel (int)
 Sets the level of information for debugging purposes (default = 0).
 
virtual void debug (std::ostream &) const
 

Static Public Member Functions

static std::list< std::string > schemes (void)
 
static TransferFunctioncreate (const char *function_uri, PointingDevice *input, DisplayDevice *output)
 Static method to instantiate an object of a sub-class. More...
 
static TransferFunctioncreate (std::string function_uri, PointingDevice *input, DisplayDevice *output)
 Static method to instantiate an object of a sub-class. More...
 
static TransferFunctioncreate (URI &function_uri, PointingDevice *input, DisplayDevice *output)
 Static method to instantiate an object of a sub-class. More...
 

Protected Member Functions

void normalizeInput (int *dx, int *dy, PointingDevice *input) const
 normalizeInput Normalizes input to a transfer function with respect to the given PointingDevice. For example, to prevent fast movements of the cursor for high resolution mice. dx and dy are changed according to the input->getResolution() More...
 
void normalizeOutput (int *dx, int *dy, DisplayDevice *output) const
 normalizeOutput Normalizes output of a transfer function with respect to the given DisplayDevice. For example, to prevent slow movements of the cursor for high resolution display. dx and dy are changed according to the output->getResolution() More...
 

Detailed Description

The TransferFunction class is an abstract class that creates an object of its concrete subclasses.

Subclasses may caracterize either platform specific transfer functions or transfer functions conforming to a certain law. It uses URIs to specify the object type.

Member Function Documentation

virtual void pointing::TransferFunction::applyd ( int  dxMickey,
int  dyMickey,
double *  dxPixel,
double *  dyPixel,
TimeStamp::inttime  timestamp = TimeStamp::undef 
)
pure virtual

apply The main method of the class which applies the transfer function.

Parameters
dxMickeyTranslation in dots of the input device along x direction.
dyMickeyTranslation in dots of the input device along y direction.
dxPixel(Double) Computed translation in pixels of the output device along x direction.
dyPixel(Double) Computed translation in pixels of the output device along y direction.
timestamp

Implemented in pointing::SubPixelFunction, pointing::Interpolation, pointing::Composition, pointing::SigmoidFunction, pointing::ConstantFunction, and pointing::NaiveConstantFunction.

virtual void pointing::TransferFunction::applyi ( int  dxMickey,
int  dyMickey,
int *  dxPixel,
int *  dyPixel,
TimeStamp::inttime  timestamp = TimeStamp::undef 
)
pure virtual

apply The main method of the class which applies the transfer function.

Parameters
dxMickeyTranslation in dots of the input device along x direction.
dyMickeyTranslation in dots of the input device along y direction.
dxPixel(Integer) Computed translation in pixels of the output device along x direction.
dyPixel(Integer) Computed translation in pixels of the output device along y direction.
timestamp

Implemented in pointing::SubPixelFunction, pointing::Interpolation, pointing::Composition, pointing::SigmoidFunction, pointing::ConstantFunction, and pointing::NaiveConstantFunction.

TransferFunction * pointing::TransferFunction::create ( const char *  function_uri,
PointingDevice input,
DisplayDevice output 
)
static

Static method to instantiate an object of a sub-class.

Parameters
function_uriURI defining the type and details of an object
inputInput device associated with this transfer function.
outputOutput device associated with this transfer function
Returns
Pointer to the initialized transfer function.
TransferFunction * pointing::TransferFunction::create ( std::string  function_uri,
PointingDevice input,
DisplayDevice output 
)
static

Static method to instantiate an object of a sub-class.

Parameters
function_uriURI defining the type and details of an object
inputInput device associated with this transfer function.
outputOutput device associated with this transfer function
Returns
Pointer to the initialized transfer function.
TransferFunction * pointing::TransferFunction::create ( URI &  function_uri,
PointingDevice input,
DisplayDevice output 
)
static

Static method to instantiate an object of a sub-class.

Parameters
function_uriURI defining the type and details of an object
inputInput device associated with this transfer function.
outputOutput device associated with this transfer function
Returns
Pointer to the initialized transfer function.
virtual URI pointing::TransferFunction::getURI ( bool  expanded = false) const
pure virtual

getURI The method constructs URI corresponding to the type and parameters of the transfer function.

Parameters
expandedIndicates whether all parameters must be included in URI.
Returns
URI result.

Implemented in pointing::SubPixelFunction, pointing::Interpolation, pointing::Composition, pointing::SigmoidFunction, pointing::ConstantFunction, and pointing::NaiveConstantFunction.

void pointing::TransferFunction::normalizeInput ( int *  dx,
int *  dy,
PointingDevice input 
) const
protected

normalizeInput Normalizes input to a transfer function with respect to the given PointingDevice. For example, to prevent fast movements of the cursor for high resolution mice. dx and dy are changed according to the input->getResolution()

Parameters
dxInput x-displacement
dyInput y-displacement
inputGiven PointingDevice
void pointing::TransferFunction::normalizeOutput ( int *  dx,
int *  dy,
DisplayDevice output 
) const
protected

normalizeOutput Normalizes output of a transfer function with respect to the given DisplayDevice. For example, to prevent slow movements of the cursor for high resolution display. dx and dy are changed according to the output->getResolution()

Parameters
dxx-pixel-displacement
dyy-pixel-displacement
outputGiven DisplayDevice

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