VR-Engage
2.2
Loading...
Searching...
No Matches
remapValueTransform.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2025 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
6
//! \file
7
//! \brief Value transformation that remaps input values from one range to another
8
9
#pragma once
10
11
#include "
vreInput/export.h
"
12
#include "
vreInput/valueTransform.h
"
13
14
namespace
makVre
15
{
16
//! \brief Value transformation that linearly remaps values from one range to another
17
//!
18
//! This transform changes the range of input values by mapping them from an input range
19
//! to an output range using linear interpolation. It's useful for normalizing or
20
//! scaling values from hardware-specific ranges to standardized ranges.
21
class
VREINPUT_DLL
DtRemapValueTransform
:
public
DtValueTransform
22
{
23
public
:
24
//! \brief Default constructor
25
//!
26
//! Initializes the remap ranges with default values
27
DtRemapValueTransform
();
28
29
//! \brief Virtual destructor
30
virtual
~DtRemapValueTransform
()
override
;
31
32
//! \brief Initialize the remap transform from configuration
33
//!
34
//! Reads the input and output range parameters from the configuration table.
35
//! Expected configuration parameters are:
36
//! - "InputMin": Minimum value of the input range
37
//! - "InputMax": Maximum value of the input range
38
//! - "OutputMin": Minimum value of the output range
39
//! - "OutputMax": Maximum value of the output range
40
//!
41
//! \param config Pointer to the configuration table
42
virtual
void
init
(
DtInitTable
* config)
override
;
43
44
//! \brief Apply the remapping transformation to an input value
45
//!
46
//! Linearly remaps the input value from the input range to the output range.
47
//! Values outside the input range will be clamped to the output range boundaries.
48
//!
49
//! \param value The raw input value to transform
50
//! \return The remapped value in the output range
51
virtual
float
transform
(
float
value)
override
;
52
53
protected
:
54
//! \brief Minimum value of the input range
55
float
myInputMin
;
56
57
//! \brief Maximum value of the input range
58
float
myInputMax
;
59
60
//! \brief Minimum value of the output range
61
float
myOutputMin
;
62
63
//! \brief Maximum value of the output range
64
float
myOutputMax
;
65
66
//! \brief Size of the input range (InputMax - InputMin)
67
//!
68
//! Pre-calculated for efficiency in the transform function
69
float
myInputRange
;
70
71
//! \brief Size of the output range (OutputMax - OutputMin)
72
//!
73
//! Pre-calculated for efficiency in the transform function
74
float
myOutputRange
;
75
};
76
77
}
// namespace makVre
makVre::DtInitTable
Table-based access to Lua state for configuration data.
Definition
initializer.h:38
makVre::DtRemapValueTransform::myInputMax
float myInputMax
Maximum value of the input range.
Definition
remapValueTransform.h:58
makVre::DtRemapValueTransform::init
virtual void init(DtInitTable *config) override
Initialize the remap transform from configuration.
makVre::DtRemapValueTransform::myOutputMin
float myOutputMin
Minimum value of the output range.
Definition
remapValueTransform.h:61
makVre::DtRemapValueTransform::transform
virtual float transform(float value) override
Apply the remapping transformation to an input value.
makVre::DtRemapValueTransform::myInputRange
float myInputRange
Size of the input range (InputMax - InputMin)
Definition
remapValueTransform.h:69
makVre::DtRemapValueTransform::myOutputMax
float myOutputMax
Maximum value of the output range.
Definition
remapValueTransform.h:64
makVre::DtRemapValueTransform::myOutputRange
float myOutputRange
Size of the output range (OutputMax - OutputMin)
Definition
remapValueTransform.h:74
makVre::DtRemapValueTransform::~DtRemapValueTransform
virtual ~DtRemapValueTransform() override
Virtual destructor.
makVre::DtRemapValueTransform::myInputMin
float myInputMin
Minimum value of the input range.
Definition
remapValueTransform.h:55
makVre::DtRemapValueTransform::DtRemapValueTransform
DtRemapValueTransform()
Default constructor.
makVre::DtValueTransform::DtValueTransform
DtValueTransform()
Default constructor.
Definition
valueTransform.h:27
export.h
Defines DLL export/import macros for the vreInput library.
VREINPUT_DLL
#define VREINPUT_DLL
DLL export/import macro for the vreInput library.
Definition
export.h:25
makVre
Include export definitions for this library.
Definition
glsVreMessageUtil.h:49
valueTransform.h
Abstract base class for input value transformation operations.
Generated on 2026-01-13 from SVN revision 282860 - Copyright © 2005-2026 MAK Technologies. All Rights Reserved.