Skip to content

Commit fc0db21

Browse files
author
Gary Frost
committed
allow -Dconstraint.scale.[start|stop] and -Dconstraint.inc properties
1 parent 58ae25b commit fc0db21

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

hat/examples/violajones/src/main/java/violajones/ifaces/ScaleTable.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,14 @@ class Constraints{
104104
}
105105
this.scales = nonFinalScales;
106106
}
107-
Constraints( int cascadeWidth, int cascadeHeight, int imageWidth, int imageHeight){
108-
this(1f,2f,0.06f,cascadeWidth,cascadeHeight,imageWidth,imageHeight);
109-
}
110-
public Constraints(Cascade cascade, int imageWidth, int imageHeight){
111-
this(1f,2f,0.06f,cascade.width(),cascade.height(),imageWidth,imageHeight);
112-
}
107+
108+
public Constraints(Cascade cascade, int imageWidth, int imageHeight){
109+
this(
110+
Float.parseFloat(System.getProperty("constraint.scale.start", "1")),
111+
Float.parseFloat(System.getProperty("constraint.scale.multiplier", "2")),
112+
Float.parseFloat(System.getProperty("constraint.inc", "0.06")),
113+
cascade.width(),cascade.height(),imageWidth,imageHeight);
114+
}
113115
}
114116

115117
default ScaleTable applyConstraints ( Constraints constraints) {

0 commit comments

Comments
 (0)