AdjustmentCurve: added new property-based modes#293
Conversation
|
updated documentation with e16988f |
| } | ||
| int i = 0; | ||
| while ((i < curvePoints.size() - 1) && (x > curvePoints.get(i).x)) { | ||
| while ((i < curvePoints.size() - 1) && (x > getX(i))) { |
There was a problem hiding this comment.
some comments would be nice:
You are looking for the first point, where x > curvePoint.x(i)??
There was a problem hiding this comment.
Yes, looks like that this is what the code is doing... ;)
It's just the old logic where the x/y values now aren't directly retrieved form curvePoints, but using helper methods getX() and getY() for making a mode possible where the points are interpreted as percentage values. I'm sure the logic could be somehow improved/beautified but since there are no automatic tests I thought I'll better leave it as it is. However I did some manual tests with the test models existing for AdjustmentCurve and they worked the same way as before after my changes.
|
|
||
| if ("operationMode".equalsIgnoreCase(propertyName)) { | ||
| final int oldValue = propOperationMode; | ||
| propOperationMode = Integer.parseInt(newValue.toString()); |
There was a problem hiding this comment.
in theory newValue could be null.
But this would also be a problem for the other properties
|
looks good and very good idea to add properties for easy configuration of curvePoints |
This PR adds a new property
operationModeto AdjustmentCurve with the following modes:use file and GUI--> original mode, acts as before, is the default operation modeuse property curvePoints (percent values)--> curve points can be defined by an additional propertycurvePointsand they are interpreted as percentage of the given min/max range of input and output.use property curvePoints (absolute values)--> curve points can be defined by an additional propertycurvePointsand they are interpreted as absolute values.The new modes can be handy to rapidly define a simple curve without the GUI and they do not need any external file in
bin/ARE/datalike the existing mode (which is now calleduse file and GUI).updated documentation is still missing and coming.