Package ca.cgjennings.graphics.filters
Class Tuning
- java.lang.Object
-
- ca.cgjennings.graphics.filters.Tuning
-
public final class Tuning extends java.lang.ObjectTheTuningclass contains tuning hints that help the image processing system decide between multiple algorithms when performing certain operations. A default tuning profile is built in, but more accurate tuning values can be determined for a particular platform by callingupdate(int, boolean). This should only be done when no image processing is currently taking place. Tuning profiles can be read to and from a file to avoid having to callupdatefor each application run.- Since:
- 3.0
- Author:
- Chris Jennings
-
-
Field Summary
Fields Modifier and Type Field Description static floatFLIPstatic floatGET_INT_ARGBstatic floatGET_INT_OTHERstatic floatGET_INT_RGBstatic floatGROW_ROWSstatic floatPER_IMAGEstatic floatPER_ROWstatic floatPREMULstatic floatSET_INT_ARGBstatic floatSET_INT_OTHERstatic floatSET_INT_RGB
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] args)static voidread(java.util.Properties p)Sets the tuning parameters using previously written properties.static voidupdate(int accuracy, boolean printResults)Updates the tuning parameters with platform-specific data by running a sequence of test operations.static voidwrite(java.util.Properties p)Copies the tuning parameter values into a set of Properties.
-
-
-
Field Detail
-
SET_INT_ARGB
public static float SET_INT_ARGB
-
SET_INT_RGB
public static float SET_INT_RGB
-
SET_INT_OTHER
public static float SET_INT_OTHER
-
GET_INT_ARGB
public static float GET_INT_ARGB
-
GET_INT_RGB
public static float GET_INT_RGB
-
GET_INT_OTHER
public static float GET_INT_OTHER
-
PER_ROW
public static float PER_ROW
-
PER_IMAGE
public static float PER_IMAGE
-
GROW_ROWS
public static float GROW_ROWS
-
PREMUL
public static float PREMUL
-
FLIP
public static float FLIP
-
-
Method Detail
-
write
public static void write(java.util.Properties p)
Copies the tuning parameter values into a set of Properties. Tuning parameters will be added using a key consisting of "IMGOP_ACCEL_" followed by the tuning parameter name. This can be used to save the tuning parameters instead of running update- Parameters:
p- the properties instance to add the tuning parameters to
-
read
public static void read(java.util.Properties p)
Sets the tuning parameters using previously written properties.- Parameters:
p- the properties instance to read the turning parameters from
-
update
public static void update(int accuracy, boolean printResults)Updates the tuning parameters with platform-specific data by running a sequence of test operations. The accuracy parameter allows you to trade speed for accuracy. Lower values will allow the tests to complete more quickly and use fewer resources. Higher values will obtain more accurate results.- Parameters:
accuracy- a value from 1-9, with higher values requested progressively more accurate resultsprintResults- iftruethe results will be printed to System.err as they are generated.
-
main
public static void main(java.lang.String[] args)
-
-