1 /* 2 * Copyright (C) 2017 Alberto Irurueta Carro (alberto@irurueta.com) 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.irurueta.ar.sfm; 17 18 import com.irurueta.geometry.PinholeCamera; 19 20 /** 21 * Listener in charge of attending events for an InitialCamerasEstimator, 22 * such as when estimation starts or finishes. 23 */ 24 public interface InitialCamerasEstimatorListener { 25 26 /** 27 * Called when estimation starts. 28 * 29 * @param estimator estimator raising the event. 30 */ 31 void onStart(final InitialCamerasEstimator estimator); 32 33 /** 34 * Called when estimation successfully finishes. 35 * 36 * @param estimator estimator raising the event. 37 * @param estimatedLeftCamera estimated camera on left view. 38 * @param estimatedRightCamera estimated camera on right view. 39 */ 40 void onFinish(final InitialCamerasEstimator estimator, final PinholeCamera estimatedLeftCamera, 41 final PinholeCamera estimatedRightCamera); 42 43 /** 44 * Called when estimation fails. 45 * 46 * @param estimator estimator raising the event. 47 * @param e reason of estimation failure. 48 */ 49 void onFail(final InitialCamerasEstimator estimator, final InitialCamerasEstimationFailedException e); 50 }