|
Krita Source Code Documentation
|
This class holds the parameters for a levels adjustment. It is modeled after KisCubicCurve and has similar interface and functionality. More...
#include <KisLevelsCurve.h>
Public Member Functions | |
| const QVector< qreal > & | floatTransfer (int size=256) const |
| Returns a vector of size. | |
| void | fromString (const QString &text, bool *ok=nullptr) |
| Parses the parameters from a given text. | |
| qreal | inputBlackPoint () const |
| Get the input black point. | |
| qreal | inputGamma () const |
| Get the gamma value. | |
| qreal | inputWhitePoint () const |
| Get the input white point. | |
| bool | isIdentity () const |
| Check whether the level info maps all values to themselves. | |
| KisLevelsCurve () | |
| KisLevelsCurve (const KisLevelsCurve &rhs)=default | |
| KisLevelsCurve (const QString &text) | |
| KisLevelsCurve (qreal inputBlackPoint, qreal inputWhitePoint, qreal inputGamma, qreal outputBlackPoint, qreal outputWhitePoint) | |
| const QString & | name () const |
| Get the name associated with this levels info object. | |
| KisLevelsCurve & | operator= (const KisLevelsCurve &rhs)=default |
| bool | operator== (const KisLevelsCurve &rhs) const |
| qreal | outputBlackPoint () const |
| Get the output black point. | |
| qreal | outputWhitePoint () const |
| Get the output white point. | |
| void | resetAll () |
| Resets the input and output levels (and gamma) | |
| void | resetInputLevels () |
| Resets the input levels only (and gamma) | |
| void | resetOutputLevels () |
| Resets the output levels only. | |
| void | setInputBlackPoint (qreal newInputBlackPoint) |
| Set the input black point. | |
| void | setInputGamma (qreal newInputGamma) |
| Set the gamma value. | |
| void | setInputWhitePoint (qreal newInputWhitePoint) |
| Set the input white point. | |
| void | setName (const QString &newName) |
| Set the name associated with this levels info object. This allows us to carry around a display name for the level info internally. It could potentially be useful anywhere level info are used in the UI. | |
| void | setOutputBlackPoint (qreal newOutputBlackPoint) |
| Set the output black point. | |
| void | setOutputWhitePoint (qreal newOutputWhitePoint) |
| Set the output white point. | |
| QString | toString () const |
| Get a text representation of the parameters. The format is: "input_black_point;input_white_point;input_gamma;output_black_point;output_white_point". For example: "0;1;0.6;0;1", "0.2;0.8;1.2;0.25;0.75". | |
| const QVector< quint16 > & | uint16Transfer (int size=256) const |
| Returns a vector of size. | |
| qreal | value (qreal x) const |
| Evaluates the function formed by the levels parameters for a given x. The input and output values are normalized. | |
Static Public Member Functions | |
| static constexpr qreal | defaultInputBlackPoint () |
| Default value for the input black point. | |
| static constexpr qreal | defaultInputGamma () |
| Default value for the input gamma. | |
| static constexpr qreal | defaultInputWhitePoint () |
| Default value for the input white point. | |
| static constexpr qreal | defaultOutputBlackPoint () |
| Default value for the output black point. | |
| static constexpr qreal | defaultOutputWhitePoint () |
| Default value for the output white point. | |
Private Member Functions | |
| void | invalidate () |
Private Attributes | |
| QVector< qreal > | m_fTransfer |
| qreal | m_inputBlackPoint |
| qreal | m_inputGamma |
| qreal | m_inputLevelsDelta |
| qreal | m_inputWhitePoint |
| qreal | m_inverseInputGamma |
| bool | m_mustRecomputeFTransfer |
| bool | m_mustRecomputeU16Transfer |
| QString | m_name |
| qreal | m_outputBlackPoint |
| qreal | m_outputLevelsDelta |
| qreal | m_outputWhitePoint |
| QVector< quint16 > | m_u16Transfer |
This class holds the parameters for a levels adjustment. It is modeled after KisCubicCurve and has similar interface and functionality.
Definition at line 21 of file KisLevelsCurve.h.
| KisLevelsCurve::KisLevelsCurve | ( | ) |
Definition at line 15 of file KisLevelsCurve.cpp.
| KisLevelsCurve::KisLevelsCurve | ( | qreal | inputBlackPoint, |
| qreal | inputWhitePoint, | ||
| qreal | inputGamma, | ||
| qreal | outputBlackPoint, | ||
| qreal | outputWhitePoint ) |
Definition at line 20 of file KisLevelsCurve.cpp.
| KisLevelsCurve::KisLevelsCurve | ( | const QString & | text | ) |
Definition at line 34 of file KisLevelsCurve.cpp.
References fromString().
|
default |
|
inlinestaticconstexpr |
Default value for the input black point.
Definition at line 27 of file KisLevelsCurve.h.
|
inlinestaticconstexpr |
Default value for the input gamma.
Definition at line 35 of file KisLevelsCurve.h.
|
inlinestaticconstexpr |
Default value for the input white point.
Definition at line 31 of file KisLevelsCurve.h.
|
inlinestaticconstexpr |
Default value for the output black point.
Definition at line 39 of file KisLevelsCurve.h.
|
inlinestaticconstexpr |
Default value for the output white point.
Definition at line 43 of file KisLevelsCurve.h.
| const QVector< qreal > & KisLevelsCurve::floatTransfer | ( | int | size = 256 | ) | const |
Returns a vector of size.
| size | with values obtained by evaluating the function formed by the levels parameters from 0.0 to 1.0. The resulting values are in the range [0, 1] |
| size | The size of the returned vector |
Definition at line 193 of file KisLevelsCurve.cpp.
References m_fTransfer, m_mustRecomputeFTransfer, and value().
| void KisLevelsCurve::fromString | ( | const QString & | text, |
| bool * | ok = nullptr ) |
Parses the parameters from a given text.
Definition at line 219 of file KisLevelsCurve.cpp.
References invalidate(), KIS_SAFE_ASSERT_RECOVER, m_inputBlackPoint, m_inputGamma, m_inputLevelsDelta, m_inputWhitePoint, m_inverseInputGamma, m_outputBlackPoint, m_outputLevelsDelta, m_outputWhitePoint, resetAll(), and KisDomUtils::toDouble().
| qreal KisLevelsCurve::inputBlackPoint | ( | ) | const |
Get the input black point.
Definition at line 64 of file KisLevelsCurve.cpp.
References m_inputBlackPoint.
| qreal KisLevelsCurve::inputGamma | ( | ) | const |
| qreal KisLevelsCurve::inputWhitePoint | ( | ) | const |
Get the input white point.
Definition at line 69 of file KisLevelsCurve.cpp.
References m_inputWhitePoint.
|
private |
Definition at line 267 of file KisLevelsCurve.cpp.
References m_mustRecomputeFTransfer, and m_mustRecomputeU16Transfer.
| bool KisLevelsCurve::isIdentity | ( | ) | const |
Check whether the level info maps all values to themselves.
Definition at line 155 of file KisLevelsCurve.cpp.
References m_inputBlackPoint, m_inputGamma, m_inputWhitePoint, m_outputBlackPoint, and m_outputWhitePoint.
| const QString & KisLevelsCurve::name | ( | ) | const |
Get the name associated with this levels info object.
Definition at line 165 of file KisLevelsCurve.cpp.
References m_name.
|
default |
| bool KisLevelsCurve::operator== | ( | const KisLevelsCurve & | rhs | ) | const |
Definition at line 40 of file KisLevelsCurve.cpp.
References m_inputBlackPoint, m_inputGamma, m_inputWhitePoint, m_outputBlackPoint, and m_outputWhitePoint.
| qreal KisLevelsCurve::outputBlackPoint | ( | ) | const |
Get the output black point.
Definition at line 79 of file KisLevelsCurve.cpp.
References m_outputBlackPoint.
| qreal KisLevelsCurve::outputWhitePoint | ( | ) | const |
Get the output white point.
Definition at line 84 of file KisLevelsCurve.cpp.
References m_outputWhitePoint.
| void KisLevelsCurve::resetAll | ( | ) |
Resets the input and output levels (and gamma)
Definition at line 124 of file KisLevelsCurve.cpp.
References defaultInputBlackPoint(), defaultInputGamma(), defaultInputWhitePoint(), defaultOutputBlackPoint(), defaultOutputWhitePoint(), invalidate(), m_inputBlackPoint, m_inputGamma, m_inputLevelsDelta, m_inputWhitePoint, m_inverseInputGamma, m_outputBlackPoint, m_outputLevelsDelta, and m_outputWhitePoint.
| void KisLevelsCurve::resetInputLevels | ( | ) |
Resets the input levels only (and gamma)
Definition at line 137 of file KisLevelsCurve.cpp.
References defaultInputBlackPoint(), defaultInputGamma(), defaultInputWhitePoint(), invalidate(), m_inputBlackPoint, m_inputGamma, m_inputLevelsDelta, m_inputWhitePoint, and m_inverseInputGamma.
| void KisLevelsCurve::resetOutputLevels | ( | ) |
Resets the output levels only.
Definition at line 147 of file KisLevelsCurve.cpp.
References defaultOutputBlackPoint(), defaultOutputWhitePoint(), invalidate(), m_outputBlackPoint, m_outputLevelsDelta, and m_outputWhitePoint.
| void KisLevelsCurve::setInputBlackPoint | ( | qreal | newInputBlackPoint | ) |
Set the input black point.
Definition at line 89 of file KisLevelsCurve.cpp.
References invalidate(), m_inputBlackPoint, m_inputLevelsDelta, and m_inputWhitePoint.
| void KisLevelsCurve::setInputGamma | ( | qreal | newInputGamma | ) |
Set the gamma value.
Definition at line 103 of file KisLevelsCurve.cpp.
References invalidate(), m_inputGamma, and m_inverseInputGamma.
| void KisLevelsCurve::setInputWhitePoint | ( | qreal | newInputWhitePoint | ) |
Set the input white point.
Definition at line 96 of file KisLevelsCurve.cpp.
References invalidate(), m_inputBlackPoint, m_inputLevelsDelta, and m_inputWhitePoint.
| void KisLevelsCurve::setName | ( | const QString & | newName | ) |
Set the name associated with this levels info object. This allows us to carry around a display name for the level info internally. It could potentially be useful anywhere level info are used in the UI.
Definition at line 170 of file KisLevelsCurve.cpp.
References m_name.
| void KisLevelsCurve::setOutputBlackPoint | ( | qreal | newOutputBlackPoint | ) |
Set the output black point.
Definition at line 110 of file KisLevelsCurve.cpp.
References invalidate(), m_outputBlackPoint, m_outputLevelsDelta, and m_outputWhitePoint.
| void KisLevelsCurve::setOutputWhitePoint | ( | qreal | newOutputWhitePoint | ) |
Set the output white point.
Definition at line 117 of file KisLevelsCurve.cpp.
References invalidate(), m_outputBlackPoint, m_outputLevelsDelta, and m_outputWhitePoint.
| QString KisLevelsCurve::toString | ( | ) | const |
Get a text representation of the parameters. The format is: "input_black_point;input_white_point;input_gamma;output_black_point;output_white_point". For example: "0;1;0.6;0;1", "0.2;0.8;1.2;0.25;0.75".
Definition at line 209 of file KisLevelsCurve.cpp.
References m_inputBlackPoint, m_inputGamma, m_inputWhitePoint, m_outputBlackPoint, m_outputWhitePoint, and KisDomUtils::toString().
| const QVector< quint16 > & KisLevelsCurve::uint16Transfer | ( | int | size = 256 | ) | const |
Returns a vector of size.
| size | with values obtained by evaluating the function formed by the levels parameters from 0.0 to 1.0. The resulting values are scaled to the range [0, 0xFF] |
| size | The size of the returned vector |
Definition at line 175 of file KisLevelsCurve.cpp.
References m_mustRecomputeU16Transfer, m_u16Transfer, and value().
| qreal KisLevelsCurve::value | ( | qreal | x | ) | const |
Evaluates the function formed by the levels parameters for a given x. The input and output values are normalized.
Definition at line 53 of file KisLevelsCurve.cpp.
References m_inputBlackPoint, m_inputLevelsDelta, m_inputWhitePoint, m_inverseInputGamma, m_outputBlackPoint, m_outputLevelsDelta, and m_outputWhitePoint.
|
mutableprivate |
Definition at line 174 of file KisLevelsCurve.h.
|
private |
Definition at line 169 of file KisLevelsCurve.h.
|
private |
Definition at line 169 of file KisLevelsCurve.h.
|
private |
Definition at line 171 of file KisLevelsCurve.h.
|
private |
Definition at line 169 of file KisLevelsCurve.h.
|
private |
Definition at line 171 of file KisLevelsCurve.h.
|
mutableprivate |
Definition at line 176 of file KisLevelsCurve.h.
|
mutableprivate |
Definition at line 175 of file KisLevelsCurve.h.
|
private |
Definition at line 172 of file KisLevelsCurve.h.
|
private |
Definition at line 170 of file KisLevelsCurve.h.
|
private |
Definition at line 171 of file KisLevelsCurve.h.
|
private |
Definition at line 170 of file KisLevelsCurve.h.
|
mutableprivate |
Definition at line 173 of file KisLevelsCurve.h.