|
ScaledIntegerNode |
( |
ImageFile |
destImageFile, |
|
|
double |
scaledValue, |
|
|
double |
scaledMinimum, |
|
|
double |
scaledMaximum, |
|
|
double |
scale = 1.0 , |
|
|
double |
offset = 0.0 |
|
) |
| [explicit] |
This second constructor create an E57 element for storing a fixed point number but does the scaling for you.
- Parameters:
-
[in] | destImageFile | The ImageFile where the new node will eventually be stored. |
[in] | scaledValue | The scaled integer value of the element. |
[in] | scaledMinimum | The smallest scaledValue that the element may take. |
[in] | scaledMaximum | The largest scaledValue that the element may take. |
[in] | scale | The scaling factor used to compute scaledValue from rawValue. |
[in] | offset | The offset factor used to compute scaledValue from rawValue. |
An ScaledIntegerNode stores an integer value, a lower and upper bound, and two conversion factors. This ScaledIntegerNode constructor calculates the rawValue, minimum, and maximum by doing the floor((scaledValue - offset)/scale + .5) on each scaled parameters. Warning: it is an error to give an rawValue outside the minimum / maximum bounds, even if the ScaledIntegerNode is destined to be used in a CompressedVectorNode prototype (where the rawValue will be ignored). If the ScaledIntegerNode is to be used in a prototype, it is recommended to specify a rawValue = 0 if 0 is within bounds, or a rawValue = minimum if 0 is not within bounds.
- Precondition:
- The destImageFile must be open (i.e. destImageFile.isOpen() must be true).
-
The destImageFile must have been opened in write mode (i.e. destImageFile.isWritable() must be true).
-
scaledMinimum <= scaledValue <= scaledMaximum
-
scale != 0
- Returns:
- A smart ScaledIntegerNode handle referencing the underlying object.
- Exceptions:
-
- See also:
- ScaledIntegerCreate.cpp example, ScaledIntegerNode::scaledValue, Node, CompressedVectorNode, CompressedVectorNode::prototype
|