13#ifndef ML_SCALE_SHIFT_DATA_H
14#define ML_SCALE_SHIFT_DATA_H
67 ReorderColorPlanesToInterleaved = 1
79 _reorderMode(NoReordering)
87 _reorderMode(
ssd._reorderMode)
93 inline TScaleShiftData(DT scale, DT shift) : _scale(scale), _shift(shift) , _reorderMode(NoReordering)
108 :_reorderMode(NoReordering)
125 _reorderMode =
ssd._reorderMode;
147 return !(*
this ==
ssd);
190 _scale =
static_cast<DT
>(1);
276 _scale =
static_cast<DT
>(1);
284 _scale =
static_cast<DT
>(1);
285 _shift =
static_cast<DT
>(0);
286 _reorderMode = NoReordering;
321 ReorderMode _reorderMode;
337 inline ostream&
operator<<(ostream& s,
const ML_NAMESPACE::ScaleShiftData &
ssd)
339 return s <<
"Scale=" <<
ssd.getScale() <<
", Shift=" <<
ssd.getShift();
The class defines a first order linear transformation.
TScaleShiftData()
Default constructor, i.e., builds identity transformation.
void setReorderMode(ReorderMode mode)
Sets the reorder mode.
TScaleShiftData(DT fromMin, DT fromMax, DT toMin, DT toMax)
Values from interval [fromMin, fromMax] are transformed linearly into [toMin, toMax].
TScaleShiftData & operator=(const TScaleShiftData< DT > &ssd)
Assignment operator from an existing object to get an identical copy.
bool operator!=(const TScaleShiftData< DT > &ssd) const
Returns true if any members differ.
DT getScale() const
Returns the scale constant of the transformation y=scale*x+offset.
TScaleShiftData(const TScaleShiftData< DT > &ssd)
Copy constructor.
void setFromMinMaxToMinMax(DT fromMin, DT fromMax, DT toMin, DT toMax)
Values from interval [fromMin, fromMax] are transformed linearly into [toMin, toMax].
void setScaleOffset(DT scale, DT shift)
Sets scale and shift: values are multiplied with scale and then shift is added.
void setFromMinMaxToMinMax(MLDataType fromType, DT fromMin, DT fromMax, MLDataType toType, DT toMin, DT toMax)
Values from interval [fromMin, fromMax] are transformed linearly into [toMin, toMax].
ReorderMode getReorderMode() const
Returns the reorder mode.
bool operator==(const TScaleShiftData< DT > &ssd) const
Returns true if all members are equal.
void unset()
Sets the default, i.e., identity transformation.
ReorderMode
Mode that indicates whether copySubImage should reorder the color from planes (from x,...
TScaleShiftData(DT scale, DT shift)
Constructor: sets scale and shift to define a transformation so that a scaled value v' is v' = v*scal...
DT getShift() const
Returns the addition constant of the transformation y=scale*x+shift.
MLint32 MLDataType
MLDataType.
MLEXPORT MLint32 MLIsIntType(MLDataType dataType)
Returns true (=1) if data type dataType is an integer data type, otherwise false (=0).
bool MLValuesAreEqualWOM(MLint8 a, MLint8 b)
Returns true if values a and b are equal; otherwise, it returns false.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
MLEXPORT std::ostream & operator<<(std::ostream &s, const ml::Field &v)
Overloads the operator '<<' for stream output of Field objects.