RCKit
Main Page
Classes
Files
Examples
File List
File Members
Linear.h
1
// Linear.h
2
//
3
// Setter class that implements linear transform of its input value
4
/// \author Mike McCauley (mikem@airspayce.com)
5
///
6
// Copyright (C) 2010 Mike McCauley
7
// $Id: Linear.h,v 1.1 2012/08/25 06:18:13 mikem Exp $
8
9
#ifndef Linear_h
10
#define Linear_h
11
12
#include "Setter.h"
13
14
/////////////////////////////////////////////////////////////////////
15
/// \class Linear Linear.h <Linear.h>
16
/// \brief Setter class that implements linear transform of its input value
17
///
18
/// Linear implements a y = mx + x linear transform of the input value.
19
/// The resulting output value is sent to the next Setter (the target) in the chain.
20
///
21
class
Linear
:
public
Setter
22
{
23
public
:
24
/// Constructor.
25
/// Output will be calculated according to out = (in * gain) + offset
26
Linear
(
float
gain,
int
offset);
27
28
/// Input the value to be transformed
29
/// \param[in] value The input value
30
virtual
void
input
(
int
value);
31
32
protected
:
33
34
private
:
35
36
/// Offset added to the output value
37
int
_offset;
38
39
/// Gain multiplied by the input value
40
float
_gain;
41
};
42
43
#endif
Generated by
1.8.1