UNIVERS
15.3
UNIVERS base processing software API
Main Page
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
include
zm
Scaler.H
1
// Scaler.H $Revision: 1.5 $ $Date: 1998/05/13 15:59:20 $
2
3
#if !defined __Scaler_H
4
5
#define __Scaler_H
6
7
8
#include <mix/Types.h>
9
10
/*************************************************************
11
* Scale as a mathematic object for mapping float values into
12
* pixels.
13
*************************************************************/
14
15
class
Scaler
16
{
17
protected
:
18
19
float
Vleft, Vright;
20
int
vSize;
21
int
vOffset;
22
23
public
:
24
25
Scaler
();
26
Scaler
(
float
v_left,
float
v_right);
27
28
int
get_coord (
float
value)
const
;
29
float
get_value (
int
coord)
const
;
30
31
Logic is_inside (
float
value)
const
;
32
33
float
get_left ()
const
;
// value V1
34
float
get_right ()
const
;
// value V2
35
int
get_size ()
const
;
36
int
get_offset ()
const
;
37
int
get_left_coord ()
const
;
38
int
get_right_coord ()
const
;
39
40
float
vpp ()
const
;
// value per pixel of size
41
42
virtual
void
set_size (
int
size);
43
virtual
void
set_offset (
int
offset);
44
virtual
void
set_range (
float
v_left,
float
v_right);
45
46
/* Zoom-in and zoom-out convenient methods, that change
47
Vleft and Vright but don't change vSize and vOffset.
48
v1 and v2 will be ordered properly so:
49
50
(Vleft <= v1 < v2 <= Vright) or (Vleft >= v1 > v2 >= Vright) */
51
52
void
zoom_in (
float
v1,
float
v2);
53
void
zoom_out (
float
v1,
float
v2);
54
55
};
56
57
#endif // Scaler.H
Scaler
Definition:
Scaler.H:15
Generated by
1.8.5