/* * Moonlight|3D * Copyright (C) 2006 The Moonlight|3D team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Created on May 2, 2006 */ package ml.backend.anim; import ml.core.helper.Value; public interface KeyframeInterpolator { /** * Check if this interpolator is applicable to the given value type. * Not all interpolation methods are possible for all value types. * * @param valueType the type ot the track's Value * @return true if this interpolator chan handle the given type */ public boolean isAppliciable(Value.Type valueType); /** * Calculate the value of the given track for the given time through * the implemented interpolation method and return that value. Note that * this method must also be able to extrapolate beyond the first and last * keyframe in the track. * * @param track the track to calculate an interpolation for * @param time time value for which the interpolated value is to be calculated * @return the interpolated value */ public Value interpolate(KeyframeAnimationTrack track, double time); /** * Return a unique type name for this interpolator. * * @return interpolator type name */ public String getType(); }