#include <mlScaleShiftData.h>
Public Types | |
| enum | ReorderMode { NoReordering = 0, ReorderColorPlanesToInterleaved = 1 } |
| Mode that indicates if copySubImage should reorder the color from planes (from x,y,z,c,t,u) to interleaved format (c,x,y,z,c,t,u). More... | |
Public Member Functions | |
| ReorderMode | getReorderMode () const |
| Get the reorder mode. | |
| void | setReorderMode (ReorderMode mode) |
| Set the reorder mode. | |
Initialization | |
| TScaleShiftData () | |
| Default constructor, i.e., builds identity transformation. | |
| TScaleShiftData (const TScaleShiftData< DT > &ssd) | |
| Copy constructor. | |
| TScaleShiftData (DT scale, DT shift) | |
Constructor: Sets scale and shift to define a transformation so that a scaled value v' is v' = v*scale + shift. | |
| TScaleShiftData (DT fromMin, DT fromMax, DT toMin, DT toMax) | |
Values from interval [fromMin, fromMax] are transformed linearly into [toMin, toMax]. | |
Assignment. | |
| TScaleShiftData & | operator= (const TScaleShiftData< DT > &ssd) |
| Assignment operator from an existing object to get an identical copy. | |
Comparison. | |
| bool | operator== (const TScaleShiftData< DT > &ssd) const |
Returns true if all members are equal. | |
| bool | operator!= (const TScaleShiftData< DT > &ssd) const |
Returns true if any members differ. | |
Set transformation | |
| void | setScaleOffset (DT scale, DT shift) |
Sets scale and shift: values are multiplied with scale and then shift is added. | |
| void | setFromMinMaxToMinMax (DT fromMin, DT fromMax, DT toMin, DT toMax) |
Values from interval [fromMin, fromMax] are transformed linearly into [toMin, toMax]. | |
| void | unset () |
| Sets default, i.e., identity transformation. | |
Query transformation values. | |
| DT | getScale () const |
| Returns scale constant from transformation y=scale*x+offset. | |
| DT | getShift () const |
| Returns addition constant shift from transformation y=scale*x+shift. | |
It is used as container for the parameters scale and shift of a linear transformation y=scale*x+shift.
Notes:
Definition at line 45 of file mlScaleShiftData.h.
| enum ml::TScaleShiftData::ReorderMode |
Mode that indicates if copySubImage should reorder the color from planes (from x,y,z,c,t,u) to interleaved format (c,x,y,z,c,t,u).
Note that a SubImage with interleaved color data will not be fully functional, since it will not have correct internal strides etc. Typically ReorderMode::ReorderColorPlanesToInterleaved is used to convert color images for usage with OpenGL or other APIs that require RGBRGBRGB... or RGBARGBA... data.
| NoReordering | < no reodering is done |
| ReorderColorPlanesToInterleaved | < reorders the color planes to interleaved format. |
Definition at line 56 of file mlScaleShiftData.h.
| ml::TScaleShiftData< DT >::TScaleShiftData | ( | ) | [inline] |
Default constructor, i.e., builds identity transformation.
Definition at line 67 of file mlScaleShiftData.h.
| ml::TScaleShiftData< DT >::TScaleShiftData | ( | const TScaleShiftData< DT > & | ssd | ) | [inline] |
| ml::TScaleShiftData< DT >::TScaleShiftData | ( | DT | scale, | |
| DT | shift | |||
| ) | [inline] |
Constructor: Sets scale and shift to define a transformation so that a scaled value v' is v' = v*scale + shift.
Definition at line 86 of file mlScaleShiftData.h.
| ml::TScaleShiftData< DT >::TScaleShiftData | ( | DT | fromMin, | |
| DT | fromMax, | |||
| DT | toMin, | |||
| DT | toMax | |||
| ) | [inline] |
Values from interval [fromMin, fromMax] are transformed linearly into [toMin, toMax].
If necessary, interval borders are swapped to guarantee that minimum values are smaller or equal than maximum values. In case that fromMin and fromMax are identical, _scale is set to 1 and _shift is set to toMin - fromMin. So the only value from that interval is projected to the minimum value of the target interval. ATTENTION: This transformation defines no clipping/clamping. If values outside [fromMin, fromMax] are transformed they will be transformed to values outside [toMin, toMax].
Definition at line 101 of file mlScaleShiftData.h.
| ReorderMode ml::TScaleShiftData< DT >::getReorderMode | ( | ) | const [inline] |
Get the reorder mode.
Definition at line 229 of file mlScaleShiftData.h.
Referenced by ml::TSubImage< DATATYPE >::copySubImage().
| DT ml::TScaleShiftData< DT >::getScale | ( | ) | const [inline] |
Returns scale constant from transformation y=scale*x+offset.
Definition at line 222 of file mlScaleShiftData.h.
Referenced by ml::TSubImage< DATATYPE >::copySubImage(), and ml::TSubImage< DATATYPE >::copySubImageReorderColorPlanesToInterleaved().
| DT ml::TScaleShiftData< DT >::getShift | ( | ) | const [inline] |
Returns addition constant shift from transformation y=scale*x+shift.
Definition at line 225 of file mlScaleShiftData.h.
Referenced by ml::TSubImage< DATATYPE >::copySubImage(), and ml::TSubImage< DATATYPE >::copySubImageReorderColorPlanesToInterleaved().
| bool ml::TScaleShiftData< DT >::operator!= | ( | const TScaleShiftData< DT > & | ssd | ) | const [inline] |
| TScaleShiftData& ml::TScaleShiftData< DT >::operator= | ( | const TScaleShiftData< DT > & | ssd | ) | [inline] |
Assignment operator from an existing object to get an identical copy.
Definition at line 117 of file mlScaleShiftData.h.
| bool ml::TScaleShiftData< DT >::operator== | ( | const TScaleShiftData< DT > & | ssd | ) | const [inline] |
| void ml::TScaleShiftData< DT >::setFromMinMaxToMinMax | ( | DT | fromMin, | |
| DT | fromMax, | |||
| DT | toMin, | |||
| DT | toMax | |||
| ) | [inline] |
Values from interval [fromMin, fromMax] are transformed linearly into [toMin, toMax].
If necessary then interval borders are swapped to guarantee that minimum values are smaller or equal than maximum values. In case that fromMin and fromMax are identical, _scale is set to 1 and _shift is set to toMin - fromMin. So the only value from that interval is projected to the minimum value of the target interval. ATTENTION: This transformation defines no clipping/clamping. If values outside [fromMin, fromMax] are transformed they will be transformed to values outside [toMin, toMax].
Definition at line 179 of file mlScaleShiftData.h.
| void ml::TScaleShiftData< DT >::setReorderMode | ( | ReorderMode | mode | ) | [inline] |
| void ml::TScaleShiftData< DT >::setScaleOffset | ( | DT | scale, | |
| DT | shift | |||
| ) | [inline] |
Sets scale and shift: values are multiplied with scale and then shift is added.
Definition at line 161 of file mlScaleShiftData.h.
| void ml::TScaleShiftData< DT >::unset | ( | ) | [inline] |
1.5.8