/******************************************************************************* * * The same as execute(), but the operand image is disposed before returning. * * @param image the image to process * @param operation the operation to execute * @param operationName the name used for the statistics * @return the operation (as a convenience in case it carries * results) * *******************************************************************************/ protected <T extends Operation> T executeAndDispose (EditableImage image, T operation, String operationName) { final T result = execute(image, operation, operationName); image.dispose(); return result; }
/******************************************************************************* * * The same as execute2(), but the operand image is disposed before returning. * * @param image the image to process * @param operation the operation to execute * @param operationName the name used for the statistics * @return the result * *******************************************************************************/ protected EditableImage execute2AndDispose (EditableImage image, Operation operation, String operationName) { final EditableImage result = execute2(image, operation, operationName); image.dispose(); result.setNickName(operationName); return result; }